:root {
    --forest-dark: #052922;
    --forest-mid: #0e4a39;
    --forest-light: #1d7358;
    --forest-accent: #34a06f;
    /* Matches FullCalendar community-event blocks (see app/routers/calendar.py) */
    --community-calendar: #52796f;
    --warm-bg: #f1f7f4;
    --warm-card: #ffffff;
    --warm-text: #152320;
    --warm-muted: #5a6d67;
    --amber: #d97706;
    --border: #cfe5da;
    --border-strong: #b6d4c5;
    --surface-muted: #f4faf7;
    --surface-input: #fafcfb;

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.2rem;
    --radius: var(--radius-xl);

    --shadow-sm: 0 1px 2px rgba(6, 38, 28, 0.05), 0 1px 3px rgba(6, 38, 28, 0.06);
    --shadow-md: 0 4px 14px rgba(6, 38, 28, 0.08), 0 2px 6px rgba(6, 38, 28, 0.05);
    --shadow-lg: 0 16px 48px -20px rgba(6, 38, 28, 0.14), 0 8px 20px -12px rgba(6, 38, 28, 0.1);
    --shadow: var(--shadow-lg);

    --ring: 0 0 0 3px rgba(52, 160, 111, 0.22);
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);

    /* Content max-widths — shared across auth, account, modals, page shells */
    --layout-auth: 440px;
    --layout-account: 620px;
    --layout-modal: 560px;
    --layout-landing: 600px;
    --layout-stats: 760px;
    --layout-wide: 960px;
    --layout-calendar: 1180px;
}

/*
 * Breakpoints for @media (literal px — not var() in queries for older Safari):
 *   400px  calendar toolbar single column
 *   480px  stack action rows, pet edit grid, task modal footer
 *   560px  cats / plants page headers stack
 *   768px  calendar toolbar column, widgets 1-col, task form 1-col
 *   900px  financials + dashboard two-column collapse
 *   993px  desktop shell (sidebar + grid; pair with max-width 992 if adding queries)
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    min-height: 100vh;
    color: var(--warm-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(ellipse 90% 55% at 10% -8%, rgba(52, 160, 111, 0.11), transparent 42%),
        radial-gradient(ellipse 70% 45% at 92% 4%, rgba(29, 115, 88, 0.09), transparent 38%),
        linear-gradient(175deg, #f8fbfa 0%, #ecf4ef 48%, #e8f1ec 100%);
}

/* Layout */
/* Mobile-first shell: sidebar off-canvas by default so the first paint on phones
   never uses the desktop two-column layout (avoids flash + slide when the viewport
   updates from a wide initial layout to the real device width). */
.app-container {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    width: 100%;
}

.mobile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, var(--forest-dark) 0%, var(--forest-mid) 100%);
    color: var(--warm-card);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.35);
}

.sidebar {
    background: linear-gradient(180deg, var(--forest-dark) 0%, var(--forest-mid) 55%, var(--forest-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 24px -8px rgba(5, 41, 34, 0.35);
    transition: transform 0.3s var(--ease);
    z-index: 1000;
    transform: translateX(-100%);
}

.sidebar.sidebar-open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.logo:hover,
.logo:hover .logo-text,
.logo:hover .logo-subtitle,
.logo:visited,
.logo:visited .logo-text,
.logo:visited .logo-subtitle {
    color: #fff;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-labels {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 0.2rem;
}

.sidebar-toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(52, 160, 111, 0.95), rgba(29, 115, 88, 0.98));
    box-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.35);
}

.nav-group-toggle {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.group-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: transform 0.2s;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 0.25rem;
}

.group-arrow:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.nav-group.group-open .group-arrow {
    transform: rotate(180deg);
}

.nav-group-content {
    display: none;
    flex-direction: column;
    padding-left: 2rem;
    margin-top: 0.25rem;
}

.nav-group.group-open .nav-group-content {
    display: flex;
}

.nav-sub-item {
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-sub-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-sub-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    font-size: 1.2rem;
}

.user-name {
    flex: 1;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-arrow {
    font-size: 0.8rem;
    opacity: 0.5;
    transition: transform 0.2s;
}

.user-menu.menu-open .menu-arrow {
    transform: rotate(180deg);
}

.user-menu-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    background: var(--forest-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.user-menu.menu-open .user-menu-content {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.user-menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.content-wrapper {
    max-width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 clamp(0rem, 1.5vw, 0.25rem);
}

/* Removed old .nav styles */

.container {
    background: var(--warm-card);
    padding: clamp(1.75rem, 4vw, 2.35rem);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-width: var(--layout-account);
    width: min(95%, var(--layout-account));
    text-align: center;
    margin: 1.25rem auto 2rem;
    border: 1px solid rgba(14, 74, 57, 0.09);
}

h1 {
    font-size: clamp(1.8rem, 4.2vw, 2.55rem);
    font-weight: 800;
    margin: 0 0 0.65rem;
    color: var(--forest-dark);
    letter-spacing: -0.02em;
    line-height: 1.12;
}

p {
    color: var(--warm-muted);
    margin: 0 0 1.15rem;
    line-height: 1.56;
    font-size: 1rem;
}

a {
    color: var(--forest-mid);
}

a:hover {
    color: var(--forest-dark);
}

.btn {
    display: inline-block;
    width: 100%;
    background: linear-gradient(145deg, var(--forest-light) 0%, var(--forest-mid) 100%);
    color: #fff;
    padding: 0.78rem 1.3rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.96rem;
    letter-spacing: 0.015em;
    box-shadow: var(--shadow-sm), 0 8px 20px -10px rgba(5, 41, 34, 0.55);
    transition: transform 0.18s var(--ease), filter 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: var(--shadow-sm), 0 12px 28px -12px rgba(5, 41, 34, 0.5);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring), var(--shadow-sm);
}

.btn-outline {
    display: inline-block;
    width: auto;
    background: var(--warm-card);
    color: var(--forest-mid);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    transform: translateY(-1px);
    background: var(--surface-muted);
    border-color: var(--forest-light);
    color: var(--forest-dark);
    filter: none;
}

.btn-secondary {
    background: var(--forest-accent);
    border: none;
    color: #fff;
    box-shadow: 0 8px 20px -12px rgba(6, 38, 28, 0.55);
}

.btn-secondary:hover {
    filter: brightness(1.05);
}

.btn-danger-outline {
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

.btn-danger-outline:hover {
    background: #fef2f2 !important;
    border-color: #f87171 !important;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.52rem;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--forest-mid);
    background: #ebfbf2;
    border: 1px solid #c6edd8;
    padding: 0.38rem 0.82rem;
    border-radius: 9999px;
    margin-bottom: 1.1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--forest-accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 169, 118, 0.55); }
    70% { transform: scale(1); box-shadow: 0 0 0 9px rgba(57, 169, 118, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 169, 118, 0); }
}

.form-group {
    text-align: left;
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 0.44rem;
    color: var(--forest-dark);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
    background: var(--surface-input);
    color: var(--warm-text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--forest-light);
    background: #fff;
    box-shadow: var(--ring);
}

.password-field-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-input);
    transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}

.password-field-wrap:focus-within {
    border-color: var(--forest-light);
    background: var(--warm-card);
    box-shadow: var(--ring);
}

.password-field-wrap input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.password-field-wrap input:focus {
    outline: none;
    border: none;
    box-shadow: none;
    background: transparent;
}

.password-toggle-btn {
    flex: 0 0 auto;
    align-self: stretch;
    padding: 0 0.85rem;
    margin: 0;
    min-height: 2.75rem;
    min-width: 3.25rem;
    border: none;
    border-left: 1px solid var(--border);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: rgba(255, 255, 255, 0.72);
    color: var(--forest-mid);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}

.password-toggle-btn:hover {
    background: var(--surface-muted);
    color: var(--forest-dark);
}

.password-toggle-btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--forest-accent);
    z-index: 1;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    text-align: left;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
}

th {
    padding: 0.88rem 0.95rem;
    font-weight: 600;
    color: var(--forest-mid);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.95rem;
    border-bottom: 1px solid rgba(207, 229, 218, 0.65);
    color: var(--warm-text);
    background: #fff;
}

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

/* Dashboard */
.dashboard-grid {
    display: block;
    width: 100%;
}

.widgets-container {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.widgets-container.widgets-cols-1 {
    grid-template-columns: 1fr;
}

.widgets-container.widgets-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: var(--warm-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(14, 74, 57, 0.1);
    box-shadow: var(--shadow-sm);
    cursor: default;
}

.widget-handle {
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.widget-handle:active {
    cursor: grabbing;
}

.widget-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--forest-light) !important;
}

