.back-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
}

.bills-page {
    width: min(100%, 1100px);
    margin: 10px auto
}

.bills-heading {
    margin-bottom: 25px
}

.bills-heading h1 {
    font-size: 36px
}

.bills-heading .muted {
    margin: 8px 0 0
}

.bill-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-bottom: 26px
}

.bill-summary>div {
    padding: 20px 22px;
    background: var(--surface)
}

.bill-summary small,
.bill-summary span {
    display: block;
    color: var(--muted);
    font-size: 11px
}

.bill-summary strong {
    display: block;
    margin: 5px 0;
    font: 25px Georgia
}

.bills-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px
}

.bill-list-panel,
.bill-setup {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(32, 48, 45, .04)
}

.bill-list-panel .panel-header,
.bill-setup .panel-header {
    padding: 20px 24px
}

.bill-list-panel h2,
.bill-setup h2 {
    font-size: 24px
}

.bill-list {
    padding: 4px 24px 20px
}

.bill-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    border-bottom: 1px solid var(--line)
}

.bill-row:last-child {
    border-bottom: 0
}

.bill-category {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e1f0e5;
    color: var(--sage-deep);
    font-weight: 700
}

.bill-name {
    flex: 1;
    min-width: 0
}

.bill-name strong,
.bill-name small {
    display: block
}

.bill-name strong {
    font-size: 14px
}

.bill-name small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px
}

.bill-amount {
    font-size: 14px;
    white-space: nowrap
}

.bill-row .assignee {
    white-space: nowrap
}

.bill-row form {
    display: flex
}

.bill-setup .task-form {
    padding-top: 20px
}

@media(max-width:900px) {
    .bills-layout {
        grid-template-columns: 1fr
    }

    .bill-setup {
        order: 2
    }
}

@media(max-width:600px) {
    .bills-heading h1 {
        font-size: 30px
    }

    .bill-summary {
        grid-template-columns: 1fr
    }

    .bill-summary>div {
        padding: 15px 18px
    }

    .bill-list {
        padding: 4px 14px 15px
    }

    .bill-list-panel .panel-header,
    .bill-setup .panel-header {
        padding: 17px 14px
    }

    .bill-row {
        gap: 7px;
        min-height: 64px
    }

    .bill-category {
        width: 29px;
        height: 29px;
        font-size: 12px
    }

    .bill-row .assignee {
        display: none
    }

    .bill-amount {
        font-size: 13px
    }

    .task-edit {
        font-size: 11px
    }
}

.shopping-page {
    width: min(100%, 860px);
    margin: 10px auto
}

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

.shopping-heading h1 {
    font-size: 36px
}

.shopping-heading .muted {
    margin: 8px 0 0
}

.add-shopping {
    display: grid;
    grid-template-columns: minmax(150px, 1.5fr) minmax(100px, 1fr) minmax(75px, .7fr) auto;
    gap: 8px;
    width: min(100%, 620px)
}

.add-shopping input {
    min-width: 0
}

.add-shopping .button {
    font-size: 20px;
    padding: 7px 16px
}

.shopping-controls {
    display: grid;
    grid-template-columns: 1fr 130px;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 14px
}

.shopping-controls label {
    grid-row: 1;
    color: var(--muted);
    font-size: 12px
}

.shopping-controls label:first-child {
    grid-column: 1;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0)
}

.shopping-controls label:nth-of-type(2) {
    grid-column: 2;
    grid-row: 1;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0)
}

.shopping-list {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow)
}

.shopping-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 18px 18px 8px;
    background: #f4f7f1;
    border-bottom: 1px solid var(--line)
}

.shopping-group h2 {
    font: 700 15px Arial, sans-serif
}

.shopping-group span {
    color: var(--muted);
    font-size: 12px
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    transition: background .15s, opacity .15s
}

.shopping-item:last-child {
    border-bottom: 0
}

.shopping-item.dragging {
    opacity: .45;
    background: #f4f7f1
}

.shopping-toggle {
    display: flex
}

.check-button {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border: 2px solid #b8c5bd;
    border-radius: 50%;
    background: #fff;
    color: transparent;
    cursor: pointer
}

