:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --primary-color: #f26a1b;
    --primary-hover: #d9560c;
    --primary-light: #ff9a5c;
    --primary-rgb: 242, 106, 27;
    --hero-bg: radial-gradient(120% 140% at 85% 110%, rgba(255, 122, 38, 0.28) 0%, transparent 45%),
               radial-gradient(90% 120% at 30% 100%, rgba(20, 184, 166, 0.35) 0%, transparent 55%),
               linear-gradient(115deg, #050b10 0%, #071a20 45%, #0b3134 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: rgba(255, 255, 255, 0.05);
    --card-radius: 16px;
    --subtle-bg: rgba(255, 255, 255, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@keyframes gradientBg {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardShow {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #0b1120);
    background-size: 400% 400%;
    animation: gradientBg 20s ease infinite;
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

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

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* ====== CARDS ====== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: slideUp 0.5s ease both;
}

.card:nth-child(1) {
    animation-delay: 0.05s;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.15s;
}

.card:nth-child(4) {
    animation-delay: 0.2s;
}

.card:nth-child(5) {
    animation-delay: 0.25s;
}

@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    }

    .modal-backdrop .card:hover {
        transform: none;
    }
}

/* ====== FORMS ====== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(15, 23, 42, 1);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background: var(--success);
    border-color: var(--success);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Custom Radio */
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
}

input[type="radio"]:checked {
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* ====== BUTTONS ====== */
.btn {
    display: inline-block;
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-radius: 999px;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.28);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.5);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary:active {
    transform: scale(0.97) translateY(0);
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.3);
}

/* ====== BOTTOM NAV ====== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-around;
    padding: 0.6rem 0 calc(0.6rem + env(safe-area-inset-bottom));
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    font-family: inherit;
    flex: 1;
    max-width: 96px;
    min-height: 48px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0.4rem 0.25rem;
    border-radius: 12px;
    position: relative;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active svg {
    transform: translateY(-1px) scale(1.08);
}

.nav-item:active {
    transform: scale(0.94);
}

.nav-item:hover {
    color: var(--text-main);
}

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

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -0.6rem;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--primary-color);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.5);
}

.nav-item.active .nav-icon {
    transform: scale(1.1) translateY(-1px);
    filter: drop-shadow(0 2px 4px rgba(var(--primary-rgb), 0.4));
}

.nav-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ====== UTILITIES ====== */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

/* View Transitions */
.view {
    animation: fadeIn 0.35s ease-in-out;
}

/* ====== CHARTS ====== */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* ====== KANBAN ====== */
.kanban-col {
    background: rgba(30, 41, 59, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    transition: background-color 0.3s ease;
}

.kanban-header {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kanban-col-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border-color: rgba(var(--primary-rgb), 0.25);
}

/* ====== SIDEBAR ====== */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-item {
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.875rem;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.sidebar-item.active {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-item-static {
    cursor: default;
}

.sidebar-item-static:hover {
    background: none;
    color: var(--text-muted);
}

.sidebar-item-danger,
.sidebar-item-danger:hover {
    color: var(--danger);
}

.sidebar-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

#sidebarWeatherTemp {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 1.5rem 0 0.5rem;
}

.sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#sidebarBackdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

#sidebarPanel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 86vw;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 3100;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    padding: calc(1.5rem + env(safe-area-inset-top)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    overscroll-behavior: contain;
}

body.sidebar-open #sidebarBackdrop {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open #sidebarPanel {
    transform: translateX(0);
    visibility: visible;
}

#sidebarProfile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 12px;
    min-width: 0;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-name {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ====== HEADER ====== */
#appHeader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

#headerTitle {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.3px;
}

.sidebar-brand {
    color: var(--primary-color);
}

.header-spacer {
    width: 40px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.icon-btn:active {
    transform: scale(0.94);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

body.theme-light .icon-btn {
    background: rgba(15, 23, 42, 0.05);
}

body.theme-light .icon-btn:hover {
    background: rgba(15, 23, 42, 0.1);
}

/* ====== APP STATES ====== */
body.is-authed #app {
    padding-top: calc(54px + env(safe-area-inset-top) + 1.25rem);
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.app-loading {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(148, 163, 184, 0.25);
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

/* ====== LOGIN ====== */
.login-view {
    min-height: calc(100vh - 2rem);
    min-height: calc(100dvh - 2rem);
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.12);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary-color);
}

.login-logo svg {
    width: 30px;
    height: 30px;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--text-main);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.auth-error {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-size: 0.85rem;
}

/* ====== WEEKLY REVIEW + EXPORT ====== */
.review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.review-head .icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.review-range {
    text-align: center;
}

.review-range-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.review-range-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.review-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.review-tile {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: 1rem;
    min-width: 0;
}

.review-tile-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.review-tile-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-delta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.review-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.review-title svg {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.review-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
}

.review-note,
.review-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.review-note.text-success { color: var(--success); }
.review-note.text-danger { color: var(--danger); }
.review-note.text-warning { color: var(--warning); margin-top: 0.5rem; }

.review-money {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.review-money span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.review-money strong {
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.review-bars {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem;
}

.review-bar-col {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.review-bar-track {
    height: 72px;
    display: flex;
    align-items: flex-end;
    background: var(--subtle-bg);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.review-bar {
    width: 100%;
    background: var(--primary-color);
    border-radius: 6px 6px 0 0;
}

.review-today {
    color: var(--primary-color);
    font-weight: 700;
}

.review-row {
    margin-bottom: 0.6rem;
}

.review-row-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.review-row-top strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.review-progress {
    height: 6px;
    background: var(--subtle-bg);
    border-radius: 99px;
    overflow: hidden;
}

.review-progress div {
    height: 100%;
    background: var(--primary-color);
    border-radius: 99px;
}

.review-habit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--card-border);
    font-size: 0.85rem;
}

.review-habit-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-dots {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.review-dots i {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: var(--subtle-bg);
}

.review-dots i.done {
    background: var(--success);
}

.review-dots i.future {
    background: none;
    border: 1px dashed var(--border-color);
}

.review-habit-count {
    width: 2rem;
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.review-line {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--card-border);
    font-size: 0.85rem;
}

.review-line span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.review-line .text-muted {
    flex-shrink: 0;
    font-size: 0.78rem;
}

.review-note + .review-habit,
.review-note + .review-line {
    margin-top: 0.6rem;
}

.export-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--card-border);
}

#exportList {
    margin-top: 0.75rem;
}

.export-row-name {
    font-size: 0.88rem;
    font-weight: 500;
}

.export-row-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.export-btn {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--subtle-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.export-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.export-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ====== BODY METRICS ====== */
.bm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bm-head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bm-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--subtle-bg);
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
}

.bm-icon-btn:hover {
    color: var(--text-main);
}

.bm-icon-btn.bm-danger:hover {
    color: var(--danger);
}

.bm-icon-btn svg {
    width: 15px;
    height: 15px;
}

.bm-log-btn {
    height: 36px;
    padding: 0 1rem;
    border-radius: 999px !important;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.bm-log-btn:hover {
    background: var(--primary-hover);
}

.bm-log-btn svg {
    width: 15px;
    height: 15px;
}

.bm-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin: 1rem 0;
}

.bm-stat {
    min-width: 0;
}

.bm-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.bm-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.bm-stat-value small {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.bm-stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bm-chips {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.bm-chips::-webkit-scrollbar {
    display: none;
}

.bm-ranges {
    justify-content: flex-end;
}

.bm-chip {
    flex-shrink: 0;
    padding: 0.35rem 0.8rem;
    border-radius: 99px;
    border: 1px solid var(--card-border);
    background: var(--subtle-bg);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}

.bm-chip-small {
    padding: 0.2rem 0.65rem;
    font-size: 0.72rem;
}

.bm-chip.active {
    background: rgba(var(--primary-rgb), 0.14);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.bm-chart-wrap {
    position: relative;
    height: 200px;
    margin: 0.75rem 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bm-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0;
    border-top: 1px solid var(--card-border);
}

.bm-entry-main {
    flex: 1;
    min-width: 0;
}

.bm-entry-date {
    font-size: 0.85rem;
    font-weight: 600;
}

.bm-entry-values {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.bm-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
}

.bm-more {
    display: block;
    margin-top: 0.5rem;
}

.bm-modal {
    width: 100%;
    max-width: 420px;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    margin: 0;
    animation: none;
}

.bm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 0.75rem;
}

/* ====== VANTAGE-STYLE HERO BANNERS ====== */
.hero-card {
    background: var(--hero-bg) !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 14px 36px rgba(5, 18, 26, 0.28) !important;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
}

/* Fine wave lines, echoing the banner artwork */
.hero-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 70%;
    pointer-events: none;
    background:
        repeating-linear-gradient(170deg, transparent 0 7px, rgba(45, 212, 191, 0.07) 7px 8px),
        radial-gradient(60% 80% at 75% 100%, rgba(255, 140, 60, 0.18), transparent 70%);
    mask-image: linear-gradient(to top, #000 10%, transparent);
    -webkit-mask-image: linear-gradient(to top, #000 10%, transparent);
}

.hero-card > * {
    position: relative;
    z-index: 1;
}

.hero-card h1,
.hero-card h2,
.hero-card h3,
.hero-card #netWorthValue,
.hero-card #netWorthDisplay {
    color: #ffffff !important;
}

.hero-card p,
.hero-card span:not(#netWorthValue),
.hero-card small,
.hero-card label,
.hero-card #eyeToggleBtn {
    color: rgba(255, 255, 255, 0.72) !important;
}

.hero-card [style*="radial-gradient(circle"] {
    display: none;
}

/* ====== OVERVIEW CUBE TILES ======
   Teal glass face, bevelled rim, solid depth on the lower-right edge (like the Vantage cube) */
.cube-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1rem;
    padding: 0 10px 10px 0;
    margin-bottom: 1rem;
}

.cube {
    --face-1: #2a7f7c;
    --face-2: #16595a;
    --face-3: #0d3d3e;
    --edge: #072a2b;
    --rx: 0deg;
    --ry: 0deg;
    --gx: 30%;
    --gy: 0%;
    position: relative;
    min-width: 0;
    padding: 1rem 1.05rem 1.05rem;
    border-radius: 18px;
    color: #ffffff;
    cursor: pointer;
    isolation: isolate;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%),
        linear-gradient(150deg, var(--face-1) 0%, var(--face-2) 52%, var(--face-3) 100%);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.45),
        inset 1.5px 0 0 rgba(255, 255, 255, 0.22),
        inset 0 -2px 0 rgba(0, 0, 0, 0.28),
        1px 1px 0 var(--edge), 2px 2px 0 var(--edge), 3px 3px 0 var(--edge), 4px 4px 0 var(--edge),
        5px 5px 0 var(--edge), 6px 6px 0 var(--edge), 7px 7px 0 var(--edge), 8px 8px 0 var(--edge),
        12px 16px 26px rgba(4, 30, 31, 0.32);
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    animation: cubeIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: var(--delay, 0ms);
    outline: none;
}

/* Inner frame — the raised rim around the face */
.cube::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), inset 0 10px 18px rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: -1;
}