/* Tasks Widget */
.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid #e9ecef;
    margin-bottom: 0.5rem;
    background: #fff;
    border-radius: 0 0.5rem 0.5rem 0;
}

.task-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.task-link:hover h4 {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.badge-task {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #f1f3f5;
    color: var(--forest-mid);
    font-weight: bold;
}

/* Modals */
.news-dialog {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    width: min(680px, 94vw);
    box-shadow: 0 25px 50px -12px rgba(8, 28, 21, 0.28);
}

.news-dialog::backdrop {
    background: rgba(8, 28, 21, 0.48);
}

.news-dialog-inner {
    padding: 1.35rem 1.5rem;
    max-height: 88vh;
    overflow-y: auto;
}

.news-dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.news-dialog-close {
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 0.5rem;
    background: #f1f3f5;
    color: var(--forest-dark);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}

.news-dialog-close:hover {
    background: var(--border);
}

.news-manage-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.news-manage-item {
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.85rem 0.95rem;
    background: #fcfefb;
}

.news-manage-btn {
    width: auto;
    padding: 0.32rem 0.7rem;
    font-size: 0.78rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
}

.news-manage-btn:hover {
    background: rgba(255,255,255,0.18);
}

/* Calendar */
.calendar-wrap {
    max-width: var(--layout-calendar);
    width: 96%;
    text-align: left;
    margin: 0 auto;
}

.calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.calendar-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.65rem 0.75rem;
}

.calendar-dropdown-wrap {
    position: relative;
}

.calendar-toolbar-dropdown-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: auto;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.calendar-toolbar-dropdown-icon {
    font-size: 1rem;
    line-height: 1;
}

.calendar-toolbar-chevron {
    font-size: 0.65rem;
    opacity: 0.55;
    margin-left: 0.1rem;
}

.calendar-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 120;
    min-width: min(100vw - 2.5rem, 280px);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: left;
}

.calendar-dropdown-panel.is-open {
    display: block;
}

.calendar-dropdown-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--warm-muted);
    margin: 0 0 0.65rem;
}

.calendar-view-menu-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.4rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: #fff;
    font-size: 0.94rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--forest-dark);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.calendar-view-menu-item:last-child {
    margin-bottom: 0;
}

.calendar-view-menu-item:hover {
    background: #f8fcfa;
    border-color: #cfe0d9;
}

.calendar-view-menu-item.is-active {
    background: #eefdf5;
    border-color: var(--forest-light);
    color: var(--forest-mid);
}

.calendar-dropdown-form-group {
    margin-bottom: 1.15rem;
}

.calendar-dropdown-form-group:last-of-type {
    margin-bottom: 1rem;
}

.calendar-dropdown-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--warm-muted);
    margin-bottom: 0.45rem;
}

.calendar-filter-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    border: 2px solid #f1f3f5;
    background: #f8f9fa;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--forest-dark);
}

.calendar-dropdown-clear-btn {
    width: 100%;
    margin-top: 0.15rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
}

.calendar-toolbar label {
    font-weight: 600;
    color: var(--forest-dark);
    font-size: 0.9rem;
}

.calendar-toolbar-legends {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem 1rem;
    flex: 1;
}

.calendar-community-hint {
    margin-top: 0.35rem;
    max-width: 52rem;
}

.calendar-community-swatch {
    color: var(--community-calendar);
}

.calendar-toolbar-legend-extra {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.calendar-legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.calendar-legend-dot--community {
    background: var(--community-calendar);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-end;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--warm-muted);
}

.swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.12);
}

#calendar {
    background: #fff;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.undated-section {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.undated-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--forest-dark);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.task-chip {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid var(--border);
    border-left: 4px solid var(--chip-c, var(--forest-mid));
    color: var(--warm-text);
    cursor: pointer;
}

.task-chip:hover {
    filter: brightness(0.97);
}

.task-chip.task-chip--private {
    font-style: italic;
}

.fc-event {
    cursor: pointer;
}

.fc-h-event,
.fc-v-event {
    border: none;
}

.fc-daygrid-event .fc-event-main,
.fc-timegrid-event .fc-event-main {
    overflow: hidden;
}

.fc-task-inner {
    display: flex;
    align-items: center;
    gap: 0.35em;
    min-width: 0;
    width: 100%;
}

.fc-group-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35), 0 0 0 2px rgba(248, 250, 252, 0.35);
}

.fc-task-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-task-completed .fc-task-title,
tr.fc-list-event.fc-task-completed .fc-list-event-title,
tr.fc-list-event.fc-task-completed .fc-list-event-title a {
    text-decoration: line-through;
    text-decoration-thickness: 0.14em;
}

.fc-task-private .fc-task-title,
tr.fc-list-event.fc-task-private .fc-list-event-title,
tr.fc-list-event.fc-task-private .fc-list-event-title a {
    font-style: italic;
}

/* Assignee colours: custom properties only (set in JS), no per-property inline styles */
.fc-daygrid-event.fc-assignee-themed:not(.fc-list-event),
.fc-timegrid-event.fc-assignee-themed {
    background-color: var(--fc-event-bg) !important;
    border-color: var(--fc-event-border, var(--fc-event-bg)) !important;
    color: var(--fc-event-fg, inherit) !important;
}

.fc-daygrid-event.fc-assignee-themed .fc-event-main,
.fc-timegrid-event.fc-assignee-themed .fc-event-main,
.fc-daygrid-event.fc-assignee-themed .fc-task-title,
.fc-timegrid-event.fc-assignee-themed .fc-task-title {
    color: var(--fc-event-fg, inherit) !important;
}

tr.fc-list-event.fc-assignee-themed td {
    background-color: var(--fc-event-bg) !important;
    color: var(--fc-event-fg, inherit) !important;
    border-bottom: 1px solid var(--fc-list-row-border, rgba(255, 255, 255, 0.2)) !important;
}

tr.fc-list-event.fc-assignee-themed .fc-list-event-dot {
    border-color: var(--fc-event-fg, currentColor) !important;
}

tr.fc-list-event.fc-assignee-themed .fc-list-event-title a {
    color: var(--fc-event-fg, inherit) !important;
}

.calendar-actions-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.calendar-actions-row .btn {
    width: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.task-modal-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.task-modal-footer .btn {
    width: auto;
}

.task-modal-footer-secondary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 480px) {
    .task-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .task-modal-footer-secondary {
        width: 100%;
        justify-content: stretch;
    }
    .task-modal-footer-secondary .btn {
        flex: 1;
        min-width: 0;
    }
    .task-modal-footer > .btn {
        width: 100%;
    }
}

.calendar-modal-dialog {
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: var(--layout-modal);
    width: min(var(--layout-modal), 94vw);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(14, 74, 57, 0.06);
}

.calendar-modal-dialog::backdrop {
    background: rgba(5, 41, 34, 0.52);
    backdrop-filter: blur(4px);
}

.calendar-modal-inner {
    padding: 1.35rem 1.5rem;
    max-height: 88vh;
    overflow-y: auto;
}

.calendar-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calendar-modal-head h2,
.calendar-modal-head h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--forest-dark);
}

.calendar-modal-dialog.calendar-modal-dialog--narrow {
    max-width: var(--layout-auth);
    width: min(var(--layout-auth), 94vw);
}

.calendar-modal-close {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--forest-dark);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.calendar-modal-close:hover {
    background: var(--border);
}

.group-list-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    color: var(--warm-text);
}

.create-task-panel {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}

.create-task-panel .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.create-task-panel .calendar-form-pair-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    align-items: end;
}

.create-task-panel .calendar-form-grid-hint {
    grid-column: 1 / -1;
    margin: -0.2rem 0 0.05rem;
    line-height: 1.35;
}

.create-task-panel .calendar-form-private-row {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.calendar-hint-err {
    background: #fef2f2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
    font-size: 0.92rem;
}

.quick-repeat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
    align-items: center;
}

.quick-repeat button[type="button"] {
    padding: 0.3rem 0.65rem;
    font-size: 0.76rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    color: var(--forest-mid);
    font-weight: 600;
}

.quick-repeat button[type="button"]:hover {
    background: var(--forest-mid);
    color: #fff;
    border-color: var(--forest-mid);
}

.history-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.history-section h2 {
    font-size: 1.5rem;
    color: var(--forest-dark);
    margin-bottom: 1.5rem;
}

.history-list {
    display: grid;
    gap: 0.9rem;
}

.history-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    border-left: 6px solid var(--group-color, #dfe7e2);
}

.history-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 0.45rem;
}

.history-title {
    margin: 0;
    font-size: 1rem;
    color: var(--forest-dark);
    font-weight: 700;
}