.check-button:hover {
    border-color: var(--sage-deep)
}

.shopping-item.checked .check-button {
    border-color: var(--sage-deep);
    background: var(--sage-deep);
    color: #fff
}

.shopping-item.checked .shopping-name {
    color: var(--muted);
    text-decoration: line-through
}

.shopping-name {
    flex: 1;
    font-size: 15px
}

.item-actions {
    display: flex;
    gap: 2px
}

.icon-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 7px 8px;
    cursor: pointer;
    font-size: 15px
}

.icon-button:hover:not(:disabled) {
    color: var(--ink);
    background: #f4f7f1
}

.icon-button:disabled {
    opacity: .25;
    cursor: default
}

.delete-button:hover:not(:disabled) {
    color: #a95543
}

.drag-hint {
    color: var(--muted);
    font-size: 12px;
    text-align: right
}

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

@media(max-width:700px) {
    .shopping-heading {
        display: block
    }

    .shopping-heading h1 {
        font-size: 30px;
        margin-bottom: 20px
    }

    .add-shopping {
        width: 100%;
        grid-template-columns: 1fr 1fr
    }

    .add-shopping #new-item {
        grid-column: 1 / -1
    }

    .add-shopping .button {
        grid-column: 2
    }

    .shopping-item {
        padding: 9px 10px;
        gap: 9px
    }

    .shopping-group {
        padding-left: 10px
    }

    .item-actions {
        gap: 0
    }

    .icon-button {
        padding: 7px 5px
    }

    .drag-hint {
        text-align: left
    }
}

@media(max-width:450px) {
    .shopping-controls {
        grid-template-columns: 1fr
    }

    .shopping-controls label:nth-of-type(2) {
        grid-column: 1
    }

    .shopping-controls select {
        grid-column: 1
    }
}

.shopping-item[hidden],
.shopping-group[hidden] {
    display: none !important
}

.event-editor {
    width: min(100%, 680px);
    margin: 10px auto;
    padding: 38px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.event-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 26px;
    align-items: start
}

.event-workspace .event-editor {
    width: 100%;
    margin: 0
}

.event-items-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow)
}

.event-items-panel .panel-header {
    padding: 24px
}

.event-items-panel h2 {
    font-size: 27px
}

.event-items-panel .panel-header .muted {
    margin: 7px 0 0;
    font-size: 13px
}

.event-total {
    font: 25px Georgia;
    white-space: nowrap
}
.event-cost-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--line);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.event-cost-summary>div{padding:15px 18px;background:var(--surface)}.event-cost-summary small,.event-cost-summary span{display:block;color:var(--muted);font-size:11px}.event-cost-summary strong{display:block;margin:4px 0;font:20px Georgia}

.event-item-list {
    padding: 4px 24px
}

.event-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line)
}

.event-item:last-child {
    border-bottom: 0
}

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

.event-item-image {
    display: block;
    flex: 0 0 92px;
    height: 92px;
    overflow: hidden;
    background: var(--line)
}

.event-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.event-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.event-item-title strong {
    font-size: 15px
}

.event-item-main>small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px
}

.event-item-main p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45
}

.event-item-main a {
    display: inline-block;
    margin-top: 9px;
    font-size: 12px
}

.event-item-meta {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    white-space: nowrap
}

.event-item-meta form {
    display: flex
}

.status-badge,
.decision {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700
}

.status-ordered {
    background: #fff0d5;
    color: #986719
}

.status-delivered {
    background: #e1f0e5;
    color: var(--sage-deep)
}

.status-wrapped {
    background: #f8e2eb;
    color: #9a4d6a
}

.decision-yes {
    background: #e1f0e5;
    color: var(--sage-deep)
}

.decision-no {
    background: #fff0ec;
    color: #9a503d
}

.decision-maybe,
.decision-unset {
    background: #eef1ed;
    color: var(--muted)
}

.event-item-form {
    padding: 20px 24px;
    border-top: 1px solid var(--line)
}

.event-item-form h3 {
    font-size: 20px;
    margin-bottom: 4px
}

.event-item-form .task-form {
    padding: 16px 0 0
}