/* Glare that follows the pointer */
.cube::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(220px circle at var(--gx) var(--gy), rgba(255, 255, 255, 0.22), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cube.is-tilting {
    transition: transform 0.08s linear, box-shadow 0.3s ease;
}

.cube.is-tilting::before,
.cube:focus-visible::before {
    opacity: 1;
}

.cube:focus-visible {
    box-shadow:
        0 0 0 3px rgba(var(--primary-rgb), 0.55),
        1px 1px 0 var(--edge), 2px 2px 0 var(--edge), 3px 3px 0 var(--edge), 4px 4px 0 var(--edge),
        5px 5px 0 var(--edge), 6px 6px 0 var(--edge), 7px 7px 0 var(--edge), 8px 8px 0 var(--edge);
}

/* Pressing pushes the face down into its depth */
.cube:not(.cube-static):active {
    transform: perspective(900px) translate(4px, 4px);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 0 rgba(0, 0, 0, 0.28),
        1px 1px 0 var(--edge), 2px 2px 0 var(--edge), 3px 3px 0 var(--edge), 4px 4px 0 var(--edge),
        6px 8px 16px rgba(4, 30, 31, 0.3);
    transition-duration: 0.1s;
}

.cube-static {
    cursor: default;
}

.cube-wide {
    grid-column: 1 / -1;
}

.cube-hero {
    --face-1: #1f7774;
    --face-2: #0f4a4b;
    --face-3: #082c2e;
    padding: 1.3rem 1.3rem 1.2rem;
    overflow: hidden;
}

/* Orange V-mark, echoing the logo on the cube */
.cube-mark {
    position: absolute;
    right: 1.3rem;
    bottom: 1.1rem;
    width: 46px;
    height: 46px;
    background:
        linear-gradient(135deg, transparent 46%, #ffffff 47% 62%, transparent 63%) 0 0 / 60% 100% no-repeat,
        linear-gradient(225deg, transparent 40%, var(--primary-color) 41% 70%, transparent 71%) 100% 0 / 55% 70% no-repeat;
    filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.35));
    opacity: 0.9;
    pointer-events: none;
}

.cube-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    min-height: 26px;
}

.cube-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.cube-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    overflow-wrap: anywhere;
}

.cube-value small {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: none;
}

.cube-value-xl {
    font-size: 2.1rem;
    padding-right: 3.5rem;
}

.cube-value-accent {
    color: #ffb27d;
}

.cube-sub {
    margin-top: 0.3rem;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.72);
}

.cube-foot {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.72);
}

.cube-go {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #ffb27d;
}

.cube-go svg {
    width: 13px;
    height: 13px;
}

.cube-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
}

.cube-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.cube-icon-btn svg,
.cube-accent-icon {
    width: 15px;
    height: 15px;
}

.cube-accent-icon {
    color: #ffb27d;
}

.cube-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.cube-pill svg {
    width: 11px;
    height: 11px;
}