.history-done-at {
    font-size: 0.82rem;
    color: var(--warm-muted);
    white-space: nowrap;
}

.history-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
}

.history-badge {
    font-size: 0.75rem;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    background: #f1f5f3;
    color: var(--forest-mid);
}

.history-empty {
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    color: var(--warm-muted);
    text-align: center;
}

/* Account */
.account-wrap {
    max-width: var(--layout-account);
    width: 95%;
    text-align: left;
    margin: 0 auto;
}

.setting-card {
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fcfefb;
}

.setting-card h2 {
    font-size: 1.1rem;
    margin: 0 0 0.35rem;
    color: var(--forest-dark);
}

.setting-card p.lead {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--warm-muted);
}

.hint {
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

.hint.ok {
    background: #eefdf5;
    color: var(--forest-mid);
    border: 1px solid #cceada;
}

.hint.info {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a5f;
}

.hint.err {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.current-email {
    font-size: 0.85rem;
    color: var(--warm-muted);
    margin-bottom: 1rem;
}

hr.sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.25rem 0 1rem;
}

@media (max-width: 768px) {
    .create-task-panel .form-grid {
        grid-template-columns: 1fr;
    }

    .create-task-panel .calendar-form-pair-row {
        grid-template-columns: 1fr;
    }

    .page-hero__actions {
        justify-content: flex-start;
        width: 100%;
    }

    .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .calendar-toolbar-controls {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem 0.65rem;
    }
    .calendar-dropdown-wrap {
        min-width: 0;
    }
    .calendar-toolbar-dropdown-btn {
        width: 100%;
        justify-content: space-between;
    }
    .legend {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 400px) {
    .calendar-toolbar-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .calendar-actions-row {
        flex-direction: column;
        align-items: stretch;
    }
    .calendar-actions-row .btn {
        width: 100%;
        justify-content: center;
    }

    .pet-edit-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Cats Page */
.cats-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.cats-intro h1 {
    margin-bottom: 0.35rem;
}

.cats-intro p {
    margin: 0;
    max-width: 42rem;
}

.cats-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.btn-cats-primary {
    width: auto;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
}

.cats-modal-lead {
    font-size: 0.88rem;
    color: var(--warm-muted);
    margin: 0 0 1rem;
    line-height: 1.45;
}

.cats-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
    align-items: center;
}

.cats-modal-actions .btn {
    width: auto;
    min-width: 8rem;
}

.cats-modal-actions .btn-outline {
    min-width: 6rem;
}

.event-log-empty,
.cats-empty-msg,
.pets-empty-msg {
    color: var(--warm-muted);
    font-size: 0.92rem;
    margin: 0;
}

.cat-card-emoji {
    font-size: 1.5rem;
}

@media (max-width: 560px) {
    .cats-page-header {
        flex-direction: column;
        align-items: stretch;
    }
    .cats-header-actions .btn-cats-primary {
        width: 100%;
    }
    .cats-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cats-modal-actions .btn,
    .cats-modal-actions .btn-outline {
        width: 100%;
        min-width: 0;
    }

    .plants-page .page-actions__btns {
        width: 100%;
        justify-content: stretch;
    }

    .plants-page .page-actions__btns .plants-spaces-dropdown {
        flex: 1;
        min-width: 0;
    }

    .plants-page .page-actions__btns > .btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .plants-spaces-summary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .plants-spaces-panel {
        left: 0;
        right: 0;
        max-width: none;
        width: 100%;
    }
}

.cats-add-card,
.pets-add-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(15, 60, 40, 0.06);
}

.cats-add-row,
.pets-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.cats-add-field,
.pets-add-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 12rem;
}

.pets-add-field--full {
    flex: 1 1 100%;
}

.pet-card-schedule-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
    width: 100%;
}

.pet-card-field input[type="number"],
.pet-card-field input[list] {
    width: 100%;
    max-width: 12rem;
}

.pet-card-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--forest-mid);
}

.cats-add-field--emoji,
.pets-add-field--emoji {
    flex: 0 1 6rem;
}

.cats-add-field--emoji .cat-emoji-input,
.pets-add-field--emoji .cat-emoji-input {
    font-size: 1.35rem;
    text-align: center;
}

.pets-add-form .pets-add-emoji-row {
    display: flex;
    align-items: center;
    margin-top: 0.15rem;
}

.pets-add-form .pets-add-emoji-trigger.cat-card-emoji-trigger {
    color: var(--forest-dark);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.pets-add-form .pets-add-emoji-trigger.cat-card-emoji-trigger:hover {
    background: rgba(27, 67, 50, 0.08);
    border-color: var(--border-strong);
}

.cats-add-field--submit,
.pets-add-field--submit {
    flex: 0 0 auto;
}

.cats-add-submit-label,
.pets-add-submit-label {
    display: block;
    height: 1.25rem;
    font-size: 0.75rem;
}

.cats-add-field label,
.pets-add-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--forest-mid);
}

.cat-emoji-preset-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
}

.cat-emoji-preset-bar--light {
    border-top-color: rgba(45, 106, 79, 0.18);
}

.cat-emoji-preset {
    border: 1px solid var(--border);
    background: #fafdfb;
    border-radius: 0.4rem;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1.3;
    transition: background 0.15s ease, transform 0.12s ease;
}

.cat-emoji-preset:hover {
    background: #eef7f2;
    transform: scale(1.06);
}

.cat-emoji-preset.is-selected {
    background: #dff3e8;
    border-color: var(--forest-mid);
    box-shadow: inset 0 0 0 1px var(--forest-mid);
}

.cat-emoji-preset:focus-visible {
    outline: 2px solid var(--forest-mid);
    outline-offset: 2px;
}

.cat-emoji-preset-bar--on-dark {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
}

.cat-emoji-preset-bar--on-dark .cat-emoji-preset {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.cat-emoji-preset-bar--on-dark .cat-emoji-preset:hover {
    background: rgba(255, 255, 255, 0.22);
}

.cat-emoji-preset-bar--in-dialog {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.cat-emoji-picker-custom-wrap {
    margin-top: 1rem;
    margin-bottom: 0;
}

.cat-emoji-picker-custom-wrap label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--warm-muted);
}

.cat-emoji-picker-custom-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    border: 2px solid #f1f3f5;
    background: #f8f9fa;
    font-size: 1.1rem;
    font-family: inherit;
}

.cats-feed-emoji {
    margin-right: 0.15rem;
}

.cats-empty-msg--span,
.pets-empty-msg--span {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
}

/* Pet cards: two columns on small+ tablets; single column on narrow phones */
.pets-container,
.cats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
}