.item-comment {
    font-style: italic
}

.field-help {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px
}

@media(max-width:1000px) {
    .event-workspace {
        grid-template-columns: 1fr
    }

    .event-workspace .event-editor {
        order: 2
    }
}

@media(max-width:600px) {

    .event-items-panel .panel-header,
    .event-item-list,
    .event-item-form {
        padding-left: 14px;
        padding-right: 14px
    }

    .event-item {
        gap: 8px
    }

    .event-item-image {
        flex-basis: 70px;
        height: 70px
    }

    .event-item-meta {
        gap: 5px;
        align-items: center
    }

    .event-item-meta .decision {
        display: none
    }
}
@media(max-width:700px){.event-cost-summary{grid-template-columns:1fr 1fr}.event-cost-summary>div{padding:12px 14px}}

.checkbox-label {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-size: 13px
}

.checkbox-label input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--sage-deep)
}

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

.events-page {
    width: min(100%, 900px);
    margin: 10px auto
}

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

.events-heading h1 {
    font-size: 36px
}

.events-heading .muted {
    margin: 8px 0 0
}

.event-cards {
    display: grid;
    gap: 12px
}

.event-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none
}

.event-card:hover {
    border-color: var(--sage-deep)
}

.event-card-date {
    display: grid;
    place-items: center;
    min-width: 58px;
    padding: 8px 10px;
    background: #e1f0e5;
    color: var(--sage-deep)
}

.event-card-date strong {
    font: 27px Georgia
}

.event-card-date span {
    font-size: 11px;
    text-transform: uppercase
}

.event-card-content {
    min-width: 0;
    flex: 1
}

.event-card-content .eyebrow {
    margin: 0 0 7px;
    font-size: 10px
}

.event-card-content h2 {
    font-size: 22px
}

.event-card-content p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px
}

.event-card-arrow {
    font-size: 22px;
    color: var(--sage-deep)
}

@media(max-width:600px) {
    .events-heading {
        align-items: start;
        flex-direction: column
    }

    .events-heading h1 {
        font-size: 30px
    }

    .event-card {
        padding: 17px 14px;
        gap: 12px
    }

    .event-card-content h2 {
        font-size: 19px
    }
}

.editor-heading {
    margin-bottom: 28px;
}

.editor-heading h1 {
    font-size: 36px;
}

.event-form {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.event-form textarea {
    resize: vertical;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.form-success {
    padding: 12px;
    background: #e6f1e7;
    border-left: 3px solid var(--sage-deep);
    font-size: 13px;
    color: var(--sage-deep);
}

.agenda-item a {
    font-weight: 400;
    color: var(--ink);
    text-decoration: none;
}

.agenda-item a:hover,
.event-dot:hover {
    text-decoration: underline;
}

.event-dot {
    color: inherit;
    text-decoration: none;
}

@media (max-width: 600px) {
    .event-editor {
        padding: 25px 18px;
    }

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

    .editor-heading h1 {
        font-size: 30px;
    }

    .back-link {
        font-size: 12px;
    }
}

.tasks-page {
    width: min(100%, 1000px);
    margin: 10px auto
}

.tasks-heading {
    margin-bottom: 28px
}

.tasks-heading h1 {
    font-size: 36px
}

.tasks-heading .muted {
    margin: 8px 0 0
}

.tasks-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px
}

.task-list-panel,
.task-setup {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(32, 48, 45, .04)
}

.task-list-panel .panel-header,
.task-setup .panel-header {
    padding: 20px 24px
}

.task-list-panel h2,
.task-setup h2 {
    font-size: 24px
}

.task-list {
    padding: 4px 24px 20px
}

.task-row {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 62px;
    border-bottom: 1px solid var(--line)
}

.task-row:last-child {
    border-bottom: 0
}

.task-name {
    flex: 1;
    font-size: 15px
}

.task-row.checked .task-name {
    color: var(--muted);
    text-decoration: line-through
}

.assignee {
    padding: 5px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700
}

.assignee.Graeme {
    background: #e1f0e5;
    color: var(--sage-deep)
}

.assignee.Mel {
    background: #f8e2eb;
    color: #9a4d6a
}

.task-form {
    display: grid;
    gap: 15px;
    padding: 20px 24px 24px
}

.template-list {
    padding: 20px 24px;
    border-top: 1px solid var(--line)
}

.template-list h3 {
    font-size: 18px;
    margin-bottom: 12px
}

.template-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding: 12px 0;
    font-size: 13px
}

