:root {
    --paper: #f7f1e8;
    --paper-strong: #efe3d3;
    --ink: #2a1b10;
    --ink-soft: #6a5648;
    --line: rgba(78, 53, 35, 0.15);
    --line-strong: rgba(78, 53, 35, 0.24);
    --card: rgba(255, 249, 241, 0.92);
    --card-soft: rgba(255, 252, 247, 0.78);
    --surface: rgba(255, 249, 241, 0.7);
    --surface-soft: rgba(255, 249, 241, 0.35);
    --pill-overlay: rgba(255, 249, 241, 0.28);
    --pill-border: rgba(255, 249, 241, 0.45);
    --field-bg: rgba(255, 249, 241, 0.92);
    --field-border: rgba(78, 53, 35, 0.18);
    --page-glow: rgba(211, 168, 103, 0.22);
    --page-top: #f8f2e8;
    --page-bottom: #eee3d2;
    --month-header-top: rgba(241, 228, 210, 0.95);
    --month-header-bottom: rgba(255, 249, 241, 0.9);
    --empty-border: rgba(78, 53, 35, 0.1);
    --day-border: rgba(78, 53, 35, 0.12);
    --weekend-ring: rgba(114, 87, 64, 0.14);
    --holiday-ring: rgba(201, 90, 71, 0.45);
    --override-ring: rgba(106, 129, 144, 0.5);
    --selection-ring: rgba(138, 97, 65, 0.6);
    --muted-copy: rgba(44, 28, 17, 0.72);
    --icon-bg: rgba(255, 249, 241, 0.72);
    --drawer-banner-fade: rgba(255, 249, 241, 0.96);
    --accent: #8a6141;
    --accent-dark: #65442a;
    --holiday: #fff1d7;
    --weekend: #f4ece0;
    --success: #3f6f4b;
    --danger: #8e4a3c;
    --button-primary-text: #fff7ef;
    --shadow-soft: 0 10px 24px rgba(49, 30, 16, 0.12);
    --shadow: 0 18px 48px rgba(49, 30, 16, 0.12);
    --radius: 20px;
}

html {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --paper: #171210;
    --paper-strong: #251d18;
    --ink: #f6ead9;
    --ink-soft: #cbb4a0;
    --line: rgba(246, 234, 217, 0.14);
    --line-strong: rgba(246, 234, 217, 0.24);
    --card: rgba(31, 24, 20, 0.92);
    --card-soft: rgba(39, 30, 25, 0.84);
    --surface: rgba(47, 36, 30, 0.88);
    --surface-soft: rgba(255, 249, 241, 0.05);
    --pill-overlay: rgba(255, 247, 239, 0.1);
    --pill-border: rgba(255, 247, 239, 0.16);
    --field-bg: rgba(24, 19, 16, 0.92);
    --field-border: rgba(246, 234, 217, 0.18);
    --page-glow: rgba(111, 128, 173, 0.18);
    --page-top: #110e0c;
    --page-bottom: #211915;
    --month-header-top: rgba(70, 55, 44, 0.95);
    --month-header-bottom: rgba(31, 24, 20, 0.9);
    --empty-border: rgba(246, 234, 217, 0.12);
    --day-border: rgba(246, 234, 217, 0.13);
    --weekend-ring: rgba(198, 169, 139, 0.18);
    --holiday-ring: rgba(217, 117, 98, 0.55);
    --override-ring: rgba(147, 190, 216, 0.62);
    --selection-ring: rgba(207, 142, 93, 0.78);
    --muted-copy: rgba(240, 228, 215, 0.72);
    --icon-bg: rgba(53, 41, 34, 0.9);
    --drawer-banner-fade: rgba(16, 13, 10, 0.8);
    --accent: #cf8e5d;
    --accent-dark: #f1cfb2;
    --holiday: #52392d;
    --weekend: #30261f;
    --success: #71b28a;
    --danger: #df907f;
    --button-primary-text: #150f0b;
    --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.22);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, var(--page-glow), transparent 30%),
        linear-gradient(180deg, var(--page-top) 0%, var(--page-bottom) 100%);
    min-height: 100vh;
    transition: background-color 180ms ease, color 180ms ease;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