@media (min-width: 640px) {
    .pets-container,
    .cats-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cat-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.cat-card-header {
    padding: 1rem 1.25rem 1.15rem;
    background: var(--forest-dark);
    color: #fff;
}

.pet-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pet-card-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.pet-card-summary-emoji {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.pet-card-summary-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.pet-card-summary-name {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-card-summary-meta {
    font-size: 0.78rem;
    opacity: 0.88;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-card-edit-btn {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pet-card-edit-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.pet-card-edit-btn:focus,
.pet-card-edit-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

/* Compact pet cards when shown two-up */
.pets-container .cat-card-header {
    padding: 0.65rem 0.9rem 0.7rem;
}

.pets-container .pet-card-summary-emoji {
    font-size: 1.35rem;
}

.pets-container .pet-card-summary-name {
    font-size: 0.95rem;
}

.pets-container .pet-card-summary-meta {
    font-size: 0.72rem;
}

.pets-container .pet-card-edit-btn {
    width: 2.15rem;
    height: 2.15rem;
}

.pets-container .cat-card-body {
    padding: 0.9rem 1rem 1rem;
}

.pets-container .event-log--preview h3 {
    font-size: 0.92rem;
    margin-bottom: 0.6rem;
}

.pets-container .event-log--preview .muted-note--sm {
    font-size: 0.78rem;
    margin-bottom: 0.65rem;
}

.pets-container .event-item {
    padding: 0.5rem 2.35rem 0.5rem 0.55rem;
    margin-bottom: 0.5rem;
}

.pets-container .event-type {
    font-size: 0.88rem;
}

.pets-container .event-desc {
    font-size: 0.82rem;
}

.pet-edit-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.pet-edit-emoji-field .pet-edit-emoji-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--forest-dark);
    margin-bottom: 0.35rem;
}

.pet-edit-emoji-field .pet-edit-emoji-row {
    margin-bottom: 0.5rem;
}

.pet-edit-dialog .pet-edit-emoji-trigger.cat-card-emoji-trigger {
    color: var(--forest-dark);
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
}

.pet-edit-dialog .pet-edit-emoji-trigger.cat-card-emoji-trigger:hover {
    background: rgba(27, 67, 50, 0.08);
}

.pet-edit-dialog .pet-edit-emoji-presets {
    margin-top: 0.35rem;
}

.pet-edit-dialog-actions {
    margin-top: 0.25rem;
}

.cat-card-edit {
    width: 100%;
    margin: 0;
}

.cat-card-edit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
}

.cat-card-emoji-trigger {
    width: auto;
    min-width: 2.5rem;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    padding: 0.35rem 0.35rem;
    border-radius: 0.35rem;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.cat-card-emoji-trigger:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cat-card-emoji-display {
    display: block;
    line-height: 1.2;
}

.cat-card-name-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.55rem;
    margin: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.cat-card-name-shell:not(.cat-card-name-shell--editing) .cat-card-name-input {
    display: none;
}

.cat-card-name-shell.cat-card-name-shell--editing .cat-card-name-display {
    display: none;
}

.cat-card-name-shell .cat-card-emoji-trigger {
    flex-shrink: 0;
    width: auto;
    min-width: 2.4rem;
    font-size: 1.35rem;
    padding: 0.25rem 0.3rem;
}

.cat-card-name-display {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-card-name-pen {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    margin-left: 0.1rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.cat-card-name-pen:hover {
    background: rgba(255, 255, 255, 0.28);
}

.cat-card-name-pen:focus,
.cat-card-name-pen:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.cat-card-name-pen-icon {
    display: block;
}

.cat-card-name-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0.2rem 0.35rem;
    border-radius: 0.35rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.98);
    color: var(--forest-dark);
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
}

.cat-card-emoji-trigger:focus,
.cat-card-emoji-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.cat-card-name-input:focus {
    outline: none;
    border-color: rgba(27, 67, 50, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.cat-card-body {
    padding: 1.5rem;
}

.event-log {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.event-log h3 {
    font-size: 1rem;
    color: var(--forest-dark);
    margin: 0 0 1rem;
}

.event-item {
    padding: 0.75rem 2.75rem 0.75rem 0.75rem;
    border-radius: 0.5rem;
    background: #f8fbf9;
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
    position: relative;
}

.event-item-meta {
    font-size: 0.75rem;
    color: var(--warm-muted);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
}

.event-type {
    font-weight: 700;
    color: var(--forest-mid);
    margin-bottom: 0.25rem;
}

.event-desc {
    font-size: 0.9rem;
    color: var(--warm-text);
}

.delete-event-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #fca5a5;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
}

.delete-event-btn:hover {
    color: #ef4444;
}

.cats-feed-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    grid-column: 1 / -1;
}

.cats-feed-panel h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.cats-feed-cats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1rem 0;
}

.cats-feed-chip {
    display: block;
    position: relative;
}

.cats-feed-chip-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.cats-feed-chip-body {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid #cfe0d9;
    background: #f8fcfa;
    color: var(--forest-dark);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.cats-feed-chip-emoji {
    font-size: 1.2rem;
    line-height: 1;
}

.cats-feed-chip-name {
    font-size: 0.95rem;
}

.cats-feed-chip-input:not(:checked) + .cats-feed-chip-body {
    background: #f4f5f6;
    color: var(--warm-muted);
    border-color: var(--border);
    opacity: 0.85;
}

.cats-feed-chip-input:checked + .cats-feed-chip-body {
    background: #eefdf5;
    border-color: var(--forest-light);
}

.cats-feed-chip-input:focus-visible + .cats-feed-chip-body {
    outline: 2px solid var(--forest-mid);
    outline-offset: 2px;
}

.cats-recent-note {
    margin: 0 0 1rem;
}

.event-log--preview {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.event-log--preview h3 {
    margin-top: 0;
}

.cats-event-history-section,
.pets-event-history-section {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

.cats-event-history-section .section-title,
.pets-event-history-section .section-title {
    margin-bottom: 1rem;
}

.cats-event-history-toolbar,
.pets-event-history-toolbar {
    margin-bottom: 1.25rem;
}

.cats-event-history-list,
.pets-event-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cats-event-history-empty,
.pets-event-history-empty {
    margin: 0;
}

.cats-history-pagination,
.pets-history-pagination {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.cats-history-pagination-current,
.pets-history-pagination-current {
    font-size: 0.9rem;
    color: var(--warm-muted);
}

.cats-history-pagination-btn,
.pets-history-pagination-btn {
    width: auto;
}

/* --- Plants: watering & manage --- */
.plants-watering-overview {
    margin: 2rem 0;
}

.plants-page .page-hero__main > p:not(.plants-journey-hint) {
    max-width: 42rem;
}

.plants-page .page-hero__main a {
    font-weight: 600;
    color: var(--forest-mid);
}

.plants-journey-hint {
    margin-top: 0.65rem;
    margin-bottom: 0;
    max-width: 44rem;
}

.plants-journey-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: var(--forest-accent);
    color: var(--warm-card);
    font-size: 0.7rem;
    font-weight: 800;
}

.plants-journey-sep {
    padding: 0 0.35rem;
    color: var(--border);
}

.plants-watering-overview--primary {
    margin-top: 0;
}

.plants-watering-hint {
    margin: 0 0 0.85rem;
}

.plants-watering-empty-ok {
    margin: 0;
}

.plants-watering-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.plants-watering-card-actions form {
    margin: 0;
}

.plants-watering-card-edit.btn--narrow {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
}

.plants-watering-ok-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.35rem;
}

.plants-watering-ok-link {
    margin-left: auto;
    font-size: 0.86rem;
    font-weight: 600;
}

.plants-settings-subhead {
    font-size: 1rem !important;
    margin-top: 0.5rem;
}

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

.plants-watering-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--warm-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.plants-watering-card-image {
    max-height: 140px;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: calc(var(--radius) - 0.1rem);
    margin-bottom: 0.75rem;
}

.plants-watering-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.plants-watering-card-body {
    padding: 1rem 1.1rem 1.15rem;
}

.plants-watering-card-body h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--forest-dark);
}

.plants-watering-meta {
    font-size: 0.8rem;
    color: var(--warm-muted);
    margin: 0;
}

.plants-watering-snippet {
    font-size: 0.88rem;
    color: var(--warm-text);
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.plants-watering-ok-list {
    margin: 0;
    padding-left: 1.15rem;
}

.plants-watering-overview--muted .plants-watering-ok-list {
    color: var(--warm-muted);
}

.plants-inline-form {
    display: inline;
}

.plants-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.plants-space-input {
    min-width: 12rem;
    flex: 1;
}

.plants-space-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.plants-space-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}

.plants-manage-section {
    margin: 0;
}

.plants-page .page-actions__btns {
    justify-content: flex-end;
}

.plants-spaces-dropdown {
    position: relative;
}

.plants-spaces-summary {
    list-style: none;
    cursor: pointer;
}

.plants-spaces-summary::-webkit-details-marker {
    display: none;
}

.plants-spaces-summary::marker {
    display: none;
}

.plants-spaces-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 40;
    min-width: min(20rem, calc(100vw - 2rem));
    max-width: 22rem;
    padding: 1rem 1.15rem 1.15rem;
    margin: 0;
    background: var(--warm-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: min(70vh, 26rem);
    overflow-y: auto;
}

.plants-spaces-panel-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.plants-notify-panel .plants-spaces-panel-title {
    margin-bottom: 0.65rem;
}

.plants-notify-panel--combined {
    max-height: min(85vh, 40rem);
    max-width: min(26rem, calc(100vw - 2rem));
    min-width: min(22rem, calc(100vw - 2rem));
}

.plants-notify-panel-section + .plants-notify-panel-section .plants-settings-subhead {
    margin-top: 0.85rem;
}

.plants-notify-panel-divider {
    margin: 0.85rem 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.plants-watering-card-water-form {
    margin-top: 0;
    margin-bottom: 0.65rem;
}

.plants-manage-card .plants-watering-card-water-form .btn {
    width: 100%;
    justify-content: center;
}

.plants-watering-ok-item--plain {
    display: block;
}

.plants-manage-card .plants-watering-card-image {
    width: 132px;
    height: 132px;
    min-height: 132px;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    place-items: center;
}

.plants-manage-card-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 2.8rem;
    line-height: 1;
    color: var(--warm-muted);
}

.plants-manage-next-watering {
    margin: 0 0 0.45rem;
    font-size: 0.88rem;
    color: var(--warm-text);
}

button.plants-watering-card.plants-manage-card {
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: inherit;
    font: inherit;
    color: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: var(--shadow-sm);
    transition:
        border-color 0.15s var(--ease),
        box-shadow 0.15s var(--ease),
        transform 0.12s var(--ease);
}

button.plants-watering-card.plants-manage-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

button.plants-watering-card.plants-manage-card:focus {
    outline: none;
}

button.plants-watering-card.plants-manage-card:focus-visible {
    box-shadow: var(--ring), var(--shadow-sm);
}

.plants-manage-card--due {
    box-shadow: inset 3px 0 0 0 var(--forest-accent), var(--shadow-sm);
}

.plants-manage-card-hint {
    margin: 0.35rem 0 0;
}

.plants-notify-followup {
    margin-top: 0.85rem;
    margin-bottom: 0;
}

.plants-my-plants-wrap {
    margin-bottom: 2rem;
}

.plants-my-plants-wrap > .section-title:first-child {
    margin-bottom: 1rem;
}

.plants-my-plants-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.plants-my-plants-panel .plants-manage-section:not(:last-child) {
    margin-bottom: 1.15rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--border);
}

.plants-my-plants-subheading {
    font-size: 1.05rem;
    margin-top: 0;
}

.plants-my-plants-empty {
    margin-top: 0;
}

.plants-refresh-water-wrap {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.plants-refresh-water-status {
    flex: 1 1 12rem;
}

.plants-seasonal-banner {
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.plants-seasonal-banner-title {
    margin: 0 0 0.4rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--forest-dark);
}

.plants-seasonal-banner-lead {
    margin: 0 0 0.75rem;
}

.plants-seasonal-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
}

.plants-autocomplete {
    position: relative;
    max-width: 36rem;
}

.plants-suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.2rem);
    z-index: 50;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    max-height: 16rem;
    overflow-y: auto;
    background: var(--warm-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.plants-suggest-option {
    margin: 0;
    padding: 0;
}

.plants-suggest-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--warm-text);
    font: inherit;
    cursor: pointer;
    line-height: 1.35;
}