.template-row>span {
    flex: 1
}

.template-row small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px
}

.template-row a {
    font-size: 12px
}

.template-row form {
    display: flex
}

@media(max-width:900px) {
    .tasks-layout {
        grid-template-columns: 1fr
    }

    .task-setup {
        order: 2
    }
}

@media(max-width:600px) {
    .tasks-heading h1 {
        font-size: 30px
    }

    .task-list {
        padding: 4px 14px 15px
    }

    .task-list-panel .panel-header,
    .task-setup .panel-header {
        padding: 17px 14px
    }

    .task-form,
    .template-list {
        padding-left: 14px;
        padding-right: 14px
    }

    .assignee {
        font-size: 10px;
        padding: 4px 7px
    }
}

.task-links {
    display: flex;
    align-items: end;
    gap: 16px
}

.task-links>div {
    margin-right: auto
}

.task-links>a {
    font-size: 13px
}

.one-off-icon {
    font-size: 20px;
    width: 25px;
    text-align: center
}

.task-name small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    text-decoration: none
}

.points {
    color: var(--sage-deep);
    font-size: 12px;
    white-space: nowrap
}

.task-edit {
    font-size: 12px
}

.stats-page {
    width: min(100%, 1000px);
    margin: 10px auto
}

.stats-filters {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-bottom: 24px
}

.stats-filters label {
    min-width: 145px
}

.stats-filters .button {
    height: 43px
}

.points-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(32, 48, 45, .04)
}

.points-chart {
    display: flex;
    align-items: stretch;
    gap: 10px;
    height: 310px;
    padding: 30px 28px 26px 54px;
    position: relative
}

.chart-grid {
    position: absolute;
    inset: 30px 28px 52px 54px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none
}

.chart-grid:before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0 calc(50% - 1px), var(--line) 50% calc(50% + 1px));
    z-index: 0
}

.chart-grid span {
    position: relative;
    z-index: 1;
    color: var(--muted);
    font-size: 10px;
    margin-left: -28px
}

.chart-bar-wrap {
    flex: 1;
    min-width: 16px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: end;
    position: relative;
    z-index: 1
}

.chart-bar {
    width: min(100%, 42px);
    background: var(--sage-deep);
    border-radius: 4px 4px 0 0;
    min-height: 3px
}

.chart-value {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 5px
}

.chart-bar-wrap small {
    color: var(--muted);
    font-size: 10px;
    margin-top: 9px;
    white-space: nowrap
}

.drag-hint {
    color: var(--muted);
    font-size: 12px;
    text-align: right
}

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

@media(max-width:600px) {
    .task-links {
        align-items: start;
        flex-wrap: wrap;
        gap: 10px
    }

    .task-links>div {
        width: 100%
    }

    .stats-filters {
        align-items: stretch;
        flex-wrap: wrap
    }

    .stats-filters label {
        flex: 1;
        min-width: 120px
    }

    .points-chart {
        height: 260px;
        padding-left: 46px;
        padding-right: 12px;
        gap: 4px
    }

    .chart-grid {
        left: 46px;
        right: 12px
    }

    .chart-bar-wrap small {
        font-size: 9px;
        transform: rotate(-35deg);
        transform-origin: top left
    }

    .one-off-list .assignee {
        display: none
    }
}

:root {
    --ink: #20302d;
    --muted: #71807b;
    --paper: #f8f8f4;
    --surface: #fff;
    --line: #e5e9e2;
    --sage: #b8d7c3;
    --sage-deep: #3d735a;
    --coral: #ed9277;
    --yellow: #f3d77b;
    --shadow: 0 18px 50px rgba(32, 48, 45, 0.08);
    font-family: Georgia, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Arial, "Helvetica Neue", sans-serif;
}

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