.page-shell {
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.topbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.brand {
    display: inline-block;
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.72rem;
    color: var(--ink-soft);
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.topnav a,
.link-button {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.link-button {
    border: 1px solid var(--line);
}

.theme-toggle {
    position: relative;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    transition: transform 140ms ease, border-color 180ms ease, background-color 180ms ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    transition: opacity 180ms ease, transform 180ms ease;
}

.theme-icon--sun {
    opacity: 0;
    transform: scale(0.8) rotate(-20deg);
}

.theme-icon--moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .theme-icon--sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .theme-icon--moon {
    opacity: 0;
    transform: scale(0.8) rotate(20deg);
}

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

.theme-toggle:focus-visible,
.topnav a:focus-visible,
.link-button:focus-visible,
.button-primary:focus-visible,
.button-secondary:focus-visible,
.button-ghost:focus-visible,
.icon-button:focus-visible,
.day-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.message {
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--card);
}

.message.success {
    border-color: rgba(63, 111, 75, 0.25);
}

.page-main {
    display: grid;
    gap: 24px;
}

.has-modal-open {
    overflow: hidden;
}

.hero-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
}

.hero-row h1,
.section-heading h2,
.card h2,
.drawer-card h2,
.auth-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.95;
}

.lede,
.drawer-subtitle,
.auth-copy p {
    max-width: 62ch;
    color: var(--ink-soft);
    margin: 10px 0 0;
    line-height: 1.55;
}

.hero-actions,
.form-actions,
.list-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.section-heading--compact {
    margin-bottom: 12px;
}

.section-heading--compact h2,
.section-heading--compact h3 {
    font-size: 1.15rem;
    line-height: 1.1;
}

.button-primary,
.button-secondary,
.button-ghost {
    border-radius: 999px;
    padding: 11px 18px;
    border: 1px solid transparent;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.button-primary:hover,
.button-secondary:hover,
.button-ghost:hover,
.day-button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    color: var(--button-primary-text);
    box-shadow: 0 10px 22px rgba(121, 78, 43, 0.22);
}

.button-secondary {
    background: var(--card);
    border-color: var(--line);
}

.button-ghost {
    background: transparent;
    border-color: rgba(142, 74, 60, 0.3);
    color: var(--danger);
}

.card,
.planner-drawer,
.summary-card,
.stat-card,
.auth-form {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.planner-command-bar {
    display: block;
}

.shortcut-card,
.paint-toolbar {
    padding: 18px 20px;
}

.shortcut-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shortcut-list--popup {
    margin-bottom: 8px;
}

.shortcut-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--chip-color, var(--surface)) 16%, var(--surface));
    color: var(--ink);
    font-size: 0.84rem;
}

.shortcut-chip strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid var(--pill-border);
    font-size: 0.8rem;
}

.shortcut-chip--button {
    cursor: pointer;
}

.paint-toolbar {
    display: grid;
    gap: 16px;
}

.bulk-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.bulk-toolbar__primary h2 {
    font-size: 1.35rem;
}

.bulk-toolbar__row--inputs {
    align-items: flex-start;
}

.paint-toolbar__status {
    display: grid;
    grid-template-columns: minmax(240px, 1.25fr) minmax(220px, 1fr);
    gap: 12px 18px;
    align-items: start;
}

.paint-toolbar__status .muted-copy {
    margin: 0;
}

.paint-toolbar__brushes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.bulk-toolbar__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

[data-bulk-status][data-state="success"] {
    color: var(--success);
}

[data-bulk-status][data-state="error"] {
    color: var(--danger);
}

.stat-card {
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 10px;
    background: var(--accent);
}