.plants-suggest-option-btn:hover,
.plants-suggest-option-btn:focus {
    background: var(--surface-muted);
    outline: none;
}

.plants-suggest-option-label {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.plants-suggest-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--forest-mid);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.1rem 0.4rem;
}

.plants-prefetch-preview {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem;
}

.plants-prefetch-preview img {
    max-height: 140px;
    max-width: min(100%, 220px);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    object-fit: cover;
}

.plants-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.plants-card-cell {
    min-width: 0;
}

.plants-plant-card {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    width: 100%;
    margin: 0;
    padding: 1rem 1.1rem;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--warm-card);
    cursor: pointer;
    font: inherit;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition:
        border-color 0.15s var(--ease),
        box-shadow 0.15s var(--ease),
        transform 0.12s var(--ease);
}

.plants-plant-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.plants-plant-card:focus {
    outline: none;
}

.plants-plant-card:focus-visible {
    box-shadow: var(--ring), var(--shadow-sm);
}

.plants-plant-card-media {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-muted);
    display: grid;
    place-items: center;
}

.plants-plant-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plants-plant-card-placeholder {
    font-size: 2rem;
    line-height: 1;
}

.plants-plant-card-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.plants-plant-card-name {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--forest-dark);
    line-height: 1.25;
}

.plants-plant-card-meta {
    font-size: 0.84rem;
    color: var(--warm-muted);
    line-height: 1.35;
}

.plants-plant-card-snippet {
    font-size: 0.82rem;
    color: var(--warm-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plants-plant-card-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.plants-plant-card-due-badge {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    background: rgba(199, 138, 43, 0.22);
    color: var(--forest-dark);
}

.plants-plant-card--due {
    box-shadow: inset 3px 0 0 0 var(--forest-accent);
}

.plants-plant-card-hint {
    margin-top: 0.15rem;
}

.plants-dialog-section {
    margin: 0;
    padding: 1rem 0 0;
    border-top: 1px solid var(--border);
}

.plants-dialog-section--water {
    border-top: none;
    padding-top: 0;
}

.plants-dialog-section-title {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--forest-mid);
}

.plants-dialog-section-lead {
    margin: 0 0 0.65rem;
}

.plants-dialog-water-form {
    margin: 0;
}

.plants-dialog-water-btn {
    width: 100%;
    max-width: 16rem;
}

.plants-dialog-section--danger {
    margin-top: 0.5rem;
    padding-bottom: 0.15rem;
    border-top: 1px dashed var(--border);
}

.plants-dialog-delete-form {
    display: block;
    margin: 0;
}

.plants-dialog-delete-btn {
    font-size: 0.88rem;
}

.plants-edit-dialog .plants-detail-log {
    margin-top: 1rem;
}

.plants-assign-remind--modal {
    margin-top: 0;
    padding-top: 0;
}

.plants-assign-section {
    margin-bottom: 1.25rem;
}

.plants-assign-form {
    margin-top: 0.5rem;
}

.plants-assign-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.plants-assign-space-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.plants-assign-space-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.plants-assign-space-name {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--forest-mid);
}

.plants-proxy-form select {
    max-width: 22rem;
}

.plants-assign-meta {
    margin-bottom: 1.25rem;
}

.plants-assign-remind {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.event-item--history .event-item-meta {
    margin-bottom: 0.35rem;
}

.event-item-cat-line {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--forest-mid);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.event-item-cat-emoji {
    font-size: 1.1rem;
    line-height: 1;
}

.cats-filter-apply-btn,
.pets-filter-apply-btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

.cats-event-history-section a.calendar-dropdown-clear-btn,
.pets-event-history-section a.calendar-dropdown-clear-btn {
    display: block;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
}

@media (min-width: 993px) {
    .app-container {
        grid-template-columns: 280px 1fr;
    }

    .mobile-top-bar {
        display: none;
    }

    .sidebar {
        position: sticky;
        left: auto;
        width: auto;
        transform: none;
        transition: none;
    }

    .sidebar.sidebar-open {
        transform: none;
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content {
        padding: clamp(1.25rem, 3vw, 2.25rem);
    }
}

/* Login / signup (guest shell matches main app) */
.auth-page {
    max-width: var(--layout-auth);
    margin: 2.5rem auto 4rem;
    padding: 0 1rem 2rem;
}

.auth-card {
    background: var(--warm-card);
    border: 1px solid rgba(14, 74, 57, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem 2.25rem 2.35rem;
}

.auth-heading {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--forest-dark);
    letter-spacing: -0.02em;
}

.auth-lead {
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    color: var(--warm-muted);
    line-height: 1.5;
}

.auth-card .btn {
    margin-top: 0.25rem;
}

.auth-footer-note {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--warm-muted);
    text-align: center;
}

.auth-footer-note a {
    color: var(--forest-mid);
    font-weight: 700;
    text-decoration: none;
}

.auth-footer-note a:hover {
    color: var(--forest-accent);
    text-decoration: underline;
}

/* --- Shared utilities --- */
.is-hidden {
    display: none !important;
}

.mt-025 {
    margin-top: 0.25rem;
}

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

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

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

.text-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--forest-mid);
    text-decoration: none;
    text-underline-offset: 0.18em;
    transition: color 0.15s var(--ease);
}

.text-link:hover {
    color: var(--forest-light);
    text-decoration: underline;
}

.btn--inline {
    width: auto;
}

.btn--compact {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    width: auto;
}

.btn--cta {
    width: auto;
    padding: 0.75rem 1.5rem;
}

.btn--cta-spaced {
    width: auto;
    padding: 0.75rem 1.5rem;
    margin-right: 0.5rem;
}