a {
    color: var(--sage-deep);
    font-weight: 700;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 12% 20%, #e6f1e7 0 18%, transparent 38%),
        radial-gradient(circle at 86% 82%, #fce5dd 0 12%, transparent 34%), var(--paper);
}

.auth-card {
    width: min(100%, 440px);
    padding: 48px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 32px;
    background: var(--ink);
    color: #fff;
    font: 700 25px Georgia;
    border-radius: 50%;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--sage-deep);
    margin: 0 0 12px;
}

h1,
h2,
h3 {
    font-family: Georgia, serif;
    font-weight: 400;
    line-height: 1.05;
    margin: 0;
}

h1 {
    font-size: 42px;
    letter-spacing: -1px;
}

.muted {
    color: var(--muted);
    line-height: 1.55;
}

.auth-card form {
    display: grid;
    gap: 18px;
    margin-top: 30px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 13px;
    color: var(--ink);
    background: #fcfcfa;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #d8ebdd;
    border-color: var(--sage-deep);
}

.button {
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    padding: 13px 16px;
    font-weight: 700;
}

.button-primary {
    background: var(--ink);
    color: #fff;
}

.button-primary:hover {
    background: var(--sage-deep);
}

.button-quiet {
    background: transparent;
    color: var(--muted);
}

.auth-switch {
    margin: 26px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.form-error {
    padding: 12px;
    background: #fff0ec;
    border-left: 3px solid var(--coral);
    font-size: 13px;
    color: #9a503d;
}

.app-shell {
    display: grid;
    grid-template-columns: 230px 1fr;
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 30px 22px;
    background: var(--ink);
    color: #fff;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 24px Georgia;
    color: #fff;
    text-decoration: none;
}

.logo .brand-mark {
    width: 32px;
    height: 32px;
    margin: 0;
    background: var(--sage);
    color: var(--ink);
    font-size: 18px;
}

.side-nav {
    display: grid;
    gap: 8px;
    margin-top: 60px;
}

.side-nav a {
    padding: 12px 14px;
    color: #bdcbc3;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
}

.side-nav a.active,
.side-nav a:hover {
    background: #334843;
    color: #fff;
}

.side-footer {
    margin-top: auto;
    color: #9aada4;
    font-size: 12px;
}

.main {
    padding: 38px clamp(24px, 5vw, 72px);
    max-width: 1440px;
    width: 100%;
}

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

.greeting {
    font: 34px Georgia;
}

.greeting span {
    color: var(--sage-deep);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--coral);
    color: #fff;
    font-weight: 700;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
}

.calendar-panel,
.agenda-panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(32, 48, 45, 0.04);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.panel-header h1 {
    font-size: 28px;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 7px;
}

.month-nav button {
    width: 33px;
    height: 33px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.month-label {
    min-width: 125px;
    text-align: center;
    font: 18px Georgia;
}

.weekday-row,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: 0;
}

.weekday-row {
    padding: 15px 18px 10px;
    color: #9ba9a2;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-grid {
    padding: 0 18px 18px;
}

.day {
    min-width: 0;
    min-height: 102px;
    padding: 11px 9px;
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    cursor: pointer;
}

.day:nth-child(7n) {
    border-right: 0;
}

.day.outside {
    color: #bdc6c0;
    background: #fbfbf8;
}

.day.today .day-number {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    background: var(--ink);
    color: #fff;
    border-radius: 50%;
}

.day-number {
    display: block;
    width: 27px;
    height: 27px;
    font-size: 12px;
    font-weight: 700;
}

.event-dot {
    display: block;
    margin-top: 6px;
    padding: 5px 6px;
    border-radius: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
    font-weight: 700;
}

.event-dot.family {
    background: #e1f0e5;
    color: #3d735a;
}

.event-dot.school {
    background: #fff3ce;
    color: #765c20;
}

.event-dot.appointment {
    background: #e8e4f6;
    color: #5b4b87;
}

.event-dot.deadline {
    background: #fde4de;
    color: #9a503d;
}

.event-dot.birthday {
    background: #f8e2eb;
    color: #9a4d6a;
}