.stat-card span {
    display: block;
    color: var(--ink-soft);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.planner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.planner-layout--full {
    gap: 0;
}

.planner-workspace {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.month-collapse-rail {
    position: sticky;
    left: 0;
    top: 12px;
    z-index: 8;
    flex: 0 0 126px;
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    box-shadow: var(--shadow-soft);
}

.month-collapse-rail__label,
.month-collapse-rail__empty {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.72rem;
    line-height: 1.25;
}

.month-collapse-rail__label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.month-collapse-rail__list {
    display: grid;
    gap: 7px;
}

.month-rail-button {
    display: grid;
    gap: 1px;
    width: 100%;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
}

.month-rail-button[hidden],
.month-collapse-rail__empty[hidden] {
    display: none !important;
}

.month-rail-button strong {
    line-height: 1;
}

.month-rail-button span {
    color: var(--ink-soft);
    font-size: 0.7rem;
    line-height: 1.1;
}

.planner-grid-wrap {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 6px;
}

.planner-grid {
    display: flex;
    gap: 12px;
    align-items: start;
    min-width: max-content;
}

.month-card {
    display: grid;
    grid-template-rows: auto 1fr;
    align-self: start;
    flex: 0 0 172px;
    background: var(--card-soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: visible;
}

.month-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--month-header-top), var(--month-header-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.month-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.month-header span {
    color: var(--ink-soft);
}

.month-toggle {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    padding: 6px 10px;
    font-size: 0.74rem;
    line-height: 1;
}

.month-toggle__show {
    display: none;
}

.month-card--collapsed .month-toggle__show {
    display: inline;
}

.month-card--collapsed .month-toggle__hide {
    display: none;
}

.month-card--collapsed .month-body {
    display: none;
}

.month-card--collapsed {
    display: none;
    grid-template-rows: auto;
    min-height: 0;
    opacity: 0.78;
}

.month-body {
    display: grid;
    gap: 3px;
    padding: 6px;
    align-items: stretch;
}

.month-day-slot {
    min-width: 0;
}

.day-cell {
    min-height: 38px;
}

.day-cell--empty {
    border-radius: 14px;
    border: 1px dashed var(--empty-border);
    background: var(--surface-soft);
}

.day-cell--selected .day-button {
    outline: 2px solid var(--selection-ring);
    outline-offset: 1px;
}

.day-button {
    width: 100%;
    min-height: 38px;
    padding: 5px 7px;
    border: 1px solid var(--day-border);
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--cell-color, #ece4d7);
    color: var(--cell-text, var(--ink));
    text-align: left;
}

.day-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.day-cell--weekend .day-button {
    box-shadow: inset 0 0 0 2px var(--weekend-ring);
}

.day-cell--holiday .day-button {
    box-shadow: inset 0 0 0 2px var(--holiday-ring);
}

.day-cell--override .day-button {
    outline: 2px solid var(--override-ring);
    outline-offset: 2px;
}

.day-cell--today .day-button {
    position: relative;
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow:
        inset 0 0 0 2px color-mix(in srgb, var(--accent) 38%, transparent),
        0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.day-cell--today .day-number {
    background: var(--accent);
    color: var(--button-primary-text);
    border-color: transparent;
}

.day-meta,
.drawer-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.day-meta--compact {
    gap: 4px;
}

.day-number,
.day-weekday,
.day-badge,
.category-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 2px 7px;
    background: var(--pill-overlay);
    border: 1px solid var(--pill-border);
    font-size: 0.72rem;
}

.day-weekday {
    min-width: 2.2em;
    padding-inline: 6px;
    font-size: 0.68rem;
    font-weight: 700;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 6px;
    background: var(--tag-color, var(--surface));
    color: var(--tag-text, var(--ink));
    font-size: 0.7rem;
    border: 1px solid transparent;
}

.day-label {
    font-weight: 700;
    font-size: 0.84rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-hint,
.meta-label,
small,
.muted-copy {
    color: var(--muted-copy);
    font-size: 0.76rem;
}

.month-range-bar {
    position: relative;
    width: 100%;
    min-width: 10px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--bar-color) 78%, white), var(--bar-color));
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--bar-color) 72%, black),
        0 4px 10px rgba(34, 22, 14, 0.12);
    cursor: help;
    transition: transform 140ms ease;
}

.month-range-bar:hover,
.month-range-bar:focus-visible {
    transform: translateX(-1px);
}

.month-range-bar::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    width: max-content;
    max-width: 220px;
    padding: 8px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--ink) 92%, transparent);
    color: var(--paper);
    box-shadow: var(--shadow-soft);
    line-height: 1.35;
    font-size: 0.76rem;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    transition: opacity 140ms ease;
    white-space: normal;
}

.month-range-bar::before {
    content: "";
    position: absolute;
    left: calc(100% + 3px);
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 7px solid color-mix(in srgb, var(--ink) 92%, transparent);
    opacity: 0;
    transition: opacity 140ms ease;
    pointer-events: none;
    z-index: 15;
}