.btn--narrow {
    width: auto;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

.btn--account {
    width: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.btn--danger-solid {
    background-color: #dc2626;
    border: 3px solid #b91c1c;
    color: #fff;
}

.btn--stop-recurring {
    width: auto;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-color: #fca5a5;
}

.btn--task-done {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    width: auto;
    background-color: var(--forest-accent);
}

.label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.label-row--tight {
    gap: 0.75rem;
}

.label-row input[type="checkbox"],
.label-row input[type="radio"] {
    width: auto;
}

.checkbox-lg {
    width: 1.25rem;
    height: 1.25rem;
}

.flex-row {
    display: flex;
    gap: 1rem;
}

.flex-row--wrap {
    flex-wrap: wrap;
    justify-content: center;
}

.flex-row--center {
    justify-content: center;
}

.flex-row--tight {
    gap: 0.5rem;
}

.flex-row--widgets {
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-col-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.manage-widgets-sortable {
    gap: 0.35rem;
}

.manage-widgets-order-hint {
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.widget-manage-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.35rem;
    border-radius: 0.35rem;
    border: 1px solid transparent;
    cursor: grab;
}

.widget-manage-row:hover {
    border-color: var(--border);
    background: rgba(0, 0, 0, 0.02);
}

.widget-manage-row.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.widget-manage-row .widget-toggle-label {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

.widget-manage-drag-handle {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    color: var(--warm-muted);
    font-size: 0.95rem;
    line-height: 1;
    user-select: none;
    cursor: grab;
}

.stack-gap-sm {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stack-gap-xs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.muted-note {
    font-size: 0.875rem;
    color: var(--warm-muted);
    margin: 0 0 1rem;
}

.muted-note--sm {
    font-size: 0.8125rem;
    color: var(--warm-muted);
}

.muted-note--xs {
    font-size: 0.75rem;
    color: var(--warm-muted);
}

.lead-tight {
    margin-top: -0.25rem;
}

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid rgba(207, 229, 218, 0.85);
}

.page-actions h1 {
    letter-spacing: -0.03em;
}

.page-actions__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.container--wide {
    max-width: var(--layout-wide);
    text-align: left;
}

.container--stats {
    max-width: var(--layout-stats);
    text-align: left;
}

.container--landing {
    max-width: var(--layout-landing);
    margin: 4rem auto;
    text-align: center;
}

.section-title {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--forest-dark);
    margin-bottom: 1rem;
}

.section-title--ruled {
    border-bottom: 2px solid var(--forest-light);
    padding-bottom: 0.5rem;
}

.card-title-flush {
    margin-top: 0;
}

.recurring-purpose {
    font-weight: 700;
}

.recurring-meta {
    font-size: 0.8rem;
    color: var(--warm-muted);
}

.expense-shared-label {
    color: var(--warm-muted);
}

.empty-padded {
    color: var(--warm-muted);
    text-align: center;
    padding: 2rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.form-group--ruled {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.balance-dialog-copy {
    margin-bottom: 1.5rem;
}

.balance-settle-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.balance-settle-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.balance-dialog-lead {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--warm-text);
}

.balance-settle-list--instructions li {
    display: block;
    font-weight: 600;
    color: var(--forest-dark);
    line-height: 1.5;
}

.balance-dialog-even {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    background: #f4faf7;
    border-radius: 0.45rem;
    border: 1px solid rgba(45, 106, 79, 0.15);
    font-size: 0.92rem;
    color: var(--forest-mid);
}

.ledger-balance--pos {
    color: #059669;
    font-weight: 700;
}

.ledger-balance--neg {
    color: #dc2626;
    font-weight: 700;
}

.ledger-balance--zero {
    color: var(--forest-dark);
    font-weight: 700;
}

.ledger-balance--zero-muted {
    color: var(--warm-muted);
    font-weight: 700;
}

.swatch--assignee {
    background-color: var(--swatch-bg, transparent);
}

.fc-group-dot--filled {
    background-color: var(--dot-bg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.group-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--group-dot, #ccc);
    flex-shrink: 0;
}

.input--grams {
    width: 80px;
}

.input--color-lg {
    width: 100%;
    height: 52px;
    padding: 0.2rem;
    cursor: pointer;
}

.input--color-md {
    width: 100%;
    height: 44px;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
}

.textarea--news {
    width: 100%;
    height: 80px;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

/* Text-style delete (e.g. news rows in dashboard dialog) */
.inline-delete-btn {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
}

.widget--draggable[draggable="true"] {
    cursor: grab;
}

.widget--draggable[draggable="true"]:active {
    cursor: grabbing;
}

.widget.is-dragging {
    opacity: 0.5;
}

/* --- Dashboard --- */

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.9rem 1rem;
    margin-bottom: 1.5rem;
}

.page-hero__main h1 {
    margin: 0;
}

.page-hero__main p {
    margin: 0.35rem 0 0;
    color: var(--warm-muted);
}

.page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.page-hero--compact {
    margin-bottom: 1rem;
}

.text-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid rgba(207, 229, 218, 0.85);
}

.dashboard-title h1 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--forest-dark);
}

.dashboard-title p {
    margin: 0.35rem 0 0;
    color: var(--warm-muted);
    font-size: 0.96rem;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dashboard-news-form {
    margin-bottom: 2rem;
}

.widget {
    background: var(--warm-card);
    border: 1px solid rgba(14, 74, 57, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.45rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.widget:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(14, 74, 57, 0.14);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.15rem;
    border-bottom: 1px solid rgba(207, 229, 218, 0.85);
    padding-bottom: 0.85rem;
}

.widget-header h3 {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--forest-dark);
}

.cat-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cat-feed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    background: linear-gradient(135deg, #f9fdfb 0%, #f1f7f3 100%);
    border: 1px solid rgba(45, 106, 79, 0.12);
    border-radius: 0.55rem;
    box-shadow: 0 1px 2px rgba(45, 106, 79, 0.06);
}

.cat-feed-row__identity {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}

.cat-feed-row__label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    margin: 0;
    min-width: 0;
}

.cat-feed-row__cb {
    width: 1rem;
    height: 1rem;
    accent-color: var(--forest-accent);
    flex-shrink: 0;
}

.cat-feed-row__emoji {
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}

.cat-feed-row__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--forest-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-feed-row__status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    flex: 0 1 auto;
    font-size: 0.8rem;
    text-align: right;
}

.cat-feed-row__grams {
    font-weight: 600;
    color: var(--forest-mid);
    font-variant-numeric: tabular-nums;
}

.cat-feed-row__muted {
    color: var(--warm-muted);
}

.fed-badge {
    background: #eefdf5;
    color: var(--forest-accent);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.dashboard-news-list {
    display: grid;
    gap: 0.8rem;
}

.dashboard-news-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-news-item:last-child {
    border-bottom: none;
}

.dashboard-news-item p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--warm-text);
}

.dashboard-news-meta {
    font-size: 0.75rem;
    color: var(--warm-muted);
    margin-top: 0.5rem;
}

.dashboard-happy-cats-banner {
    width: 100%;
    margin: 0 0 1.5rem;
    overflow: hidden;
}

.dashboard-happy-cats-banner--bleed {
    position: relative;
    left: calc(-1 * clamp(1.25rem, 3vw, 2.25rem));
    width: calc(100% + (2 * clamp(1.25rem, 3vw, 2.25rem)));
    margin: calc(-1 * clamp(1.25rem, 3vw, 2.25rem)) 0 1.25rem;
}

.dashboard-happy-cats-banner__image {
    display: block;
    width: 100%;
    height: clamp(160px, 25vw, 280px);
    object-fit: cover;
    border-radius: 0;
}

.task-mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #fafafa;
    border-radius: 0.5rem;
    border-left: 4px solid var(--task-border, transparent);
    padding-left: 0.75rem;
}

.task-mini-item.done {
    opacity: 0.6;
}

.task-mini-item.done .task-mini-title {
    text-decoration: line-through;
    text-decoration-thickness: 0.14em;
}

.task-mini-title {
    font-weight: 600;
}

.task-due-line {
    font-size: 0.75rem;
    color: var(--forest-mid);
    margin-top: 0.25rem;
}

.task-done-label {
    color: var(--forest-accent);
    font-weight: bold;
}

.plants-widget-due-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.plants-widget-due-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: var(--surface-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.plants-widget-due-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.plants-widget-water-form {
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.plants-widget-due-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.plants-widget-due-space {
    display: block;
}

.plants-widget-more {
    margin: 0.35rem 0 0;
}

.plants-widget-footer-link {
    margin-top: 0.65rem;
    margin-bottom: 0;
}

.departure-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.departure-item:last-child {
    border-bottom: none;
}

.connection-summary {
    line-height: 1.45;
}

.connection-summary__line {
    font-weight: 800;
    color: var(--forest-strong);
}

.connection-summary__from {
    font-weight: 600;
    color: var(--text-main);
}

.connection-summary__time {
    font-weight: 700;
    color: var(--forest-mid);
}

.connection-summary__meta {
    font-weight: 500;
    color: var(--warm-muted);
}

.fin-balance-card {
    padding: 1rem;
    text-align: center;
    background: #fcfcfc;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.fin-balance-label {
    font-size: 0.9rem;
    color: var(--warm-muted);
    margin-bottom: 0.5rem;
}

.fin-balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.fin-balance-hint {
    font-size: 0.8rem;
    color: var(--warm-muted);
    margin-top: 0.5rem;
}

.fin-ledger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.fin-ledger-name {
    font-weight: 600;
}

.feed-form {
    margin-top: 1rem;
}

.feed-form--compact {
    margin-top: 0;
}

.feed-form--compact .flex-row--tight {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 0.75rem;
}

.feed-form__actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.feed-form__actions .input--grams {
    min-width: 0;
    flex: 0 1 7rem;
}

.feed-form__actions .btn--grow {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

.btn--grow {
    flex: 1;
}

.weather-info,
.transport-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.transport-info {
    gap: 0.5rem;
}

.transport-widget-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.transport-departure-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-width: min(100%, 12rem);
}

.transport-departure-label-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--forest-mid);
}