.event-dot.holiday {
    background: #e0f7fa;
    color: #00796b;
}

.agenda-panel {
    height: max-content;
}

.agenda-list {
    padding: 4px 24px 22px;
}

.agenda-date {
    display: flex;
    gap: 12px;
    margin: 20px 0 12px;
}

.agenda-date strong {
    font: 18px Georgia;
}

.agenda-date small {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.agenda-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.agenda-item time {
    min-width: 53px;
    color: var(--muted);
    font-size: 11px;
}

.add-event {
    padding: 18px 24px;
    background: #f4f7f1;
    border-top: 1px solid var(--line);
}

.add-event h3 {
    font-size: 19px;
    margin-bottom: 15px;
}

.add-event form {
    display: grid;
    gap: 10px;
}

.add-event .button {
    margin-top: 4px;
}

.empty {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    padding: 0 1rem;
}

.mobile-menu {
    display: none;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .sidebar.is-open {
        display: flex !important;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 10;
        width: min(82vw, 280px);
        box-shadow: 12px 0 30px rgba(32, 48, 45, 0.18);
    }

    .main {
        padding: 22px 14px;
    }

    .mobile-menu {
        display: block;
        border: 0;
        background: none;
        font-size: 22px;
        padding: 8px;
        color: var(--ink);
        cursor: pointer;
    }

    .topbar {
        margin-bottom: 25px;
    }

    .greeting {
        font-size: 26px;
    }

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

    .agenda-panel {
        order: 2;
    }

    .panel-header {
        padding: 17px;
    }

    .calendar-grid {
        padding: 0 8px 8px;
    }

    .weekday-row {
        padding: 12px 8px 8px;
    }

    .day {
        min-height: 72px;
        padding: 7px 5px;
    }

    .event-dot {
        font-size: 9px;
        padding: 4px 3px;
    }

    .month-label {
        min-width: 105px;
        font-size: 16px;
    }

    .user-menu span {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
    }

    h1 {
        font-size: 35px;
    }

    .day {
        min-height: 59px;
    }

    .day-number {
        font-size: 11px;
    }

    .event-dot {
        margin-top: 3px;
        max-width: 100%;
    }

    .panel-header h1 {
        font-size: 23px;
    }

    .calendar-panel .panel-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .calendar-panel .month-nav {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-panel .month-label {
        flex: 1;
    }
}

.event-item-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 8px 12px;
    align-items: center;
    padding: 16px 24px 4px;
}

.event-item-controls label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.event-item-controls input,
.event-item-controls select {
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 12px;
}

.event-item-controls select {
    grid-column: 2;
}

.event-category {
    padding: 16px 0 5px;
    border-bottom: 1px solid var(--line);
}

.event-category h3 {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.item-quick-controls {
    display: grid;
    gap: 7px;
    min-width: 210px;
}

.quick-control-group {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: wrap;
}

.quick-control-label {
    align-self: center;
    margin-right: 3px;
    color: var(--muted);
    font-size: 10px;
}

.quick-button {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font: 700 10px Arial, sans-serif;
}

.quick-button:hover,
.quick-button.is-active {
    border-color: var(--sage-deep);
    color: var(--sage-deep);
}

.quick-button.decision-no.is-active,
.quick-button.status-wrapped.is-active {
    border-color: #9a503d;
    color: #9a503d;
}

.quick-button.decision-maybe.is-active,
.quick-button.status-ordered.is-active {
    border-color: #986719;
    color: #986719;
}

.quick-button:disabled {
    cursor: wait;
    opacity: .55;
}

.event-card-stats {
    display: block;
    margin-top: 9px;
    color: var(--sage-deep);
    font-size: 11px;
}

@media(max-width:600px) {
    .event-item-controls {
        grid-template-columns: 1fr;
        padding-left: 14px;
        padding-right: 14px;
    }

    .event-item-controls select {
        grid-column: 1;
    }

    .event-item {
        display: block;
    }

    .event-item-meta {
        display: flex;
        justify-content: space-between;
        margin-top: 12px;
    }

    .item-quick-controls {
        min-width: 0;
    }

    .quick-control-group {
        justify-content: flex-start;
    }
}