.cube-pill-success { color: #7ff0c8; }
.cube-pill-warning { color: #ffd27a; }
.cube-pill-danger  { color: #ffaaa0; }

.cube-bar {
    height: 8px;
    margin: 0.7rem 0 0.15rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.cube-bar-fill {
    height: 100%;
    width: var(--w);
    border-radius: 999px;
    animation: cubeBar 1s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.2s;
}

.cube-bar-fill.cube-success { background: linear-gradient(90deg, #34d399, #7ff0c8); }
.cube-bar-fill.cube-warning { background: linear-gradient(90deg, #f59e0b, #ffd27a); }
.cube-bar-fill.cube-danger  { background: linear-gradient(90deg, var(--primary-color), #ff8a6a); }

.cube-ring-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cube-ring {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    transform: rotate(-90deg);
}

.cube-ring circle {
    fill: none;
    stroke-width: 3.2;
}

.cube-ring-track {
    stroke: rgba(0, 0, 0, 0.25);
}

.cube-ring-fill {
    stroke: #ffb27d;
    stroke-linecap: round;
    stroke-dasharray: var(--dash) 100;
    animation: cubeRing 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.2s;
}

.cube-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cube-link-btn {
    padding: 4px 12px;
    border-radius: 999px;
    border: none;
    background: var(--primary-color);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.cube-link-btn:hover {
    background: var(--primary-hover);
}

.cube-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.6);
    animation: cubeLive 1.8s ease-out infinite;
}

.cube-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cube-task {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease;
}

.cube-task:hover {
    background: rgba(0, 0, 0, 0.26);
}

.cube-task.is-done {
    opacity: 0.45;
    transform: translateX(10px);
}

.cube-task.is-done .cube-task-name {
    text-decoration: line-through;
}

.cube-check {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    color: transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cube-check svg {
    width: 14px;
    height: 14px;
}

.cube-check:hover {
    border-color: #ffb27d;
    color: rgba(255, 178, 125, 0.7);
}

.cube-task.is-done .cube-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.cube-task-main {
    flex: 1;
    min-width: 0;
}

.cube-task-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cube-task-date {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
}

.cube-task-date.urgent {
    color: #ffb27d;
    font-weight: 600;
}

.cube-chip {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
}

.cube-chip-high { color: #ffaaa0; }
.cube-chip-med  { color: #ffd27a; }
.cube-chip-low  { color: #7ff0c8; }

.cube-empty {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.cube-empty svg {
    width: 20px;
    height: 20px;
    color: #7ff0c8;
}

.cube-quote {
    --face-1: #24413f;
    --face-2: #172e2e;
    --face-3: #0d1f20;
    --edge: #060f10;
}

.cube-quote-text {
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.55;
    color: #ffffff;
}

.cube-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.cube-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--badge);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(11, 27, 43, 0.06);
}

.cube-badge svg {
    width: 13px;
    height: 13px;
}

@keyframes cubeIn {
    from { opacity: 0; transform: perspective(900px) translateY(18px) rotateX(12deg); }
    to   { opacity: 1; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); }
}

@keyframes cubeBar {
    from { width: 0; }
}

@keyframes cubeRing {
    from { stroke-dasharray: 0 100; }
}

@keyframes cubeLive {
    0%   { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0); }
}

@media (max-width: 380px) {
    .cube-value { font-size: 1.3rem; }
    .cube-value-xl { font-size: 1.7rem; }
}

/* ====== QUICK ACTIONS ====== */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.15rem 0.1rem 0.6rem;
    margin-bottom: 0.6rem;
    scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 38px;
    padding: 0 1rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.quick-pill svg {
    width: 15px;
    height: 15px;
    color: var(--primary-color);
}

.quick-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.quick-pill:active {
    transform: scale(0.96);
}

.quick-pill-main {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.28);
}

.quick-pill-main svg,
.quick-pill-main:hover {
    color: #ffffff;
}

.quick-pill-main:hover {
    background: var(--primary-hover);
}

/* ====== CREDIT CARDS ====== */
.cc-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cc-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    background: var(--subtle-bg);
    border-radius: 12px;
}

.cc-summary > div {
    min-width: 0;
}

.cc-summary strong {
    display: block;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 520px) {
    .cc-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .cc-summary > div:last-child {
        grid-column: 1 / -1;
        padding-top: 0.6rem;
        border-top: 1px solid var(--card-border);
    }
}

.cc-summary small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-list {
    display: grid;
    gap: 0.75rem;
}

.cc-card {
    padding: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: var(--subtle-bg);
}

.cc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cc-name {
    min-width: 0;
    font-weight: 700;
    font-size: 0.97rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-name span {
    margin-left: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.cc-top-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.cc-figures {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cc-balance {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.cc-due {
    text-align: right;
    flex-shrink: 0;
}

.cc-due-date {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.cc-due small {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.cc-due small.text-danger { color: var(--danger); }
.cc-due small.text-warning { color: var(--warning); }

.cc-bar {
    height: 8px;
    background: var(--subtle-bg);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.cc-bar div {
    height: 100%;
    border-radius: 99px;
}

.cc-bar .success { background: var(--success); }
.cc-bar .warning { background: var(--warning); }
.cc-bar .danger { background: var(--danger); }

.cc-limit-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.cc-limit-row strong {
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.cc-min {
    margin-top: 0.5rem;
    font-size: 0.74rem;
    color: var(--warning);
}

.cc-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.cc-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--subtle-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.cc-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
}

.cc-btn svg {
    width: 13px;
    height: 13px;
}

.cc-btn-pay {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.cc-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.cc-empty {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cc-empty svg {
    width: 28px;
    height: 28px;
    margin-bottom: 0.5rem;
}

/* ====== BUDGETS & GOALS + RESTORE ====== */
.plan-month {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.plan-month .bm-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.plan-row {
    padding: 0.7rem 0;
    border-top: 1px solid var(--card-border);
}

.plan-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.plan-row-name {
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-row-figures {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.plan-row-figures strong {
    color: var(--text-main);
}

.plan-row-sub {
    margin-top: 0.35rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.plan-row-sub.text-danger { color: var(--danger); }
.plan-row-sub.text-warning { color: var(--warning); }

.plan-goal-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.cc-bar .primary { background: var(--primary-color); }

.plan-stat-small {
    font-size: 1.05rem;
    line-height: 1.9;
}

.plan-budget-field {
    display: grid;
    grid-template-columns: 1fr 9.5rem;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.plan-budget-field label {
    min-width: 0;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restore-pick {
    display: inline-block;
    margin-top: 0.75rem;
}

.restore-summary {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--subtle-bg);
    border-radius: 10px;
    overflow-wrap: anywhere;
}

.restore-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.restore-replace {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* ====== FOCUS ====== */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.form-control:focus-visible {
    outline: none;
}

button,
[onclick] {
    -webkit-tap-highlight-color: transparent;
}

/* ====== DESKTOP: persistent sidebar ====== */
@media (min-width: 1024px) {
    body.is-authed {
        padding-left: 280px;
    }

    body.is-authed #sidebarPanel {
        transform: none;
        visibility: visible;
        box-shadow: none;
    }

    body.is-authed #sidebarBackdrop,
    body.is-authed .sidebar-close,
    body.is-authed #hamburgerBtn,
    body.is-authed .header-spacer,
    body.is-authed .bottom-nav {
        display: none !important;
    }

    body.is-authed #appHeader {
        left: 280px;
        justify-content: center;
    }

    body.is-authed #app {
        max-width: 720px;
        padding-bottom: 2rem;
    }
}

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

/* ====== MODAL OVERLAY ====== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

/* ====== BADGE PILLS ====== */
.badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.badge-primary {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-color);
}

/* ================================================================
   ELEGANT WHITE THEME
   Applied by adding class "theme-light" to <body>
   ================================================================ */

body.theme-light {
    --bg-color:       #f3f4f6;
    --surface-color:  #ffffff;
    --primary-color:  #f26a1b;
    --primary-hover:  #d9560c;
    --primary-light:  #ff8a3d;
    --primary-rgb:    242, 106, 27;
    --text-main:      #0b1b2b;
    --text-muted:     #5f6b7a;
    --border-color:   #e5e7eb;
    --success:        #059669;
    --danger:         #dc2626;
    --warning:        #d97706;
    --card-bg:        #ffffff;
    --card-border:    #e8eaee;
    --subtle-bg:      rgba(15, 23, 42, 0.06);

    background: #f3f4f6;
    animation: none;
    color: var(--text-main);
}

body.theme-light ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.12);
}
body.theme-light ::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.22);
}

body.theme-light .card {
    background: #ffffff;
    border-color: #e8eaee;
    box-shadow: 0 1px 2px rgba(11, 27, 43, 0.04), 0 6px 24px rgba(11, 27, 43, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
body.theme-light .card:hover {
    box-shadow: 0 2px 4px rgba(11, 27, 43, 0.05), 0 12px 32px rgba(11, 27, 43, 0.08);
}

body.theme-light .form-control {
    background-color: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: var(--text-main);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
}
body.theme-light .form-control:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12), inset 0 1px 3px rgba(15, 23, 42, 0.04);
}
body.theme-light select.form-control option {
    background: #ffffff;
    color: #0f172a;
}

body.theme-light .bottom-nav {
    background: #ffffff !important;
    border-top: 1px solid rgba(15, 23, 42, 0.07) !important;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.07) !important;
}

body.theme-light #appHeader {
    background: #ffffff !important;
    border-bottom: 1px solid #e8eaee !important;
    box-shadow: none !important;
}

body.theme-light #sidebarBackdrop {
    background: rgba(15, 23, 42, 0.25) !important;
}
body.theme-light #sidebarPanel {
    background: #ffffff !important;
    border-right: 1px solid rgba(15, 23, 42, 0.07) !important;
    box-shadow: 4px 0 32px rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .sidebar-item {
    color: #475569;
}
body.theme-light .sidebar-item:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}
body.theme-light .sidebar-item.active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
}

body.theme-light .kanban-col {
    background: rgba(241, 245, 249, 0.7);
    border-color: rgba(15, 23, 42, 0.08);
}
body.theme-light .kanban-header {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}
body.theme-light .kanban-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.07);
}
body.theme-light .kanban-card:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
    border-color: rgba(var(--primary-rgb), 0.22);
}

body.theme-light input[type="checkbox"] {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(248, 250, 252, 0.8);
}
body.theme-light input[type="radio"] {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(248, 250, 252, 0.8);
}

body.theme-light #headerTitle {
    color: #0f172a;
}

/* ── Inline dark surface boxes → light ──────────────────────────
   Targets JS-rendered elements that hardcode rgba(30,41,59,…) or
   rgba(15,23,42,…) as their background so text stays readable.
   ---------------------------------------------------------------- */
body.theme-light [style*="rgba(30,41,59"],
body.theme-light [style*="rgba(241,245,249"] {
    background: #ffffff !important;
    border-color: #e8eaee !important;
    box-shadow: 0 1px 2px rgba(11, 27, 43, 0.04), 0 4px 16px rgba(11, 27, 43, 0.04);
}
body.theme-light [style*="rgba(15,23,42,0.8"],
body.theme-light [style*="rgba(15,23,42, 0.8"] {
    background: rgba(241, 245, 249, 0.88) !important;
    border-color: rgba(15, 23, 42, 0.09) !important;
}
body.theme-light [style*="rgba(15,23,42,0.5"],
body.theme-light [style*="rgba(15,23,42, 0.5"] {
    background: rgba(241, 245, 249, 0.75) !important;
    border-color: rgba(15, 23, 42, 0.07) !important;
}

/* Net Worth hero card (deep navy gradient) */
body.theme-light #dashboardContent [style*="1e3a5f"] {
    background: var(--hero-bg) !important;
    border: none !important;
    box-shadow: 0 12px 32px rgba(5, 18, 26, 0.25) !important;
    color: #ffffff;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.72);
}
body.theme-light #netWorthValue {
    color: #ffffff !important;
}

/* Progress bar tracks that use white-alpha on dark bg */
body.theme-light [style*="rgba(255,255,255,0.08)"] {
    background: rgba(15, 23, 42, 0.08) !important;
}
body.theme-light [style*="rgba(255,255,255,0.06)"][style*="border"] {
    border-color: rgba(15, 23, 42, 0.09) !important;
}

/* Gym session summary dark card */
body.theme-light [style*="rgba(30,58,95"] {
    background: rgba(219, 234, 254, 0.5) !important;
    border-color: rgba(var(--primary-rgb), 0.18) !important;
}
body.theme-light [style*="rgba(26,16,51"] {
    background: rgba(237, 233, 254, 0.5) !important;
}
/* ── Bills & Subscriptions ─────────────────────────────── */
.bills-view, .planner-view { display: flex; flex-direction: column; gap: 1rem; }
.bills-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.25rem 1.4rem; }
.bills-stat { display: flex; flex-direction: column; gap: .2rem; position: relative; z-index: 1; }
.bills-stat span { font-size: .8rem; opacity: .75; }
.bills-stat strong { font-size: 1.5rem; font-weight: 700; }
.bills-stat small { font-size: .78rem; opacity: .7; }
.quick-pill.is-active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.bill-row { display: flex; align-items: center; gap: .85rem; padding: .8rem 0; border-top: 1px solid var(--border-color); }
.bill-row:first-of-type { border-top: 0; }
.bill-row.is-paused { opacity: .55; }
.bill-date { flex: 0 0 50px; height: 54px; border-radius: 14px; background: var(--subtle-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.bill-date span { font-size: .68rem; text-transform: uppercase; color: var(--text-muted); }
.bill-date strong { font-size: 1.2rem; }
.bill-date.warning { background: rgba(var(--primary-rgb), .12); color: var(--primary-color); }
.bill-date.danger { background: rgba(220, 53, 69, .12); color: var(--danger); }
.bill-date.warning span, .bill-date.danger span { color: inherit; }
.bill-main { flex: 1; min-width: 0; }
.bill-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-sub { font-size: .78rem; color: var(--text-muted); }
.bill-when { font-size: .78rem; margin-top: .1rem; }
.bill-side { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.bill-amount { font-weight: 700; white-space: nowrap; }
.bill-actions { display: flex; gap: .3rem; align-items: center; }
.bill-pay { display: inline-flex; align-items: center; gap: .25rem; border: 0; border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .78rem; font-weight: 600; background: var(--primary-color); color: #fff; cursor: pointer; }
.bill-pay svg { width: 14px; height: 14px; }
.bill-pay:hover { background: var(--primary-hover); }
.bill-check { display: flex; align-items: center; gap: .5rem; font-size: .88rem; margin: .25rem 0 1rem; cursor: pointer; }
.bill-form-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* ── Calendar / Planner ────────────────────────────────── */
@media (min-width: 1200px) {
    .planner-view { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
    .pl-side { display: flex; flex-direction: column; gap: 1rem; }
}
.pl-side { display: flex; flex-direction: column; gap: 1rem; }
.pl-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.pl-head h3 { margin: 0; font-size: 1.15rem; min-width: 10rem; text-align: center; }
.pl-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; }
.pl-filter { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); border-radius: 999px; padding: .25rem .65rem; font: inherit; font-size: .76rem; cursor: pointer; }
.pl-filter.is-on { color: var(--text-main); background: var(--subtle-bg); }
.pl-filter:not(.is-on) .pl-dot { background: transparent !important; outline: 1px solid var(--border-color); }
.pl-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pl-wd { font-size: .7rem; text-transform: uppercase; color: var(--text-muted); text-align: center; padding-bottom: .25rem; }
.pl-cell { position: relative; min-height: 92px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 5px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--card-bg); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; overflow: hidden; }
.pl-cell:hover { border-color: rgba(var(--primary-rgb), .5); }
.pl-cell.is-out { opacity: .4; }
.pl-cell.is-selected { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(var(--primary-rgb), .25); }
.pl-num { font-size: .8rem; font-weight: 600; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.pl-cell.is-today .pl-num { background: var(--primary-color); color: #fff; }
.pl-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-chip { font-size: .66rem; line-height: 1.3; padding: 1px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--k); background: color-mix(in srgb, var(--k) 12%, transparent); }
.pl-chip.is-done { text-decoration: line-through; opacity: .6; }
.pl-more { font-size: .64rem; color: var(--text-muted); padding-left: 4px; }
.pl-dots { display: none; gap: 3px; justify-content: center; margin-top: auto; }
.pl-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--k); flex: none; }
.pl-event { --k: #f26a1b; } .pl-task { --k: #3b82f6; } .pl-workout { --k: #10b981; }
.pl-bill { --k: #e11d48; } .pl-trip { --k: #1d6f8a; } .pl-card { --k: #8b5cf6; } .pl-goal { --k: #0f766e; }
@media (max-width: 640px) {
    .pl-cell { min-height: 54px; align-items: center; padding: 4px 2px; }
    .pl-chips { display: none; }
    .pl-dots { display: flex; flex-wrap: wrap; }
    .pl-head h3 { min-width: 0; flex: 1; }
}
.pl-spent { font-size: .82rem; color: var(--text-muted); margin-bottom: .5rem; }
.pl-item { display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem; margin-bottom: .4rem; border-radius: 12px; background: color-mix(in srgb, var(--k) 8%, transparent); border-left: 3px solid var(--k); }
.pl-item.is-done .pl-item-title { text-decoration: line-through; opacity: .6; }
.pl-item-icon { color: var(--k); display: inline-flex; }
.pl-item-icon svg { width: 16px; height: 16px; }
.pl-item-main { flex: 1; min-width: 0; }
.pl-item-title { font-size: .9rem; font-weight: 500; overflow-wrap: anywhere; }
.pl-item-sub { font-size: .76rem; color: var(--text-muted); }
.pl-tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--k); background: transparent; color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.pl-tick svg { width: 14px; height: 14px; }
.pl-tick.is-done, .pl-tick:hover { background: var(--k); color: #fff; }
.pl-agenda-day { display: flex; flex-direction: column; gap: .1rem; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border-color); background: none; padding: .55rem 0; font: inherit; color: var(--text-main); cursor: pointer; }
.pl-agenda-day:first-of-type { border-top: 0; }
.pl-agenda-day strong { font-size: .82rem; color: var(--primary-color); }
.pl-agenda-day span { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Muscle Balance anatomy map ────────────────────────── */
.mm-card { --heat-rgb: 242, 106, 27; }
.mm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .6rem; }
.mm-kicker { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin: 0 0 .1rem; }
.mm-sub { font-size: .66rem; color: var(--text-muted); margin: 0; opacity: .8; }
.mm-toggle { display: inline-flex; background: var(--subtle-bg); border-radius: 999px; padding: 2px; }
.mm-toggle button { border: 0; background: none; font: inherit; font-size: .72rem; font-weight: 600; color: var(--text-muted); padding: .25rem .7rem; border-radius: 999px; cursor: pointer; }
.mm-toggle button.is-on { background: var(--card-bg, #fff); color: var(--primary-color); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (min-width: 560px) { .mm-toggle { display: none; } }
.mm-body-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .9rem; align-items: center; }
@media (max-width: 420px) { .mm-body-wrap { grid-template-columns: 1fr; } }
.mm-figures { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; justify-items: center; }
.mm-figures.is-single { grid-template-columns: 1fr; }
.mm-figure { width: 100%; max-width: 170px; height: auto; overflow: visible; }
.mm-figures.is-single .mm-figure { max-width: 190px; animation: mmFlip .35s ease; }
@keyframes mmFlip { from { opacity: 0; transform: rotateY(70deg); } to { opacity: 1; transform: none; } }
.mm-body { fill: var(--subtle-bg); stroke: var(--border-color); stroke-width: 1; stroke-linejoin: round; }
.mm-line { stroke: var(--border-color); stroke-width: 1; fill: none; }
.mm-view-label { font-size: 9px; font-weight: 700; letter-spacing: 2px; fill: var(--text-muted); }
.mm-muscle { cursor: pointer; outline: none; }
.mm-muscle path { stroke: rgba(255,255,255,.65); stroke-width: .8; stroke-linejoin: round; transition: fill .3s, filter .2s, transform .2s; }
.mm-muscle.is-cold path { fill: rgba(148, 163, 184, .28); }
.mm-muscle.is-hot path { fill: rgba(var(--heat-rgb), var(--heat)); }
.mm-muscle:hover path, .mm-muscle:focus-visible path { filter: brightness(1.12) drop-shadow(0 0 3px rgba(var(--heat-rgb), .6)); }
.mm-muscle.is-selected path { stroke: #0f3d3e; stroke-width: 1.8; filter: drop-shadow(0 0 4px rgba(var(--heat-rgb), .75)); }
.mm-muscle.is-hot path { animation: mmIn .6s ease backwards; }
@keyframes mmIn { from { fill: rgba(148, 163, 184, .28); } }
@media (prefers-reduced-motion: reduce) { .mm-muscle path, .mm-figure { animation: none !important; transition: none; } }

.mm-detail { background: var(--subtle-bg); border-radius: 14px; padding: .8rem .85rem; min-width: 0; }
.mm-detail-head { display: flex; justify-content: space-between; align-items: center; gap: .4rem; flex-wrap: wrap; }
.mm-detail-head h4 { margin: 0; font-size: 1rem; font-weight: 700; }
.mm-zone { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: .15rem .5rem; border-radius: 999px; }
.mm-zone-cold { background: rgba(148,163,184,.2); color: var(--text-muted); }
.mm-zone-low  { background: rgba(245,158,11,.15); color: #b45309; }
.mm-zone-good { background: rgba(16,185,129,.15); color: #047857; }
.mm-zone-high { background: rgba(225,29,72,.13); color: #be123c; }
.mm-detail-num { margin-top: .35rem; font-size: .8rem; color: var(--text-muted); }
.mm-detail-num strong { font-size: 1.6rem; color: var(--text-main); font-weight: 800; }
.mm-detail-trend { font-size: .72rem; min-height: 1em; }
.mm-up { color: var(--success, #10b981); font-weight: 600; }
.mm-down { color: var(--danger, #e11d48); font-weight: 600; }
.mm-meter { height: 6px; border-radius: 99px; background: rgba(148,163,184,.25); margin: .5rem 0 .6rem; overflow: hidden; }
.mm-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(var(--heat-rgb), .5), rgb(var(--heat-rgb))); transition: width .5s ease; }
.mm-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.mm-top li { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; }
.mm-top li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-top li b { font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.mm-empty { font-size: .76rem; color: var(--text-muted); margin: 0; }

.mm-legend { display: flex; align-items: center; gap: .4rem; justify-content: center; font-size: .62rem; color: var(--text-muted); margin: .6rem 0 .2rem; }
.mm-legend i { width: 90px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, rgba(148,163,184,.3), rgba(var(--heat-rgb), .25), rgb(var(--heat-rgb))); }
.mm-insights { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
.mm-insights p { margin: 0; font-size: .76rem; padding: .45rem .6rem; border-radius: 10px; background: rgba(var(--heat-rgb), .07); border-left: 3px solid rgb(var(--heat-rgb)); }
.mm-rank-wrap { margin-top: .6rem; }
.mm-rank-wrap summary { cursor: pointer; font-size: .76rem; font-weight: 600; color: var(--text-main); padding: .3rem 0; }
.mm-rank-wrap summary small { font-weight: 400; color: var(--text-muted); }
.mm-ranks { display: flex; flex-direction: column; gap: 2px; margin-top: .3rem; }
.mm-rank { display: grid; grid-template-columns: 7.5rem 1fr 2.5rem; align-items: center; gap: .5rem; border: 0; background: none; font: inherit; color: var(--text-main); padding: .3rem .35rem; border-radius: 8px; cursor: pointer; text-align: left; }
.mm-rank:hover, .mm-rank.is-selected { background: var(--subtle-bg); }
.mm-rank-name { font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-rank-bar { position: relative; height: 7px; border-radius: 99px; background: rgba(148,163,184,.18); overflow: hidden; }
.mm-rank-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: rgb(var(--heat-rgb)); }
.mm-rank-bar i.mm-prev { background: rgba(15, 61, 62, .25); }
.mm-rank-val { font-size: .72rem; font-weight: 700; text-align: right; }

/* ── Header search button ──────────────────────────────── */
.header-search { display: inline-flex; align-items: center; gap: .45rem; width: auto !important; padding: 0 .7rem !important; border-radius: 999px !important; color: var(--text-muted); }
.header-search svg { width: 16px; height: 16px; }
.header-search-label { font-size: .82rem; }
.header-search kbd, .gs-panel kbd { font: inherit; font-size: .66rem; font-weight: 600; padding: .1rem .35rem; border-radius: 5px; border: 1px solid var(--border-color); background: var(--subtle-bg); color: var(--text-muted); }
@media (max-width: 640px) { .header-search-label, .header-search kbd { display: none; } .header-search { padding: 0 !important; width: 40px !important; justify-content: center; } }
#installBtn.hidden { display: none; }

/* ── Offline banner ────────────────────────────────────── */
.offline-banner { display: none; position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3000; max-width: min(92vw, 520px); padding: .6rem 1rem; border-radius: 14px; background: #0f2a2c; color: #fff; font-size: .8rem; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.offline-banner::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; margin-right: .5rem; vertical-align: middle; }
html.is-offline .offline-banner { display: block; animation: slideUp .3s ease; }
@media (min-width: 1024px) { .offline-banner { bottom: 1.25rem; } }

/* ── Global search ─────────────────────────────────────── */
.gs-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(5, 18, 26, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; animation: gsFade .15s ease; }
@keyframes gsFade { from { opacity: 0; } }
.gs-panel { width: 100%; max-width: 620px; max-height: 76vh; display: flex; flex-direction: column; background: var(--surface-color, #fff); border: 1px solid var(--border-color); border-radius: 18px; box-shadow: 0 24px 60px rgba(5, 18, 26, .3); overflow: hidden; animation: gsPop .18s ease; }
@keyframes gsPop { from { transform: translateY(-8px) scale(.98); opacity: 0; } }
.gs-input-row { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border-color); }
.gs-input-row svg { width: 18px; height: 18px; color: var(--primary-color); flex: none; }
.gs-input-row input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 1rem; color: var(--text-main); }
.gs-input-row input::-webkit-search-cancel-button { display: none; }
.gs-list { overflow-y: auto; padding: .4rem; }
.gs-note { margin: .4rem .6rem .5rem; font-size: .78rem; color: var(--text-muted); }
.gs-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .65rem; border: 0; border-radius: 12px; background: none; font: inherit; color: var(--text-main); text-align: left; cursor: pointer; }
.gs-item.is-active { background: rgba(var(--primary-rgb), .1); }
.gs-icon { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--subtle-bg); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.gs-item.is-active .gs-icon { background: var(--primary-color); color: #fff; }
.gs-icon svg { width: 15px; height: 15px; }
.gs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gs-title { font-size: .9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-title mark { background: rgba(var(--primary-rgb), .22); color: inherit; border-radius: 3px; padding: 0 1px; }
.gs-sub { font-size: .74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-kind { flex: none; font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.gs-foot { display: flex; gap: 1rem; padding: .5rem 1rem; border-top: 1px solid var(--border-color); font-size: .7rem; color: var(--text-muted); }
.gs-foot kbd { margin-right: 2px; }
@media (max-width: 640px) { .gs-overlay { padding-top: 12px; } .gs-foot { display: none; } .gs-kind { display: none; } }
/* Header: title stays centred, search and install sit on the right */
#appHeader .header-spacer { display: none; }
#appHeader #headerTitle { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; white-space: nowrap; }
#appHeader .header-search { margin-left: auto; }
#appHeader #installBtn { margin-left: .4rem; }
@media (max-width: 420px) { #appHeader #headerTitle { max-width: 55vw; overflow: hidden; text-overflow: ellipsis; } }

/* ── Finance quick-add tiles ───────────────────────────── */
.tx-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1rem; }

.tx-action { --c: 242, 106, 27; position: relative; display: flex; align-items: center; gap: .75rem; min-height: 76px; padding: .9rem 1rem; border: 1px solid rgba(var(--c), .25); border-radius: 18px; background: linear-gradient(145deg, rgba(var(--c), .14), rgba(var(--c), .05)); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: transform .15s ease, box-shadow .2s ease, border-color .2s; -webkit-tap-highlight-color: transparent; }
.tx-action:hover { transform: translateY(-2px); border-color: rgba(var(--c), .5); box-shadow: 0 10px 24px rgba(var(--c), .18); }
.tx-action:active { transform: translateY(0) scale(.97); }
.tx-action:focus-visible { outline: 3px solid rgba(var(--c), .5); outline-offset: 2px; }
.tx-action-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgb(var(--c)); color: #fff; box-shadow: 0 6px 14px rgba(var(--c), .35); }
.tx-action-icon svg { width: 22px; height: 22px; }
.tx-action-text { display: flex; flex-direction: column; min-width: 0; }
.tx-action-text strong { font-size: 1rem; font-weight: 700; }
.tx-action-text small { font-size: .74rem; color: var(--text-muted); }
.tx-expense { --c: 239, 68, 68; } .tx-income { --c: 16, 185, 129; } .tx-savings { --c: 20, 184, 166; }
.tx-scan { --c: 15, 61, 62; background: linear-gradient(145deg, #1d5456, #0f3d3e); color: #fff; border-color: transparent; }
.tx-scan .tx-action-icon { background: #f26a1b; box-shadow: 0 6px 14px rgba(242, 106, 27, .4); }
.tx-scan .tx-action-text small { color: rgba(255, 255, 255, .7); }
@media (max-width: 380px) { .tx-action { padding: .75rem; gap: .55rem; } .tx-action-icon { width: 40px; height: 40px; } .tx-action-text small { display: none; } }

/* ── New transaction sheet ─────────────────────────────── */
.tx-sheet { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; border-radius: 22px !important; padding: 1.25rem !important; animation: slideUp .25s ease; }
@media (max-width: 560px) { #financeModal:has(.tx-sheet) { align-items: flex-end; padding: 0; } .tx-sheet { max-width: none; border-radius: 22px 22px 0 0 !important; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important; } }
.tx-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.tx-sheet-head h3 { margin: 0; font-size: 1.15rem; }
.tx-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--subtle-bg); margin-bottom: 1rem; }
.tx-seg-opt { cursor: pointer; }
.tx-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tx-seg-opt span { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; border-radius: 12px; font-weight: 600; font-size: .92rem; color: var(--text-muted); transition: background .2s, color .2s, box-shadow .2s; }
.tx-seg-opt span svg { width: 17px; height: 17px; }
.tx-seg-opt input:checked + span { background: rgb(var(--c)); color: #fff; box-shadow: 0 4px 12px rgba(var(--c), .35); }
.tx-seg-opt input:focus-visible + span { outline: 2px solid rgb(var(--c)); outline-offset: 2px; }
.tx-amount { display: block; padding: .85rem 1rem .7rem; border-radius: 18px; border: 2px solid var(--border-color); background: var(--surface-color, #fff); margin-bottom: .6rem; cursor: text; transition: border-color .2s; }
.tx-amount:focus-within { border-color: var(--primary-color); }
#addTransForm[data-type="Expense"] .tx-amount:focus-within { border-color: #ef4444; }
#addTransForm[data-type="Income"] .tx-amount:focus-within { border-color: #10b981; }
#addTransForm[data-type="Savings"] .tx-amount:focus-within { border-color: #14b8a6; }
.tx-amount-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.tx-amount-row { display: flex; align-items: baseline; gap: .5rem; }
.tx-amount-rp { font-size: 1.3rem; font-weight: 700; color: var(--text-muted); }
.tx-amount-row input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 2.2rem; font-weight: 800; letter-spacing: -.5px; color: var(--text-main); padding: 0; }
.tx-err { display: block; font-size: .78rem; color: var(--danger); min-height: 0; }
.tx-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.tx-quick button, .tx-date-chip, .tx-chip, .tx-alt button { border: 1px solid var(--border-color); background: var(--surface-color, #fff); color: var(--text-main); font: inherit; font-size: .82rem; font-weight: 600; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; transition: background .15s, border-color .15s; }
.tx-quick button:hover, .tx-date-chip:hover, .tx-chip:hover { border-color: var(--primary-color); }
.tx-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.tx-chip.is-on, .tx-date-chip.is-on { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.tx-chips[hidden], .tx-cat-select[hidden] { display: none !important; }
.tx-date-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tx-date-row input { flex: 1; min-width: 140px; }
.tx-save { width: 100%; min-height: 52px; font-size: 1rem; margin-top: .5rem; }
.tx-scan-inline { display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; margin-bottom: .9rem; padding: .6rem; border: 1.5px dashed var(--border-color); border-radius: 14px; background: none; color: var(--text-muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.tx-scan-inline:hover { border-color: var(--primary-color); color: var(--primary-color); }
.tx-scan-inline svg { width: 16px; height: 16px; }
.tx-receipt { display: flex; gap: .8rem; align-items: center; padding: .7rem; border-radius: 16px; background: rgba(var(--primary-rgb), .07); margin-bottom: .9rem; }
.tx-receipt img { width: 64px; height: 84px; object-fit: cover; border-radius: 10px; flex: none; }
.tx-receipt strong { display: block; font-size: .9rem; }
.tx-receipt small { display: block; font-size: .76rem; color: var(--text-muted); }
.tx-alt { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .4rem; font-size: .74rem; color: var(--text-muted); }
.tx-alt button { padding: .2rem .55rem; font-size: .74rem; }

/* Receipt reading screen */
.tx-scanning { text-align: center; }
.tx-scan-photo { position: relative; margin: 0 auto 1rem; width: min(240px, 70vw); aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--subtle-bg); }
.tx-scan-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.3); }
.tx-scan-beam { position: absolute; left: 0; right: 0; height: 3px; background: #f26a1b; box-shadow: 0 0 16px 4px rgba(242, 106, 27, .6); animation: txBeam 1.6s ease-in-out infinite alternate; }
@keyframes txBeam { from { top: 4%; } to { top: 94%; } }
.tx-scan-status { font-weight: 600; margin: 0 0 .6rem; }
.tx-scan-bar { height: 6px; border-radius: 99px; background: var(--subtle-bg); overflow: hidden; margin-bottom: 1rem; }
.tx-scan-bar i { display: block; height: 100%; width: 3%; background: var(--primary-color); border-radius: inherit; transition: width .3s ease; }
@media (prefers-reduced-motion: reduce) { .tx-scan-beam { animation: none; top: 50%; } .tx-action, .tx-sheet { transition: none; animation: none; } }

/* ── Brand ─────────────────────────────────────────────── */
.sidebar-brand { display: inline-flex; align-items: center; gap: .6rem; color: #0f3d5e; }
.sidebar-brand img { width: 34px; height: 34px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 2px 8px rgba(15, 61, 94, .15); }
.sidebar-brand b { font-weight: 800; }
.sidebar-brand span { font-weight: 500; letter-spacing: -.3px; }
body:not(.theme-light) .sidebar-brand { color: #e2f3f1; }
.login-brand { display: block; width: min(300px, 80%); height: auto; margin: 0 auto .5rem; border-radius: 18px; }
body:not(.theme-light) .login-brand { background: #fff; padding: .75rem 1rem; box-sizing: border-box; }

/* ── Trip Itinerary ────────────────────────────────────── */
.trips-view { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 5rem; }
.trips-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.trips-head h2 { margin: 0; font-size: 1.4rem; }
.trips-head p { margin: .15rem 0 0; font-size: .85rem; }
.trips-new { display: inline-flex; align-items: center; gap: .35rem; width: auto !important; }
.trips-new svg { width: 16px; height: 16px; }
.trips-section { margin: .5rem 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.trips-empty { text-align: center; padding: 2rem 1.25rem !important; }
.trips-empty-icon { width: 72px; height: 72px; margin: 0 auto .75rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(var(--primary-rgb), .12); color: var(--primary-color); }
.trips-empty h3 { margin: 0 0 .35rem; }
.trips-empty p { max-width: 360px; margin: 0 auto 1rem; font-size: .88rem; }
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.trip-card { display: flex; flex-direction: column; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: var(--card-bg, #fff); box-shadow: 0 4px 16px rgba(15, 23, 42, .08); text-align: left; font: inherit; color: var(--text-main); cursor: pointer; transition: transform .15s ease, box-shadow .2s ease; }
.trip-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15, 23, 42, .14); }
.trip-card.is-past { opacity: .78; }
.trip-card-top { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem 1.1rem; min-height: 112px; color: #fff; background: linear-gradient(135deg, var(--trip), color-mix(in srgb, var(--trip) 55%, #05121a)); overflow: hidden; }
.trip-card-top::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; border: 18px solid rgba(255,255,255,.08); }
.trip-badge { align-self: flex-start; font-size: .66rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; }
.trip-card-name { font-size: 1.2rem; font-weight: 800; margin-top: .35rem; line-height: 1.2; }
.trip-card-dest { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; opacity: .9; }
.trip-card-dest svg { width: 13px; height: 13px; }
.trip-card-bottom { display: flex; flex-direction: column; gap: .35rem; padding: .75rem 1.1rem .9rem; font-size: .8rem; }
.trip-card-meta { display: flex; flex-wrap: wrap; gap: .7rem; color: var(--text-muted); font-size: .76rem; }
.trip-card-meta span { display: inline-flex; align-items: center; gap: .25rem; }

.trip-hero { position: relative; padding: 1rem 1.25rem 1.3rem; border-radius: 22px; color: #fff; background: linear-gradient(135deg, var(--trip), color-mix(in srgb, var(--trip) 50%, #05121a)); box-shadow: 0 14px 32px color-mix(in srgb, var(--trip) 35%, transparent); overflow: hidden; }
.trip-hero::after { content: ''; position: absolute; right: -50px; top: -50px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(255,255,255,.07); pointer-events: none; }
.trip-hero-bar { display: flex; justify-content: space-between; margin-bottom: .6rem; position: relative; z-index: 1; }
.trip-hero-actions { display: flex; gap: .4rem; }
.trip-hero-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: rgba(255,255,255,.16); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.trip-hero-btn:hover { background: rgba(255,255,255,.26); }
.trip-hero-btn svg { width: 18px; height: 18px; }
.trip-hero h2 { margin: .45rem 0 .15rem; font-size: 1.55rem; font-weight: 800; color: #fff; }
.trip-hero p { margin: 0; font-size: .86rem; opacity: .9; }
.trip-hero-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; position: relative; z-index: 1; }
.trip-hero-stats span { font-size: .76rem; padding: .3rem .65rem; border-radius: 10px; background: rgba(255,255,255,.14); }
.trip-today-btn { margin-top: .8rem; border: 0; border-radius: 999px; padding: .45rem .9rem; background: #fff; color: var(--trip); font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; position: relative; z-index: 1; }
.trip-notes { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; }
.trip-notes svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); margin-top: 2px; }
.trip-notes p { margin: 0; white-space: pre-wrap; }

.tl-card { padding: 0 !important; overflow: visible !important; }
.tl-card > .tl-day:first-child .tl-day-head { border-radius: var(--card-radius, 20px) var(--card-radius, 20px) 0 0; }
.tl-card > .tl-day:last-child > :last-child { border-bottom: 0; }
.tl-day-head { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 2; display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding: .55rem 1rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; background: var(--subtle-bg); color: var(--text-muted); border-top: 1px solid var(--border-color); }
.tl-day:first-child .tl-day-head { border-top: 0; }
.tl-day.is-today .tl-day-head { background: rgba(var(--primary-rgb), .14); color: var(--primary-color); }
.tl-day-head small { font-size: .7rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.tl-row { position: relative; display: grid; grid-template-columns: 62px 40px minmax(0, 1fr); gap: .5rem; width: 100%; padding: .75rem 1rem .75rem .5rem; border: 0; border-bottom: 1px solid var(--border-color); background: none; font: inherit; color: var(--text-main); text-align: left; cursor: pointer; }
button.tl-row:hover { background: rgba(var(--primary-rgb), .04); }
.tl-row::before { content: ''; position: absolute; left: calc(.5rem + 62px + .5rem + 19px); top: 0; bottom: 0; width: 3px; background: color-mix(in srgb, var(--k, #94a3b8) 45%, transparent); }
.tl-day .tl-row:first-of-type::before { top: 50%; }
.tl-day .tl-row:last-child::before { bottom: 50%; }
.tl-time { text-align: right; display: flex; flex-direction: column; justify-content: center; line-height: 1.15; }
.tl-time strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -.3px; }
.tl-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); }
.tl-node { position: relative; z-index: 1; align-self: center; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--k, #64748b); color: #fff; box-shadow: 0 0 0 4px var(--card-bg, #fff); }
.tl-row.is-end .tl-node { background: var(--card-bg, #fff); color: var(--k); box-shadow: 0 0 0 4px var(--card-bg, #fff), inset 0 0 0 2.5px var(--k); }
.tl-body { align-self: center; min-width: 0; }
.tl-title { font-weight: 700; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.tl-line { font-size: .78rem; color: var(--text-muted); overflow-wrap: anywhere; }
.tl-line b { color: var(--text-main); font-weight: 600; }
.tl-cost { color: var(--text-main); font-weight: 600; }
.tl-status { display: inline-block; vertical-align: middle; margin-left: .3rem; font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: .12rem .4rem; border-radius: 5px; background: rgba(245, 158, 11, .16); color: #b45309; }
.tl-status.is-booked { background: rgba(22, 163, 74, .14); color: #15803d; }
.tl-layover { cursor: default; background: rgba(var(--primary-rgb), .05); padding-top: .45rem; padding-bottom: .45rem; --k: #16a34a; }
.tl-layover .tl-node { width: 28px; height: 28px; justify-self: center; background: var(--card-bg, #fff); color: var(--text-muted); box-shadow: 0 0 0 3px var(--card-bg, #fff), inset 0 0 0 1.5px var(--border-color); }
.tl-layover .tl-body { font-size: .78rem; font-style: italic; color: var(--text-muted); }
.tl-free { padding: .85rem 1rem; font-size: .82rem; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.tl-free button { border: 0; background: none; padding: 0; font: inherit; color: var(--primary-color); font-weight: 600; cursor: pointer; }
.trip-fab { position: fixed; right: max(1.25rem, env(safe-area-inset-right)); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 1500; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--primary-color); color: #fff; box-shadow: 0 10px 24px rgba(var(--primary-rgb), .45); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s ease; }
.trip-fab:hover { transform: scale(1.06); }
.trip-fab:active { transform: scale(.95); }
.trip-fab svg { width: 26px; height: 26px; }
@media (min-width: 1024px) { .trip-fab { bottom: 2rem; right: 2rem; } }

.trip-modal.is-wide { max-width: 560px; max-height: 92vh; overflow-y: auto; }
.trip-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: 1rem; }
.trip-type { cursor: pointer; }
.trip-type input { position: absolute; opacity: 0; pointer-events: none; }
.trip-type span { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .55rem .2rem; border-radius: 14px; border: 1.5px solid var(--border-color); color: var(--text-muted); transition: all .15s; }
.trip-type small { font-size: .68rem; font-weight: 600; text-align: center; line-height: 1.1; }
.trip-type input:checked + span { border-color: var(--k); background: color-mix(in srgb, var(--k) 12%, transparent); color: var(--k); }
.trip-type input:focus-visible + span { outline: 2px solid var(--k); outline-offset: 2px; }
.trip-colors { display: flex; gap: .5rem; }
.trip-colors input { position: absolute; opacity: 0; }
.trip-colors span { display: block; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 2px var(--card-bg, #fff); transition: transform .15s; }
.trip-colors input:checked + span { box-shadow: 0 0 0 2px var(--card-bg, #fff), 0 0 0 4px var(--text-main); transform: scale(1.08); }
.trip-map-link { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: 1rem; font-size: .82rem; color: var(--primary-color); font-weight: 600; text-decoration: none; }
.trip-map-link svg { width: 14px; height: 14px; }
.trip-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5000; padding: .65rem 1rem; border-radius: 12px; background: #0f2a2c; color: #fff; font-size: .85rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: slideUp .25s ease; }
@media (max-width: 420px) { .tl-row { grid-template-columns: 50px 36px minmax(0, 1fr); padding-right: .75rem; } .tl-row::before { left: calc(.5rem + 50px + .5rem + 17px); } .tl-node { width: 36px; height: 36px; } .tl-time strong { font-size: 1rem; } }
.tl-day-head { z-index: 3; background: linear-gradient(var(--subtle-bg), var(--subtle-bg)), var(--card-bg, #fff); }
.tl-day.is-today .tl-day-head { background: linear-gradient(rgba(var(--primary-rgb), .14), rgba(var(--primary-rgb), .14)), var(--card-bg, #fff); }

/* ── Trip tabs ─────────────────────────────────────────── */
.trip-tabs { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--card-bg, #fff); box-shadow: 0 4px 14px rgba(15, 23, 42, .07); }
.trip-tab { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: .84rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background .2s, color .2s; }
.trip-tab svg { width: 16px; height: 16px; }
.trip-tab small { font-size: .66rem; font-weight: 700; padding: .05rem .35rem; border-radius: 999px; background: var(--subtle-bg); }
.trip-tab.is-on { background: rgba(var(--primary-rgb), .12); color: var(--primary-color); }
.trip-tab.is-on small { background: var(--primary-color); color: #fff; }
@media (max-width: 480px) { .trip-tab { flex-direction: column; gap: 1px; font-size: .7rem; min-height: 52px; } .trip-tab small { display: none; } }
button.trip-notes { width: 100%; text-align: left; font: inherit; color: var(--text-main); cursor: pointer; border: 0; }

/* ── Packing ───────────────────────────────────────────── */
.pack-progress { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pack-progress strong { display: block; font-size: 1.05rem; }
.pack-progress small { color: var(--text-muted); font-size: .8rem; }
.pack-ring { --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--primary-color) calc(var(--p) * 1%), var(--subtle-bg) 0); }
.pack-ring span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--card-bg, #fff); font-size: .78rem; font-weight: 800; }
.pack-reset { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border-color); background: none; border-radius: 999px; padding: .35rem .75rem; font: inherit; font-size: .76rem; color: var(--text-muted); cursor: pointer; }
.pack-reset svg { width: 13px; height: 13px; }
.pack-add { display: grid; grid-template-columns: minmax(0, 1fr) 130px 46px; gap: .4rem; margin-bottom: .7rem; }
.pack-add .btn { padding: 0 !important; display: flex; align-items: center; justify-content: center; min-height: 42px; }
.pack-add .btn svg { width: 18px; height: 18px; }
@media (max-width: 420px) { .pack-add { grid-template-columns: minmax(0, 1fr) 46px; } .pack-add select { grid-column: 1 / -1; grid-row: 2; } }
.pack-templates { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: 1rem; font-size: .76rem; color: var(--text-muted); }
.pack-templates button { display: inline-flex; align-items: center; gap: .3rem; border: 1px dashed var(--border-color); background: none; border-radius: 999px; padding: .3rem .65rem; font: inherit; font-size: .76rem; font-weight: 600; color: var(--text-main); cursor: pointer; }
.pack-templates button:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pack-templates svg { width: 12px; height: 12px; }
.pack-templates select { border: 1px solid var(--border-color); border-radius: 999px; padding: .3rem .6rem; font: inherit; font-size: .76rem; background: var(--card-bg, #fff); color: var(--text-main); }
.pack-group { margin-top: .6rem; }
.pack-group h4 { display: flex; justify-content: space-between; margin: 0 0 .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.pack-item { display: flex; align-items: center; gap: .65rem; padding: .45rem .2rem; border-bottom: 1px solid var(--border-color); }
.pack-check { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--border-color); background: none; color: transparent; display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.pack-check svg { width: 15px; height: 15px; }
.pack-item.is-done .pack-check { background: var(--success, #10b981); border-color: var(--success, #10b981); color: #fff; }
.pack-name { flex: 1; min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.pack-item.is-done .pack-name { text-decoration: line-through; color: var(--text-muted); }
.pack-del { width: 28px; height: 28px; flex: none; border: 0; background: none; color: var(--text-muted); border-radius: 8px; cursor: pointer; display: grid; place-items: center; opacity: .5; }
.pack-del:hover { opacity: 1; background: rgba(239, 68, 68, .1); color: var(--danger); }
.pack-del svg { width: 15px; height: 15px; }

/* ── Trip budget ───────────────────────────────────────── */
.tb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.tb-kicker { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.tb-spent { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.tb-head small { color: var(--text-muted); font-size: .82rem; }
.tb-set { display: inline-flex; align-items: center; gap: .35rem; width: auto !important; }
.tb-set svg { width: 15px; height: 15px; }
.tb-main-bar { height: 10px !important; margin: .9rem 0 .4rem; }
.tb-sub { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .82rem; }
.tb-sub span { color: var(--text-muted); }
.tb-split { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0; }
.tb-split div { padding: .65rem .8rem; border-radius: 14px; background: var(--subtle-bg); }
.tb-split span { display: block; font-size: .72rem; color: var(--text-muted); }
.tb-split b { font-size: 1rem; }
.tb-rows { display: flex; flex-direction: column; gap: .55rem; }
.tb-row { display: grid; grid-template-columns: 10px 6.5rem minmax(0, 1fr) auto; align-items: center; gap: .55rem; font-size: .84rem; }
.tb-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tb-bar { height: 8px; border-radius: 99px; background: var(--subtle-bg); overflow: hidden; }
.tb-bar i { display: block; height: 100%; border-radius: inherit; transition: width .5s ease; }
.tb-val { font-weight: 700; text-align: right; white-space: nowrap; }
.tb-val small { font-weight: 500; color: var(--text-muted); }
@media (max-width: 420px) { .tb-row { grid-template-columns: 10px 1fr auto; } .tb-bar { grid-column: 2 / -1; grid-row: 2; } }
.tb-toggle { font-size: .8rem; color: var(--text-muted); margin: 0 0 .5rem; }
.tb-exp { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--border-color); }
.tb-exp-main { flex: 1; min-width: 0; font-size: .88rem; }
.tb-exp-main small { display: block; color: var(--text-muted); font-size: .74rem; }
.tb-exp b { font-size: .9rem; white-space: nowrap; }
.tb-hint { font-size: .78rem; color: var(--text-muted); margin: 0 0 .75rem; }

/* ── Rich notes editor ─────────────────────────────────── */
.ne-card { padding: 0 !important; overflow: visible !important; }
.ne-toolbar { position: sticky; top: calc(54px + 60px + env(safe-area-inset-top)); z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: .45rem .55rem; border-bottom: 1px solid var(--border-color); background: var(--card-bg, #fff); border-radius: var(--card-radius, 20px) var(--card-radius, 20px) 0 0; }
.ne-btn { min-width: 34px; height: 34px; padding: 0 .4rem; border: 0; border-radius: 8px; background: none; color: var(--text-main); font: inherit; font-size: .95rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ne-btn:hover { background: var(--subtle-bg); }
.ne-btn svg { width: 16px; height: 16px; }
.ne-btn mark { background: #fde68a; padding: 0 3px; border-radius: 3px; }
.ne-sep { width: 1px; height: 20px; background: var(--border-color); margin: 0 .25rem; }
.ne-editor { min-height: 320px; padding: 1rem 1.2rem 1.5rem; outline: none; font-size: .96rem; line-height: 1.65; color: var(--text-main); overflow-wrap: anywhere; }
.ne-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.ne-editor h2, .ne-editor h3 { margin: 1rem 0 .35rem; font-size: 1.15rem; font-weight: 800; }
.ne-editor h2:first-child, .ne-editor h3:first-child { margin-top: 0; }
.ne-editor p { margin: 0 0 .5rem; }
.ne-editor ul, .ne-editor ol { margin: 0 0 .6rem; padding-left: 1.4rem; }
.ne-editor blockquote { margin: .4rem 0 .7rem; padding: .5rem .9rem; border-left: 4px solid var(--primary-color); background: rgba(var(--primary-rgb), .06); border-radius: 0 10px 10px 0; color: var(--text-main); }
.ne-editor a { color: var(--primary-color); text-decoration: underline; }
.ne-editor mark { background: #fde68a; color: inherit; padding: 0 2px; border-radius: 3px; }
.ne-editor hr { border: 0; border-top: 2px dashed var(--border-color); margin: 1rem 0; }
.ne-editor ul.note-check { list-style: none; padding-left: .2rem; }
.ne-editor ul.note-check > li { position: relative; padding-left: 1.9rem; margin: .25rem 0; }
.ne-editor ul.note-check > li::before { content: ''; position: absolute; left: 0; top: .2em; width: 1.15em; height: 1.15em; border: 2px solid var(--border-color); border-radius: 6px; cursor: pointer; box-sizing: border-box; }
.ne-editor ul.note-check > li[data-done="true"] { color: var(--text-muted); text-decoration: line-through; }
.ne-editor ul.note-check > li[data-done="true"]::before { background: var(--success, #10b981) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 75% no-repeat; border-color: var(--success, #10b981); }
.ne-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .55rem .9rem; border-top: 1px solid var(--border-color); }
.ne-templates { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .74rem; color: var(--text-muted); }
.ne-templates button { border: 1px dashed var(--border-color); background: none; border-radius: 999px; padding: .25rem .6rem; font: inherit; font-size: .74rem; font-weight: 600; color: var(--text-main); cursor: pointer; }
.ne-templates button:hover { border-color: var(--primary-color); color: var(--primary-color); }
.ne-status { font-size: .74rem; color: var(--text-muted); }

/* ── Health ────────────────────────────────────────────── */
.health-view { display: flex; flex-direction: column; gap: 1rem; }
.hl-hero { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #0f766e, #0f3d5e); box-shadow: 0 14px 32px rgba(15, 61, 94, .28); position: relative; overflow: hidden; }
.hl-hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; border: 24px solid rgba(255,255,255,.07); pointer-events: none; }
.hl-ring { --p: 0; flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#6ee7b7 calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.hl-ring span { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: #0f4f5a; font-size: .85rem; }
.hl-ring b { font-size: 1.2rem; }
.hl-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; position: relative; z-index: 1; }
.hl-kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; opacity: .75; }
.hl-hero-text strong { font-size: 1.15rem; }
.hl-hero-text small { font-size: .78rem; opacity: .75; }
.hl-add { position: relative; z-index: 1; flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; border-radius: 16px; padding: .6rem .8rem; background: #f26a1b; color: #fff; font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(242,106,27,.4); }
.hl-add svg { width: 20px; height: 20px; }
.hl-alerts { display: flex; flex-wrap: wrap; gap: .4rem; }
.hl-alert { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border-radius: 12px; font-size: .78rem; }
.hl-alert svg { width: 14px; height: 14px; flex: none; }
.hl-alert.is-warning { background: rgba(245,158,11,.14); color: #92400e; }
.hl-alert.is-danger { background: rgba(239,68,68,.12); color: #b91c1c; }
.hl-alert.is-info { background: rgba(37,99,235,.1); color: #1d4ed8; }
.hl-today .review-title { margin-bottom: .4rem; }
.hl-slot-group h4 { display: flex; align-items: center; gap: .35rem; margin: .8rem 0 .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.hl-slot-group h4 svg { width: 13px; height: 13px; }
.hl-dose { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem; margin-bottom: .35rem; border-radius: 14px; background: color-mix(in srgb, var(--k) 7%, transparent); border-left: 4px solid var(--k); transition: opacity .2s; }
.hl-dose.is-taken { opacity: .6; }
.hl-dose.is-taken b { text-decoration: line-through; }
.hl-dose.is-late { background: rgba(239,68,68,.07); }
.hl-dose-time { flex: none; width: 3rem; font-weight: 800; font-size: .92rem; }
.hl-dose-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hl-dose-main b { font-size: .92rem; overflow-wrap: anywhere; }
.hl-dose-main small { font-size: .74rem; color: var(--text-muted); }
.hl-dose.is-late small { color: var(--danger); }
.hl-tick { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--k); background: var(--card-bg, #fff); color: transparent; display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.hl-tick svg { width: 18px; height: 18px; }
.hl-tick:hover { color: var(--k); }
.hl-dose.is-taken .hl-tick { background: var(--k); color: #fff; }
.hl-take-now { flex: none; border: 1.5px solid var(--k); background: none; color: var(--k); border-radius: 999px; padding: .35rem .75rem; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.hl-take-now:hover { background: var(--k); color: #fff; }
.hl-search { margin-bottom: .6rem; }
.hl-filters { margin-bottom: .8rem; }
.hl-filters small { opacity: .7; font-weight: 700; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .65rem; }
.hl-item { display: flex; flex-direction: column; gap: .3rem; padding: .85rem .9rem; border-radius: 16px; border: 1px solid var(--border-color); border-top: 4px solid var(--k); background: var(--card-bg, #fff); font: inherit; color: var(--text-main); text-align: left; cursor: pointer; transition: transform .15s, box-shadow .2s; }
.hl-item:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15,23,42,.1); }
.hl-item.is-paused { opacity: .55; }
.hl-item-top { display: flex; align-items: center; gap: .45rem; }
.hl-item-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--k) 15%, transparent); color: var(--k); }
.hl-item-icon svg { width: 16px; height: 16px; }
.hl-item-kind { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--k); }
.hl-item-name { font-size: 1rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.hl-item-name small { font-weight: 500; color: var(--text-muted); font-size: .78rem; }
.hl-item-purpose { font-size: .8rem; color: var(--text-muted); }
.hl-item-meta { display: flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--text-muted); }
.hl-item-meta svg { width: 12px; height: 12px; flex: none; }
.hl-stock { height: 5px; border-radius: 99px; background: var(--subtle-bg); overflow: hidden; }
.hl-stock i { display: block; height: 100%; background: var(--k); border-radius: inherit; }
.hl-item-alerts { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }
.hl-item-alerts span { font-size: .66rem; font-weight: 700; padding: .12rem .45rem; border-radius: 6px; }
.hl-item-alerts .is-warning { background: rgba(245,158,11,.16); color: #92400e; }
.hl-item-alerts .is-danger { background: rgba(239,68,68,.13); color: #b91c1c; }
.hl-item-alerts .is-info { background: rgba(37,99,235,.1); color: #1d4ed8; }
.hl-empty { text-align: center; padding: 1rem .5rem; }
.hl-empty p { max-width: 380px; margin: .6rem auto 1rem; font-size: .88rem; color: var(--text-muted); }
.hl-empty-icons { display: flex; justify-content: center; gap: .5rem; }
.hl-empty-icons span { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); }
.hl-hist { display: flex; flex-direction: column; gap: .35rem; }
.hl-hist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; font-size: .82rem; }
.hl-hist-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-hist-row > div { display: grid; grid-template-columns: repeat(7, 22px); gap: 4px; }
.hl-hist-head > div span { font-size: .66rem; text-align: center; color: var(--text-muted); }
.hl-cell { width: 22px; height: 22px; border-radius: 6px; background: var(--subtle-bg); }
.hl-cell.is-full { background: #10b981; }
.hl-cell.is-part { background: #fbbf24; }
.hl-cell.is-miss { background: rgba(239,68,68,.35); }
.hl-cell.is-today { background: transparent; box-shadow: inset 0 0 0 2px var(--border-color); }
.hl-cell.is-off { background: transparent; }
.hl-rate { font-size: .74rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.hl-rate.is-good { background: rgba(16,185,129,.14); color: #047857; }
.hl-rate.is-ok { background: rgba(245,158,11,.15); color: #92400e; }
.hl-rate.is-low { background: rgba(239,68,68,.12); color: #b91c1c; }
.hl-disclaimer { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: .74rem; color: var(--text-muted); margin: 0; text-align: center; }
.hl-disclaimer svg { width: 13px; height: 13px; flex: none; }
.hl-modal.is-wide { max-width: 540px; max-height: 92vh; overflow-y: auto; }
.hl-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: 1rem; }
.hl-kind { cursor: pointer; }
.hl-kind input { position: absolute; opacity: 0; pointer-events: none; }
.hl-kind span { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .6rem .2rem; border-radius: 14px; border: 1.5px solid var(--border-color); font-size: .72rem; font-weight: 600; color: var(--text-muted); transition: all .15s; }
.hl-kind span svg { width: 18px; height: 18px; }
.hl-kind input:checked + span { border-color: var(--k); color: var(--k); background: color-mix(in srgb, var(--k) 10%, transparent); }
.hl-kind input:focus-visible + span { outline: 2px solid var(--k); outline-offset: 2px; }
.hl-dose-input { display: grid; grid-template-columns: 1fr 1.2fr; gap: .35rem; }
.hl-presets { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.hl-presets button { border: 1px solid var(--border-color); background: none; border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .76rem; font-weight: 600; color: var(--text-main); cursor: pointer; }
.hl-presets button:hover { border-color: var(--primary-color); color: var(--primary-color); }
.hl-times { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.hl-time { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 8px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--subtle-bg); }
.hl-time input { border: 0; background: none; font: inherit; font-weight: 700; color: var(--text-main); width: 6.2rem; }
.hl-time button { width: 26px; height: 26px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; }
.hl-time button svg { width: 14px; height: 14px; }
.hl-time-add { display: inline-flex; align-items: center; gap: .25rem; border: 1px dashed var(--border-color); background: none; border-radius: 12px; padding: .4rem .7rem; font: inherit; font-size: .78rem; font-weight: 600; color: var(--primary-color); cursor: pointer; }
.hl-time-add svg { width: 14px; height: 14px; }
.hl-as-needed { font-size: .78rem; color: var(--text-muted); }
.hl-more { margin: .25rem 0 1rem; border: 1px solid var(--border-color); border-radius: 14px; padding: .6rem .85rem; }
.hl-more summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.hl-more[open] summary { margin-bottom: .75rem; }
.hl-detail-title { display: inline-flex; align-items: center; gap: .45rem; }
.hl-detail-title svg { width: 18px; height: 18px; color: var(--k); }
.hl-detail { display: flex; flex-direction: column; gap: .1rem; }
.hl-detail .hl-alert { margin-bottom: .35rem; }
.hl-detail-purpose { margin: 0 0 .6rem; font-size: .95rem; }
.hl-detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border-color); font-size: .86rem; }
.hl-detail-row span { color: var(--text-muted); }
.hl-detail-row b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.hl-detail-box { margin-top: .6rem; padding: .65rem .8rem; border-radius: 12px; background: var(--subtle-bg); font-size: .84rem; }
.hl-detail-box b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: .2rem; }
.hl-detail-box p { margin: 0; white-space: pre-wrap; }
.hl-detail-box.is-warn { background: rgba(245,158,11,.1); }
.hl-detail .bill-form-actions { margin-top: 1rem; }
.hl-detail .bill-form-actions .btn { display: inline-flex; align-items: center; gap: .3rem; }
.hl-detail .bill-form-actions svg { width: 14px; height: 14px; }

/* ── Remember me ───────────────────────────────────────── */
.remember-row { display: flex; align-items: flex-start; gap: .65rem; margin-top: .25rem; padding: .7rem .8rem; border-radius: 14px; background: var(--subtle-bg); cursor: pointer; user-select: none; }
.remember-row input { position: absolute; opacity: 0; pointer-events: none; }
.remember-box { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 2px solid var(--border-color); background: var(--card-bg, #fff); color: transparent; display: grid; place-items: center; transition: all .15s; }
.remember-box svg { width: 14px; height: 14px; }
.remember-row input:checked + .remember-box { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.remember-row input:focus-visible + .remember-box { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.remember-row > span:last-child { font-size: .88rem; line-height: 1.35; }
.remember-row small { display: block; font-size: .74rem; color: var(--text-muted); margin-top: .1rem; }

/* ── Quick add ─────────────────────────────────────────── */
.header-new { display: inline-flex; align-items: center; gap: .3rem; height: 38px; padding: 0 .9rem 0 .7rem; margin-left: auto; margin-right: .45rem; border: 0; border-radius: 999px; background: var(--primary-color); color: #fff; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(var(--primary-rgb), .35); transition: transform .15s, background .15s; }
.header-new:hover { background: var(--primary-hover); transform: translateY(-1px); }
.header-new svg { width: 17px; height: 17px; }
#appHeader .header-search { margin-left: 0; }
@media (max-width: 1023px) { .header-new { display: none; } }
.nav-add { flex: none; display: flex; align-items: center; justify-content: center; width: 64px; border: 0; background: none; cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.nav-add span { width: 52px; height: 52px; margin-top: -22px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-color); color: #fff; box-shadow: 0 8px 20px rgba(var(--primary-rgb), .45), 0 0 0 4px var(--card-bg, #fff); transition: transform .15s; }
.nav-add:active span { transform: scale(.92); }
.nav-add svg { width: 26px; height: 26px; }
.qa-overlay { position: fixed; inset: 0; z-index: 4500; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 18, 26, 0); transition: background .2s; }
.qa-overlay.is-open { background: rgba(5, 18, 26, .45); }
.qa-sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--card-bg, #fff); border-radius: 26px 26px 0 0; padding: .5rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(5, 18, 26, .25); transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.qa-overlay.is-open .qa-sheet { transform: none; }
@media (min-width: 700px) { .qa-overlay { align-items: center; } .qa-sheet { border-radius: 24px; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .2s ease, opacity .2s ease; } .qa-overlay.is-open .qa-sheet { opacity: 1; } .qa-handle { display: none; } }
.qa-handle { width: 42px; height: 5px; border-radius: 99px; background: var(--border-color); margin: .2rem auto .6rem; }
.qa-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.qa-head h3 { margin: 0; font-size: 1.15rem; }
.qa-group { margin-top: .7rem; }
.qa-group h4 { margin: 0 0 .45rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
@media (max-width: 340px) { .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.qa-tile { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .75rem .3rem .65rem; border: 1px solid var(--border-color); border-radius: 18px; background: var(--card-bg, #fff); font: inherit; color: var(--text-main); cursor: pointer; transition: transform .12s, border-color .15s, box-shadow .15s; }
.qa-tile:hover, .qa-tile:focus-visible { border-color: var(--k); box-shadow: 0 6px 16px color-mix(in srgb, var(--k) 22%, transparent); transform: translateY(-2px); outline: none; }
.qa-tile:active { transform: scale(.96); }
.qa-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--k); color: #fff; box-shadow: 0 5px 12px color-mix(in srgb, var(--k) 35%, transparent); }
.qa-icon svg { width: 22px; height: 22px; }
.qa-label { font-size: .76rem; font-weight: 600; text-align: center; line-height: 1.15; }
.qa-recent .qa-tile { background: color-mix(in srgb, var(--k) 6%, var(--card-bg, #fff)); }
.qa-hint { margin: 1rem 0 0; text-align: center; font-size: .74rem; color: var(--text-muted); }
.qa-hint kbd { font: inherit; font-weight: 700; padding: .05rem .4rem; border: 1px solid var(--border-color); border-radius: 5px; background: var(--subtle-bg); }
@media (hover: none) { .qa-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .qa-sheet, .qa-overlay { transition: none; } }
@media (min-width: 560px) { .qa-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ── Weather strip (Overview) ──────────────────────────── */
.wx-slot { margin-bottom: .9rem; }
.wx-slot:empty { display: none; }
.wx { --wx-a: #fff7ed; --wx-b: #ffedd5; --wx-ink: #7c2d12; position: relative; display: flex; align-items: stretch; gap: .9rem; padding: .85rem 1rem; border-radius: 20px; background: linear-gradient(135deg, var(--wx-a), var(--wx-b)); color: var(--wx-ink); border: 1px solid color-mix(in srgb, var(--wx-ink) 10%, transparent); box-shadow: 0 6px 18px color-mix(in srgb, var(--wx-ink) 10%, transparent); overflow: hidden; animation: slideUp .45s ease both; }
.wx-cloud { --wx-a: #f1f5f9; --wx-b: #e2e8f0; --wx-ink: #1e293b; }
.wx-rain  { --wx-a: #e0f2fe; --wx-b: #cbd5e1; --wx-ink: #0c4a6e; }
.wx-storm { --wx-a: #cbd5e1; --wx-b: #94a3b8; --wx-ink: #0f172a; }
.wx-night { --wx-a: #1e293b; --wx-b: #0f2a3d; --wx-ink: #e0e7ff; }
.wx.is-stale { opacity: .85; }
.wx-now { flex: 1; min-width: 0; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.wx-icon { flex: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.12)); }
.wx-main { min-width: 0; display: flex; flex-direction: column; }
.wx-temp { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.wx-temp small { font-size: .9rem; font-weight: 700; opacity: .7; margin-left: 1px; }
.wx-cond { font-size: .8rem; font-weight: 600; opacity: .85; margin-top: .15rem; }
.wx-place { display: inline-flex; align-items: center; gap: .25rem; align-self: flex-start; margin-top: .15rem; padding: 0; border: 0; background: none; font: inherit; font-size: .72rem; color: inherit; opacity: .75; cursor: pointer; }
.wx-place:hover { opacity: 1; text-decoration: underline; }
.wx-place svg { width: 11px; height: 11px; }
.wx-extra { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .72rem; opacity: .85; flex-basis: 100%; }
.wx-extra span { display: inline-flex; align-items: center; gap: .2rem; }
.wx-extra svg { width: 12px; height: 12px; }
.wx-days { flex: none; display: flex; gap: .35rem; align-items: stretch; }
.wx-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-width: 54px; padding: .4rem .35rem; border-radius: 14px; background: color-mix(in srgb, #fff 55%, transparent); }
.wx-night .wx-day, .wx-storm .wx-day { background: rgba(255,255,255,.1); }
.wx-day-name { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; opacity: .75; }
.wx-day-temp { font-size: .74rem; white-space: nowrap; }
.wx-day-temp b { font-weight: 800; margin-right: .2rem; }
.wx-day-temp { opacity: .9; }
.wx-day-rain { font-size: .62rem; font-weight: 600; min-height: .9em; }
@media (max-width: 520px) {
    .wx { flex-direction: column; gap: .7rem; }
    .wx-days { display: grid; grid-template-columns: repeat(3, 1fr); }
    .wx-day { flex-direction: row; justify-content: space-between; min-width: 0; padding: .4rem .55rem; gap: .3rem; }
    .wx-day svg { width: 22px; height: 22px; }
    .wx-day-rain.is-empty { display: none; }
    .wx-day { flex-wrap: wrap; justify-content: center; }
}
.wx-loading { min-height: 96px; align-items: center; background: var(--subtle-bg); border-color: transparent; box-shadow: none; }
.wx-sk { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, rgba(148,163,184,.18), rgba(148,163,184,.35), rgba(148,163,184,.18)); background-size: 200% 100%; animation: wxShimmer 1.2s linear infinite; }
.wx-sk-a { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.wx-sk-b { flex: 1; height: 28px; }
.wx-sk-c { width: 160px; height: 56px; border-radius: 14px; }
@keyframes wxShimmer { to { background-position: -200% 0; } }
.wx-setup { --wx-a: #f0fdfa; --wx-b: #e0f2fe; --wx-ink: #0f3d5e; align-items: center; flex-wrap: wrap; }
.wx-setup-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.wx-setup-text strong { font-size: .95rem; }
.wx-setup-text small { font-size: .76rem; opacity: .8; }
.wx-setup-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.wx-btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid color-mix(in srgb, #0f3d5e 20%, transparent); background: rgba(255,255,255,.75); color: #0f3d5e; border-radius: 999px; padding: .45rem .85rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.wx-btn svg { width: 14px; height: 14px; }
.wx-btn.is-main { background: var(--primary-color); color: #fff; border-color: transparent; }
.wx-msg { --wx-a: var(--subtle-bg); --wx-b: var(--subtle-bg); --wx-ink: var(--text-muted); align-items: center; justify-content: space-between; font-size: .82rem; box-shadow: none; }
.wx-msg button, .wx-remove, .wx-show { border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 600; color: var(--primary-color); cursor: pointer; }
.wx-show { display: inline-flex; align-items: center; gap: .3rem; color: var(--text-muted); padding: 0; }
.wx-show svg { width: 13px; height: 13px; }
.wx-geo { width: 100%; justify-content: center; padding: .65rem; }
.wx-results { display: flex; flex-direction: column; gap: .25rem; max-height: 280px; overflow-y: auto; }
.wx-result { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border: 0; border-radius: 12px; background: none; font: inherit; color: var(--text-main); text-align: left; cursor: pointer; }
.wx-result:hover, .wx-result:focus-visible { background: var(--subtle-bg); }
.wx-result svg { width: 15px; height: 15px; color: var(--primary-color); flex: none; }
.wx-result small { display: block; font-size: .74rem; color: var(--text-muted); }
.wx-hint { font-size: .8rem; color: var(--text-muted); margin: .3rem .2rem; }
.wx-remove { margin-top: .8rem; color: var(--text-muted); padding: 0; }

/* ── Muscle map: detailed anatomy ──────────────────────── */
.mm-card { --mm-skin: #f1e4da; --mm-skin-edge: #e2cfc2; --mm-cold: #d9c2b6; --mm-cold-line: #b89b8c; --mm-line: rgba(120, 85, 70, .35); }
body:not(.theme-light) .mm-card { --mm-skin: #3a4150; --mm-skin-edge: #2d3340; --mm-cold: #4b5466; --mm-cold-line: #697389; --mm-line: rgba(200, 210, 230, .25); }
.mm-figure { max-width: 190px; }
.mm-figure .mm-body path, .mm-figure .mm-body ellipse { stroke: var(--mm-cold-line); stroke-width: .8; stroke-linejoin: round; }
.mm-figure .mm-body { fill: var(--mm-skin); }
.mm-line { stroke: var(--mm-line) !important; stroke-width: .7 !important; fill: none; stroke-linecap: round; }
.mm-face path, .mm-neck { stroke: var(--mm-cold-line); stroke-width: .9; fill: none; stroke-linecap: round; }
.mm-hair { fill: var(--mm-cold); stroke: var(--mm-cold-line); stroke-width: .6; opacity: .8; }
.mm-muscle path { stroke: var(--mm-cold-line); stroke-width: .55; }
.mm-muscle.is-cold path { fill: var(--mm-cold); }
.mm-muscle.is-hot path { fill: rgba(var(--heat-rgb), var(--heat)); stroke: rgba(150, 50, 10, .45); }
.mm-muscle:hover path, .mm-muscle:focus-visible path { filter: brightness(1.08) drop-shadow(0 0 2.5px rgba(var(--heat-rgb), .7)); }
.mm-muscle.is-selected path { stroke: #0f3d3e; stroke-width: 1.3; filter: drop-shadow(0 0 3px rgba(var(--heat-rgb), .8)); }
body:not(.theme-light) .mm-muscle.is-selected path { stroke: #fff; }
.mm-parts { margin: .1rem 0 0; font-size: .72rem; color: var(--text-muted); }
.mm-tips { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: .55rem; font-size: .7rem; color: var(--text-muted); }
.mm-tips b { font-weight: 600; color: var(--text-main); background: var(--card-bg, #fff); border: 1px solid var(--border-color); padding: .12rem .45rem; border-radius: 999px; }
.mm-legend i { background: linear-gradient(90deg, var(--mm-cold), rgba(var(--heat-rgb), .3), rgb(var(--heat-rgb))); }

/* ── Calendar sync ─────────────────────────────────────── */
.pl-ext { --k: #4285f4; }
.pl-sync-btn { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; height: 36px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--border-color); background: var(--card-bg, #fff); color: var(--text-main); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pl-sync-btn:hover { border-color: var(--primary-color); box-shadow: 0 4px 12px rgba(var(--primary-rgb), .15); }
.pl-sync-btn svg { width: 15px; height: 15px; color: var(--primary-color); }
.pl-sync-btn small { font-size: .66rem; padding: .05rem .4rem; border-radius: 999px; background: var(--primary-color); color: #fff; }
.pl-sync-btn.is-busy svg { animation: spin 1s linear infinite; }
@media (max-width: 640px) { .pl-sync-btn span { display: none; } .pl-sync-btn { padding: 0 .6rem; } }
.pl-sync { max-width: 600px !important; max-height: 92vh; overflow-y: auto; }
.pl-sync-intro { font-size: .84rem; color: var(--text-muted); margin: 0 0 .5rem; }
.pl-sync-sec { padding: .9rem 0; border-top: 1px solid var(--border-color); }
.pl-sync-sec h4 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: .95rem; }
.pl-sync-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-color); color: #fff; font-size: .72rem; font-weight: 800; flex: none; }
.pl-sync-small { font-size: .8rem; color: var(--text-muted); margin: 0 0 .6rem; }
.pl-feeds { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .8rem; }
.pl-feed { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: 14px; border: 1px solid var(--border-color); border-left: 4px solid var(--k); }
.pl-feed-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--subtle-bg); flex: none; }
.pl-feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-feed-main b { font-size: .88rem; }
.pl-feed-main small { font-size: .74rem; color: var(--text-muted); overflow-wrap: anywhere; }
.pl-sync-link { display: inline-flex; align-items: center; gap: .3rem; align-self: flex-start; border: 0; background: none; padding: .2rem 0; font: inherit; font-size: .78rem; font-weight: 600; color: var(--primary-color); cursor: pointer; }
.pl-sync-link svg { width: 13px; height: 13px; }
.pl-provider-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--subtle-bg); margin-bottom: .6rem; }
.pl-provider-tabs button { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 38px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: .78rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.pl-provider-tabs button.is-on { background: var(--card-bg, #fff); color: var(--text-main); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.pl-steps { margin: 0 0 .7rem; padding-left: 1.2rem; font-size: .8rem; line-height: 1.55; color: var(--text-main); }
.pl-feed-form { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: .4rem; }
.pl-feed-form .btn { width: auto !important; padding: 0 1rem !important; }
@media (max-width: 520px) { .pl-feed-form { grid-template-columns: 1fr; } }
.pl-sync-note { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--text-muted); margin: .3rem 0 0; }
.pl-sync-note svg { width: 12px; height: 12px; flex: none; }
.pl-export { display: grid; gap: .5rem; }
.pl-export-card { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .85rem; border-radius: 14px; border: 1px solid var(--border-color); background: var(--card-bg, #fff); color: var(--text-main); text-decoration: none; }
a.pl-export-card:hover { border-color: var(--primary-color); }
.pl-export-card > svg { width: 20px; height: 20px; color: var(--primary-color); flex: none; margin-top: 2px; }
.pl-export-card > span { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }
.pl-export-card b { font-size: .88rem; }
.pl-export-card small { font-size: .76rem; color: var(--text-muted); }
.pl-export-card.is-muted { background: var(--subtle-bg); }
.pl-copy-row { display: flex; gap: .35rem; margin-top: .3rem; }
.pl-copy-row input { font-size: .76rem; }
.pl-copy-row .btn { width: auto !important; padding: 0 .8rem !important; }
.pl-get-link { width: auto !important; align-self: flex-start; margin-top: .3rem; padding: .35rem .9rem !important; font-size: .8rem; }
.pl-item-acts { display: inline-flex; align-items: center; gap: .25rem; }
.pl-addto { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--border-color); background: var(--card-bg, #fff); }
.pl-addto:hover { border-color: var(--primary-color); }

/* ── Mobile header & menu polish ───────────────────────── */
/* Header: the menu and search buttons share one shape; long titles shorten with "…" */
#appHeader #hamburgerBtn, #appHeader .header-search, #appHeader #installBtn { width: 40px; height: 40px; border-radius: 12px !important; flex: none; }
#appHeader #headerTitle { max-width: calc(100% - 140px); overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 641px) { #appHeader .header-search { width: auto; } }
@media (max-width: 640px) {
    #appHeader { padding-left: max(.75rem, env(safe-area-inset-left)); padding-right: max(.75rem, env(safe-area-inset-right)); }
    #appHeader .header-search { width: 40px !important; padding: 0 !important; justify-content: center; }
    #appHeader #headerTitle { font-size: 1rem; }
}

/* Menu: grouped, roomy touch targets, page behind does not scroll */
.sidebar-label { margin: 1rem 0 .3rem .875rem; }
.sidebar-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1023px) {
    body.sidebar-open { overflow: hidden; touch-action: none; }
    body.sidebar-open #sidebarPanel { touch-action: pan-y; }
    #sidebarPanel { width: min(300px, 86vw) !important; overscroll-behavior: contain; padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important; padding-top: max(1rem, env(safe-area-inset-top)) !important; }
    .sidebar-item { min-height: 46px; font-size: .92rem; padding: .65rem .875rem; }
    .sidebar-item svg { width: 18px !important; height: 18px !important; }
    .sidebar-head { position: sticky; top: calc(-1 * max(1rem, env(safe-area-inset-top))); z-index: 1; background: inherit; padding-top: .25rem; }
    .sidebar-close { width: 44px !important; height: 44px !important; }
}
.sidebar-item-danger { margin-top: .35rem; }

/* Bottom bar: the + button sits centred and raised */
.nav-add { align-self: center; margin-top: -26px; }
.nav-add span { margin-top: 0; }
@media (max-width: 360px) { .nav-add { width: 56px; } .nav-add span { width: 48px; height: 48px; border-radius: 16px; } .nav-item span { font-size: .62rem; } }

/* Filter rows wrap instead of hiding pills off-screen; the Overview's action row scrolls with a soft edge */
.hl-filters, .bills-view .quick-actions, .plan-view .quick-actions { flex-wrap: wrap; overflow: visible; }
.dashboard-view .quick-actions { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 1.5rem; }
/* Opening: visible at once (it still slides in) so focus can move into it; closing: hides after the slide-out */
@media (max-width: 1023px) { body.sidebar-open #sidebarPanel { transition: transform .3s cubic-bezier(.4, 0, .2, 1), visibility 0s; } }