.transport-departure-field .transport-departure-at-input {
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid var(--border);
    background: #fafcfb;
    color: var(--forest-dark);
}

.compliment-widget-body {
    padding: 0.15rem 0 0.35rem;
}

.compliment-widget-text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--forest-dark);
    font-style: italic;
}

.compliment-widget-text--muted {
    font-style: normal;
    color: var(--warm-muted);
    font-size: 0.95rem;
}

.weather-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.weather-row:last-of-type {
    margin-bottom: 0;
}

.weather-rain-alert {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #eef2ff;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--forest-accent);
    font-weight: 600;
}

.news-manage-list h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--forest-dark);
}

.news-manage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.news-manage-body {
    font-size: 0.9rem;
}

.news-manage-time {
    font-size: 0.75rem;
    color: var(--warm-muted);
}

.widget-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.widget-toggle-label span {
    font-size: 1.05rem;
}

.widget-modal-lead {
    font-size: 0.9rem;
    color: var(--warm-muted);
    margin-bottom: 1.5rem;
}

/* --- Financials page --- */
.financials-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

.ledger-card,
.history-card,
.recurring-card {
    background: var(--warm-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(14, 74, 57, 0.1);
    padding: 1.45rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(207, 229, 218, 0.65);
}

.ledger-item:last-child {
    border-bottom: none;
}

.balance-pos {
    color: #059669;
    font-weight: 700;
}

.balance-neg {
    color: #dc2626;
    font-weight: 700;
}

.expense-item--clickable {
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.expense-item--clickable:hover {
    box-shadow: 0 4px 16px rgba(15, 60, 40, 0.1);
    border-color: rgba(45, 106, 79, 0.25) !important;
    transform: translateY(-1px);
}

.expense-item--clickable:focus-visible {
    outline: 2px solid var(--forest-mid, #3d7a52);
    outline-offset: 2px;
}

.expense-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.5rem;
}

.history-card--expenses {
    padding-bottom: 1.25rem;
}

.expense-card {
    position: relative;
    margin: 0;
    padding: 0.9rem 1rem 0.75rem 1.1rem;
    background: linear-gradient(145deg, #fdfffe 0%, #f4faf7 100%);
    border: 1px solid rgba(45, 106, 79, 0.12);
    border-radius: 0.65rem;
    box-shadow: 0 1px 2px rgba(15, 60, 40, 0.04);
    border-left: 3px solid var(--forest-mid, #3d7a52);
}

.expense-card__main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1.25rem;
    flex-wrap: wrap;
}

.expense-card__lead {
    min-width: 0;
    flex: 1 1 10rem;
}

.expense-card__date {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warm-muted);
    margin: 0 0 0.2rem;
}

.expense-card__purpose {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--forest-dark);
    word-break: break-word;
}

.expense-card__amount-wrap {
    flex-shrink: 0;
    text-align: right;
}

.expense-card__amount {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--forest-dark);
    padding: 0.35rem 0.7rem;
    background: rgba(64, 145, 108, 0.12);
    border-radius: 2rem;
    line-height: 1.2;
}

.expense-card__currency {
    font-size: 0.72em;
    font-weight: 700;
    color: var(--forest-mid);
    margin-left: 0.15rem;
}

.expense-card__perspective {
    margin: 0.5rem 0 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--forest-mid);
    background: rgba(64, 145, 108, 0.08);
    border-radius: 0.35rem;
    width: fit-content;
    max-width: 100%;
}

.expense-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.35rem;
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(45, 106, 79, 0.15);
    font-size: 0.82rem;
    color: var(--warm-text);
    line-height: 1.45;
}

.expense-card__paid strong {
    color: var(--forest-dark);
    font-weight: 600;
}

.expense-card__icon {
    margin-right: 0.15rem;
    opacity: 0.85;
}

.expense-card__dot {
    color: var(--warm-muted);
    user-select: none;
}

.expense-card__shared {
    color: var(--warm-muted);
}

.expense-card__shared-prefix {
    font-weight: 600;
    color: var(--warm-text);
    margin-right: 0.35rem;
}

.expense-card__shared-prefix::after {
    content: ":";
}

.expense-history-empty {
    text-align: center;
    padding: 2rem 1.25rem;
    margin-top: 0.5rem;
    background: linear-gradient(180deg, #f9fdfb 0%, #f3f8f5 100%);
    border: 1px dashed rgba(45, 106, 79, 0.2);
    border-radius: 0.65rem;
    color: var(--warm-text);
}

.expense-history-empty__icon {
    display: block;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.85;
}

.expense-history-empty p {
    margin: 0.25rem 0 0;
}

.expense-history-empty__hint {
    font-size: 0.88rem;
    color: var(--warm-muted);
    margin-top: 0.35rem !important;
}

.expense-edit-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.expense-delete-btn {
    width: 100%;
}

.ledger-you-summary {
    margin-bottom: 1rem;
}

.recurring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fbf9;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .widgets-container.widgets-cols-2 {
        grid-template-columns: 1fr;
    }

    .financials-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Calendar page --- */
.calendar-intro-lead {
    color: var(--warm-muted);
    margin-bottom: 1rem;
}

.calendar-form-textarea {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #f1f3f5;
    border-radius: 0.75rem;
    font-size: 1rem;
}

.calendar-form-select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #fff;
}

.calendar-form-input-tight {
    width: 100%;
    max-width: 200px;
    padding: 0.6rem;
}

.group-list-block {
    margin-bottom: 1rem;
}

.history-desc {
    margin: 0;
    color: var(--warm-text);
    font-size: 0.9rem;
}

.undated-loading,
.undated-empty {
    font-size: 0.85rem;
    color: var(--warm-muted);
}

.autocomplete-new-tag {
    font-size: 0.75rem;
}

/* --- Grocery standalone pages --- */
.page-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0.3rem;
    margin-bottom: 2rem;
    background: rgba(14, 74, 57, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.page-tab {
    padding: 0.55rem 1.2rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--warm-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-bottom: none;
    margin-bottom: 0;
    transition: color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.page-tab.active {
    color: var(--forest-dark);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.page-tab:hover:not(.active) {
    color: var(--forest-dark);
    background: rgba(255, 255, 255, 0.55);
}

.grocery-repeat {
    margin-bottom: 1.75rem;
    padding: 1.1rem 1.25rem 1.25rem;
    background: linear-gradient(135deg, #f9fdfb 0%, #f1f7f3 100%);
    border: 1px solid rgba(45, 106, 79, 0.15);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(15, 60, 40, 0.06);
}

.grocery-repeat__head {
    margin-bottom: 0.75rem;
}

.grocery-repeat__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--forest-dark);
}

.grocery-repeat__hint {
    margin: 0.25rem 0 0;
}

.grocery-repeat__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.grocery-repeat-form {
    margin: 0;
}

.grocery-repeat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--forest-dark);
    background: #fff;
    border: 1px solid rgba(45, 106, 79, 0.25);
    border-radius: 2rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    max-width: 100%;
}

.grocery-repeat-chip:hover {
    background: #eef7f2;
    border-color: var(--forest-accent);
    transform: translateY(-1px);
}

.grocery-repeat-chip:focus-visible {
    outline: 2px solid var(--forest-mid);
    outline-offset: 2px;
}

.grocery-repeat-chip__plus {
    color: var(--forest-accent);
    font-weight: 800;
    font-size: 1.05em;
}

.grocery-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.grocery-toolbar .page-tabs {
    margin-bottom: 0;
}

.grocery-toolbar .grocery-add-details {
    margin: 0;
    flex-shrink: 0;
}

.grocery-toolbar .grocery-add-details[open] .grocery-add-details__body {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 6;
    margin-top: 0;
    box-shadow: var(--shadow-md);
}

/* Reserve space when add form is open so “Buy again” / list don’t sit underneath */
.grocery-page:has(.grocery-toolbar .grocery-add-details[open]) .grocery-toolbar + .grocery-repeat {
    margin-top: 13rem;
}

.grocery-page:has(.grocery-toolbar .grocery-add-details[open]) .grocery-toolbar + .grocery-list-section {
    margin-top: 13rem;
}

.grocery-add-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    cursor: pointer;
}

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

.grocery-add-details__body {
    margin-top: 1rem;
    padding-top: 0;
}

.grocery-list__head {
    margin-bottom: 0.75rem;
}