.month-range-bar:hover::after,
.month-range-bar:hover::before,
.month-range-bar:focus-visible::after,
.month-range-bar:focus-visible::before {
    opacity: 1;
}

.drawer-empty {
    display: grid;
    gap: 10px;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-shell[hidden] {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 13, 9, 0.58);
    backdrop-filter: blur(4px);
}

.modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.modal-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.modal-card--compact {
    gap: 16px;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.icon-button {
    border: 1px solid var(--line);
    background: var(--icon-bg);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    line-height: 1;
}

.drawer-banner {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, var(--event-color), var(--drawer-banner-fade));
    color: #fff9f1;
}

.shortcut-panel {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.tag-removal-panel {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.tag-removal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-removal-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--chip-color, var(--surface));
    color: var(--chip-text, var(--ink));
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.tag-removal-chip small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tag-removal-chip--primary {
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.08),
        0 0 0 2px color-mix(in srgb, var(--chip-color) 30%, transparent);
}

.tag-removal-chip strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    line-height: 1;
}

.paint-toolbar__section {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.paint-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--chip-color, var(--surface)) 18%, var(--surface));
    color: var(--ink);
    font-size: 0.92rem;
}

.paint-chip--tag {
    border-style: dashed;
}

.paint-chip--remove {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    color: var(--danger);
}

.paint-chip--active {
    background: var(--accent);
    color: var(--button-primary-text);
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(121, 78, 43, 0.18);
}

.drawer-form,
.stack-form {
    display: grid;
    gap: 16px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-modal-card {
    max-width: 720px;
}

.category-browser {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.category-browser__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}

.category-browser__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--chip-color, var(--surface)) 14%, var(--surface));
    color: var(--ink);
    text-align: left;
}

.category-browser__item--active {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}

.category-browser__swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--chip-color, var(--accent));
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.category-browser__name {
    min-width: 0;
    font-weight: 700;
    line-height: 1.15;
}

.category-browser__meta {
    grid-column: 2;
    color: var(--muted-copy);
    font-size: 0.8rem;
}

.category-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr);
    gap: 14px;
    align-items: end;
}

.color-field input[type="color"] {
    min-height: 52px;
    padding: 8px;
}

.toggle-row--checkbox {
    padding-top: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
}

label.is-disabled {
    opacity: 0.6;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--field-border);
    border-radius: 14px;
    background: var(--field-bg);
    color: var(--ink);
}

textarea {
    resize: vertical;
}

select[multiple] {
    min-height: 150px;
}

.toggle-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.toggle-row input {
    width: auto;
}

.form-errors,
.field-error {
    color: var(--danger);
}

.summary-card,
.listing-card,
.form-card {
    padding: 20px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}

.summary-table-wrap {
    overflow-x: auto;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.summary-table th,
.summary-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.summary-table thead th {
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.category-chip {
    background: var(--chip-color, #ddd);
    color: var(--ink);
    border-color: transparent;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    gap: 20px;
}

.split-layout--reports {
    grid-template-columns: 1fr;
}

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

.list-item-main {
    display: grid;
    gap: 6px;
}

.category-list,
.event-list {
    display: grid;
}

.auth-panel {
    min-height: 72vh;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
    gap: 24px;
    align-items: center;
}

.auth-form,
.auth-copy {
    padding: 28px;
}

@media (max-width: 1180px) {
    .planner-command-bar,
    .quick-stats,
    .planner-layout,
    .split-layout,
    .auth-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .page-shell {
        padding: 16px;
    }

    .topbar,
    .hero-row,
    .section-heading {
        flex-direction: column;
        align-items: start;
    }

    .planner-workspace {
        flex-direction: column;
    }

    .month-collapse-rail {
        position: static;
        width: 100%;
        flex: 0 0 auto;
    }

    .month-collapse-rail__list {
        display: flex;
        flex-wrap: wrap;
    }

    .month-rail-button {
        width: auto;
        min-width: 82px;
    }

    .planner-grid-wrap {
        width: 100%;
    }

    .planner-grid {
        flex-direction: column;
        min-width: unset;
    }

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

    .paint-toolbar__status,
    .paint-toolbar__brushes {
        grid-template-columns: 1fr;
    }

    .month-card {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .quick-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }

    .day-button {
        min-height: 42px;
    }
}