.grocery-list__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--forest-dark);
}

.grocery-layout {
    display: block;
}

.grocery-card {
    background: var(--warm-card);
    padding: 1.45rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(14, 74, 57, 0.1);
    box-shadow: var(--shadow-sm);
}

.grocery-page > .grocery-card + .grocery-card {
    margin-top: 1.75rem;
}

.grocery-card--list {
    background: #fcfdfb;
    border-color: rgba(14, 74, 57, 0.08);
    box-shadow: none;
    padding: 1rem 1rem 0.55rem;
}

.grocery-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.8rem 0.2rem 0.8rem 0.35rem;
    border-bottom: 1px solid rgba(14, 74, 57, 0.1);
    gap: 0.8rem;
    transition: background 0.15s, opacity 0.15s;
    cursor: pointer;
    border-radius: 0.7rem;
    position: relative;
}

.grocery-item-icon {
    width: 1.85rem;
    height: 1.85rem;
    flex: 0 0 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

.grocery-item:last-child {
    border-bottom: none;
}

.grocery-item:hover {
    background: rgba(45, 106, 79, 0.06);
}

.grocery-item[data-purchasing="1"] {
    opacity: 0.55;
}

.grocery-item::after {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    border: 2px solid rgba(45, 106, 79, 0.22);
    color: transparent;
    font-size: 1rem;
    font-weight: 700;
    margin-left: 0.55rem;
    flex: 0 0 auto;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.grocery-item:hover::after {
    border-color: rgba(45, 106, 79, 0.65);
    color: var(--forest-accent);
    background: #f7fbf9;
}

.grocery-item-main {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 1.02rem;
    color: var(--warm-text);
    font-weight: 600;
    line-height: 1.3;
}

.item-meta {
    font-size: 0.78rem;
    color: var(--warm-muted);
    margin-top: 0.15rem;
}

.tick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    color: transparent;
    font-size: 1rem;
}

.tick-btn:hover {
    border-color: var(--forest-accent);
    background: #eefdf5;
    color: var(--forest-accent);
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
    display: none;
}

.autocomplete-dropdown.is-open {
    display: block;
}

.autocomplete-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--warm-text);
    transition: background 0.1s;
}

.autocomplete-option:hover,
.autocomplete-option.selected {
    background: #f1f8f5;
    color: var(--forest-mid);
}

.autocomplete-option-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    opacity: 0.75;
}

.autocomplete-option.new-item {
    color: var(--forest-accent);
    font-style: italic;
}

.grocery-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--warm-muted);
}

.grocery-empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.35;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-rank {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--warm-muted);
    width: 1.5rem;
    text-align: right;
    flex-shrink: 0;
}

.stat-name {
    flex: 1;
    font-weight: 500;
    color: var(--warm-text);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.stat-name-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.grocery-stats-log-title {
    margin: 0 0 0.9rem;
    font-size: 1rem;
    color: var(--forest-dark);
}

.grocery-purchase-log {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.grocery-purchase-log-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.58rem 0;
    border-bottom: 1px solid var(--border);
}

.grocery-purchase-log-row:last-child {
    border-bottom: none;
}

.grocery-purchase-log-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--warm-text);
}

.grocery-purchase-log-emoji {
    line-height: 1;
    font-size: 1.05rem;
}

.grocery-purchase-log-meta {
    font-size: 0.84rem;
    color: var(--warm-muted);
    white-space: nowrap;
}

.stat-bar-wrap {
    flex: 2;
    background: #f1f3f5;
    border-radius: 9999px;
    height: 8px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    width: var(--stat-pct, 0%);
    background: var(--forest-accent);
    border-radius: 9999px;
    transition: width 0.6s ease;
}

.stat-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--forest-mid);
    min-width: 2.5rem;
    text-align: right;
    flex-shrink: 0;
}

.item-notes {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--warm-muted);
    line-height: 1.35;
}

.grocery-notes-form {
    margin-top: 0.25rem;
}

.grocery-notes-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    cursor: text;
    border-radius: 0.6rem;
    font-size: 0.88rem;
    padding: 0.42rem 0.55rem;
    border-color: rgba(14, 74, 57, 0.16);
    background: rgba(255, 255, 255, 0.84);
}

.grocery-notes-input:focus {
    background: #fff;
}

/* --- Landing (index) --- */
.landing-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    margin-bottom: 2rem;
}

.landing-badge svg {
    width: 14px;
    height: 14px;
}

.landing-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--forest-dark);
}

.landing-lead {
    margin-bottom: 2rem;
}

.landing-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Error page --- */
.error-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

/* --- Account --- */
.account-heading {
    text-align: center;
}

.account-lead {
    text-align: center;
    margin-bottom: 2rem;
}

.push-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.push-status {
    margin-bottom: 1rem;
}

.setting-card--danger {
    margin-top: 2rem;
    border: 2px solid #fca5a5;
}

.banner-preview-wrap {
    position: relative;
    width: min(100%, var(--layout-modal));
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.banner-preview-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
}

.banner-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.9rem;
    height: 1.9rem;
    border: none;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.95);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.banner-remove-btn:hover {
    background: #b91c1c;
}

/* --- Community --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.community-page .page-hero__main {
    text-align: left;
}

.community-community-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.community-switch-select {
    font: inherit;
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid var(--border);
    background: #fafcfb;
    color: var(--forest-dark);
}

.community-dashboard-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.community-card {
    background: var(--warm-card);
    border: 1px solid rgba(14, 74, 57, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.community-card__title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--forest-dark);
}

.community-plants-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.community-plants-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    background: var(--surface-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.community-plants-row-media img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.community-plants-row-placeholder {
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    background: var(--warm-card);
    border-radius: var(--radius-sm);
    font-size: 1.35rem;
}

.community-plants-row-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.community-plants-row-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: stretch;
}

.community-plants-due-badge {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--forest-accent);
}

.community-plant-edit-card {
    margin-top: 1rem;
}

.community-plant-edit-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.plants-detail-log {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.plants-detail-log-heading {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--forest-mid);
}

.plants-detail-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 14rem;
    overflow-y: auto;
}

.plants-detail-log-item {
    font-size: 0.86rem;
    line-height: 1.35;
    color: var(--text);
}

.plants-detail-log-time,
.plants-detail-log-who {
    color: var(--text-muted);
}

.plants-detail-log-sep {
    color: var(--border);
    padding: 0 0.15rem;
}

.plants-detail-log-action {
    color: var(--forest-dark);
}

.plants-detail-log-empty {
    margin: 0;
}

.community-subheading {
    margin: 1rem 0 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--forest-mid);
}

.community-settings-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.community-settings-list__item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.community-settings-list__item:last-child {
    border-bottom: none;
}

.community-settings-list__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.community-inline-form {
    display: inline;
}

.community-inline-form button {
    margin-top: 0.25rem;
}

.btn--sm {
    font-size: 0.82rem;
    padding: 0.25rem 0.55rem;
}

.community-news-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    max-height: 22rem;
    overflow-y: auto;
}

.community-news-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(14, 74, 57, 0.08);
}

.community-news-item__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--warm-muted);
    margin-bottom: 0.25rem;
}

.community-news-item__body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.community-laundry-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.community-laundry-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(14, 74, 57, 0.08);
}

/* Community messages: compact WhatsApp-style strip (~5 one-line rows visible) */
.community-chat-log {
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.55rem;
    background: var(--surface-muted);
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    /* ~5 single-line messages (meta + body lines ~ 1.35em each → ~2.7em per bubble, tight) */
    max-height: calc(2.65rem * 5 + 0.5rem);
    scroll-behavior: smooth;
}

.community-chat-row {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

.community-chat-row--self {
    justify-content: flex-end;
}

.community-chat-bubble {
    --author-color: var(--forest-mid);
    max-width: min(94%, 26rem);
    padding: 0.28rem 0.55rem 0.32rem;
    border-radius: 10px;
    background: var(--warm-card);
    border: 1px solid rgba(14, 74, 57, 0.1);
    border-left: 3px solid var(--author-color);
    box-shadow: var(--shadow-sm);
}

.community-chat-row--self .community-chat-bubble {
    border-left: 1px solid rgba(14, 74, 57, 0.1);
    border-right: 3px solid var(--author-color);
}

.community-chat-bubble__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.12rem;
}

.community-chat-line__who {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--author-color);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.community-chat-line__when {
    font-size: 0.72rem;
    color: var(--warm-muted);
    flex-shrink: 0;
}

.community-chat-line__body {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--warm-text);
}

.community-chat-compose textarea {
    min-height: 2.5rem;
}

.community-events-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.community-events-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(14, 74, 57, 0.08);
}
