:root {
    --bg: #f3ecdf;
    --bg-accent: #e0d3bd;
    --surface: rgba(255, 252, 245, 0.94);
    --surface-strong: #fffdf8;
    --text: #1f2520;
    --muted: #5d655f;
    --primary: #1f6a52;
    --primary-dark: #174c3b;
    --border: rgba(31, 37, 32, 0.12);
    --danger: #8b3a2a;
    --info: #43658b;
    --shadow: 0 24px 60px rgba(32, 29, 20, 0.12);
    --radius: 1.1rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(224, 211, 189, 0.85), transparent 32%),
        linear-gradient(180deg, #efe6d4 0%, #f7f1e6 45%, #f3ecdf 100%);
    color: var(--text);
    font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

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

.page-shell {
    width: min(1180px, calc(100% - 1.25rem));
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: min(29rem, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    padding: 1.4rem 1.35rem 1.25rem;
}

.auth-eyebrow {
    margin-bottom: 0.55rem;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
}

.auth-title {
    max-width: 10ch;
    font-size: clamp(2.15rem, 6vw, 2.95rem);
    line-height: 0.97;
    letter-spacing: -0.04em;
}

.auth-copy {
    max-width: 28ch;
    margin: 0.75rem 0 1.1rem;
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.98rem;
}

.auth-form {
    display: grid;
    gap: 0.9rem;
}

.auth-field span {
    font-size: 0.9rem;
}

.auth-field input {
    min-height: 3.15rem;
    border-radius: 1rem;
    padding-inline: 0.9rem;
}

.auth-actions {
    justify-content: flex-start;
}

.auth-actions .button {
    min-width: 7.5rem;
    min-height: 2.9rem;
    padding-inline: 1.25rem;
}

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

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2 {
    font-family: "Iowan Old Style", "Georgia", serif;
    letter-spacing: -0.02em;
}

h1 {
    margin: 0;
    font-size: clamp(1.95rem, 4vw, 3rem);
}

h2 {
    margin: 0;
    font-size: 1.28rem;
}

.lead {
    margin: 0.55rem 0 0;
    color: var(--muted);
}

.separator {
    margin: 0 0.45rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.month-switcher {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.summary-grid {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.summary-card,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.summary-card {
    padding: 0.95rem 1rem;
}

.summary-label {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.summary-value {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.45rem;
}

.card {
    padding: 1rem;
    margin-bottom: 0.8rem;
}

.card--quick-capture {
    background:
        linear-gradient(135deg, rgba(31, 106, 82, 0.16) 0%, rgba(255, 252, 245, 0.96) 42%, rgba(255, 252, 245, 0.98) 100%);
    border-color: rgba(31, 106, 82, 0.28);
    box-shadow:
        0 24px 60px rgba(32, 29, 20, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.card--quick-capture::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    background: linear-gradient(180deg, #2f8668 0%, #174c3b 100%);
}

.card--quick-capture .card-heading h2 {
    color: var(--primary-dark);
}

.card--quick-capture .card-heading p {
    color: #3d5145;
}

.card--full-entry {
    background:
        linear-gradient(135deg, rgba(191, 112, 53, 0.18) 0%, rgba(255, 249, 241, 0.96) 38%, rgba(255, 252, 245, 0.98) 100%);
    border-color: rgba(191, 112, 53, 0.3);
    box-shadow:
        0 24px 60px rgba(32, 29, 20, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
    position: relative;
    overflow: hidden;
}

.card--full-entry::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    background: linear-gradient(180deg, #c27039 0%, #8f4923 100%);
}

.card--full-entry .card-heading h2 {
    color: #8f4923;
}

.card--full-entry .card-heading p {
    color: #6a503f;
}

.card-heading {
    margin-bottom: 0.75rem;
}

.card-heading p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.flash-stack {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.flash {
    padding: 0.8rem 0.9rem;
    border-radius: 0.9rem;
    border: 1px solid transparent;
}

.flash--success {
    background: rgba(31, 106, 82, 0.12);
    border-color: rgba(31, 106, 82, 0.24);
}

.flash--error {
    background: rgba(139, 58, 42, 0.12);
    border-color: rgba(139, 58, 42, 0.24);
}

.flash--info {
    background: rgba(67, 101, 139, 0.12);
    border-color: rgba(67, 101, 139, 0.24);
}

.form-grid,
.entry-card {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.7rem 0.75rem;
    align-items: end;
}

.field,
.duration-box {
    min-width: 0;
}

.field {
    grid-column: span 3;
}

.field--wide {
    grid-column: span 4;
}

.field--date {
    grid-column: span 3;
}

.field--time {
    grid-column: span 2;
}

.field--break {
    grid-column: span 2;
}

.field--full,
.form-grid__full,
.entry-card__notes {
    grid-column: 1 / -1;
}

.form-grid--settings .form-actions--settings,
.form-grid--quick-start .form-actions--quick-start,
.form-grid--quick-finish .form-actions--quick-finish,
.form-grid--entry .form-actions--entry-create {
    grid-column: span 4;
    justify-content: flex-end;
}

.form-grid--quick-start .form-actions--quick-start {
    grid-column: span 7;
}

.form-grid--quick-finish .form-grid__full {
    grid-column: span 9;
}

.form-grid--quick-finish .form-actions--quick-finish {
    grid-column: span 3;
}

.duration-box--entry {
    grid-column: span 3;
}

label,
.duration-box {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
}

label span,
.duration-box span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.2;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(31, 37, 32, 0.14);
    border-radius: 0.82rem;
    background: var(--surface-strong);
    padding: 0.66rem 0.74rem;
    color: var(--text);
}

textarea {
    resize: vertical;
    min-height: 4.3rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(31, 106, 82, 0.16);
    border-color: rgba(31, 106, 82, 0.35);
}

.duration-box {
    justify-content: center;
    min-height: 100%;
    padding: 0.66rem 0.74rem;
    border-radius: 0.82rem;
    background: rgba(31, 106, 82, 0.08);
    border: 1px solid rgba(31, 106, 82, 0.16);
}

.duration-box strong {
    font-size: 1.1rem;
}

.button {
    border: none;
    border-radius: 999px;
    min-height: 2.65rem;
    padding: 0.72rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}

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

.button--secondary {
    background: rgba(31, 37, 32, 0.08);
    color: var(--text);
}

.button--icon {
    min-width: 8.5rem;
}

.button--ghost {
    background: rgba(255, 255, 255, 0.55);
    color: var(--danger);
    border: 1px solid rgba(139, 58, 42, 0.18);
}

.form-actions {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.quick-finish-shell {
    display: grid;
    gap: 0.55rem;
}

.discard-form {
    display: flex;
    justify-content: flex-end;
}

.entry-list {
    display: grid;
    gap: 0.55rem;
}

.entry-card {
    gap: 0.5rem 0.6rem;
    padding: 0.65rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(31, 37, 32, 0.08);
}

.entry-card label,
.entry-card .duration-box {
    gap: 0.22rem;
}

.entry-card label span,
.entry-card .duration-box span {
    font-size: 0.76rem;
}

.entry-card input,
.entry-card textarea {
    padding: 0.55rem 0.62rem;
    border-radius: 0.72rem;
}

.entry-card textarea {
    min-height: 3.4rem;
}

.entry-list .entry-card:nth-child(odd) {
    background: linear-gradient(135deg, rgba(31, 106, 82, 0.08) 0%, rgba(255, 255, 255, 0.76) 48%, rgba(255, 255, 255, 0.7) 100%);
    border-color: rgba(31, 106, 82, 0.14);
}

.entry-list .entry-card:nth-child(even) {
    background: linear-gradient(135deg, rgba(191, 112, 53, 0.08) 0%, rgba(255, 255, 255, 0.76) 48%, rgba(255, 255, 255, 0.7) 100%);
    border-color: rgba(191, 112, 53, 0.14);
}

.form-actions--entry-card {
    grid-column: span 4;
    justify-content: flex-end;
    gap: 0.45rem;
    padding-top: 0;
    flex-wrap: nowrap;
}

.form-grid--entry .form-grid__full {
    grid-column: span 9;
}

.form-grid--entry .form-actions--entry-create {
    grid-column: span 3;
}

.entry-card .entry-card__notes {
    grid-column: span 8;
}

.entry-card .button {
    min-height: 2.35rem;
    padding: 0.56rem 0.88rem;
}

.entry-card .button--ghost {
    padding-inline: 0.8rem;
}

.empty-state {
    padding: 0.9rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted);
}

.autocomplete-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 10;
    padding: 0.35rem;
    border-radius: 0.9rem;
    background: rgba(255, 253, 248, 0.98);
    border: 1px solid rgba(31, 37, 32, 0.12);
    box-shadow: 0 18px 36px rgba(32, 29, 20, 0.16);
}

.autocomplete-list.is-visible {
    display: grid;
    gap: 0.25rem;
}

.autocomplete-option {
    border: none;
    border-radius: 0.7rem;
    background: rgba(31, 106, 82, 0.08);
    color: var(--text);
    padding: 0.6rem 0.7rem;
    text-align: left;
    cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option:focus {
    background: rgba(31, 106, 82, 0.16);
    outline: none;
}

.autocomplete-hint {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.cleaner-runner {
    --cleaner-skin: #efc4a1;
    --cleaner-hair: #6d4d41;
    --cleaner-uniform: #2a725c;
    --cleaner-uniform-dark: #214c3e;
    --cleaner-apron: #fff8ef;
    --cleaner-broom: #9a683d;
    --cleaner-bristles: #e4a63c;
    --cleaner-start-offset: calc(-100% - 1.5rem);
    --cleaner-end-offset: calc(100vw + 1.5rem);
    position: fixed;
    left: 0;
    bottom: calc(max(0.35rem, env(safe-area-inset-bottom)) + 0.15rem);
    width: clamp(6.4rem, 18vw, 9rem);
    aspect-ratio: 220 / 160;
    pointer-events: none;
    z-index: 120;
    opacity: 0;
    transform: translate3d(var(--cleaner-start-offset), 0, 0);
    will-change: transform, opacity;
}

@supports (width: 100dvw) {
    .cleaner-runner {
        --cleaner-end-offset: calc(100dvw + 1.5rem);
    }
}

.cleaner-runner.is-running {
    animation: cleaner-cross-screen 8.5s linear forwards;
}

.cleaner-runner__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.cleaner-runner__shadow {
    fill: rgba(54, 41, 28, 0.2);
    filter: blur(4px);
}

.cleaner-runner__model {
    transform-box: fill-box;
    transform-origin: center bottom;
}

.cleaner-runner__head {
    fill: var(--cleaner-skin);
}

.cleaner-runner__hair,
.cleaner-runner__hair-bun {
    fill: var(--cleaner-hair);
}

.cleaner-runner__dress {
    fill: var(--cleaner-uniform);
    stroke: var(--cleaner-uniform-dark);
    stroke-width: 3;
    stroke-linejoin: round;
}

.cleaner-runner__apron {
    fill: var(--cleaner-apron);
    stroke: rgba(64, 52, 40, 0.14);
    stroke-width: 2;
    stroke-linejoin: round;
}

.cleaner-runner__arm,
.cleaner-runner__leg,
.cleaner-runner__broom {
    transform-box: fill-box;
    transform-origin: center top;
}

.cleaner-runner__arm line {
    fill: none;
    stroke: var(--cleaner-skin);
    stroke-width: 10;
    stroke-linecap: round;
}

.cleaner-runner__leg line,
.cleaner-runner__leg path {
    fill: none;
    stroke: #294d3d;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cleaner-runner__broom-handle {
    fill: none;
    stroke: var(--cleaner-broom);
    stroke-width: 7;
    stroke-linecap: round;
}

.cleaner-runner__broom-head {
    fill: var(--cleaner-bristles);
    stroke: rgba(122, 76, 27, 0.35);
    stroke-width: 2;
    stroke-linejoin: round;
}

.cleaner-runner__arm--back {
    transform: rotate(12deg);
}

.cleaner-runner__arm--front {
    transform: rotate(-10deg);
}

.cleaner-runner__leg--back {
    transform: rotate(8deg);
}

.cleaner-runner__leg--front {
    transform: rotate(-7deg);
}

.cleaner-runner__broom {
    transform-origin: 0 0;
    transform: rotate(7deg);
}

.cleaner-runner.is-running .cleaner-runner__model {
    animation: cleaner-bob 0.46s ease-in-out infinite alternate;
}

.cleaner-runner.is-running .cleaner-runner__arm--back,
.cleaner-runner.is-running .cleaner-runner__leg--front {
    animation: cleaner-swing-forward 0.46s ease-in-out infinite alternate;
}

.cleaner-runner.is-running .cleaner-runner__arm--front,
.cleaner-runner.is-running .cleaner-runner__leg--back {
    animation: cleaner-swing-backward 0.46s ease-in-out infinite alternate;
}

.cleaner-runner.is-running .cleaner-runner__broom {
    animation: cleaner-broom-sway 0.46s ease-in-out infinite alternate;
}

@keyframes cleaner-cross-screen {
    0% {
        opacity: 0;
        transform: translate3d(var(--cleaner-start-offset), 0, 0);
    }

    8% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--cleaner-end-offset), 0, 0);
    }
}

@keyframes cleaner-bob {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-3px);
    }
}

@keyframes cleaner-swing-forward {
    0% {
        transform: rotate(16deg);
    }

    100% {
        transform: rotate(-14deg);
    }
}

@keyframes cleaner-swing-backward {
    0% {
        transform: rotate(-12deg);
    }

    100% {
        transform: rotate(18deg);
    }
}

@keyframes cleaner-broom-sway {
    0% {
        transform: rotate(4deg);
    }

    100% {
        transform: rotate(12deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cleaner-runner {
        display: none;
    }
}

@media (max-width: 960px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .header-actions .button,
    .month-switcher {
        width: 100%;
    }

    .month-switcher .button {
        flex: 1 1 0;
        min-width: 0;
    }

    .form-grid,
    .entry-card {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .field--wide,
    .field--date {
        grid-column: span 3;
    }

    .field--time,
    .field--break,
    .duration-box--entry {
        grid-column: span 2;
    }

    .form-grid--settings .form-actions--settings,
    .form-grid--quick-start .form-actions--quick-start,
    .form-grid--quick-finish .form-actions--quick-finish,
    .form-grid--entry .form-actions--entry-create {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .discard-form {
        justify-content: flex-start;
    }

    .form-grid--quick-finish .form-grid__full,
    .form-grid--entry .form-grid__full,
    .entry-card .entry-card__notes,
    .form-actions--entry-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .cleaner-runner {
        width: clamp(5.4rem, 28vw, 7.2rem);
        bottom: calc(max(0.15rem, env(safe-area-inset-bottom)) + 0.1rem);
    }

    .page-shell {
        width: min(100%, calc(100% - 0.7rem));
        padding: 0.45rem 0 1rem;
    }

    .page-header {
        gap: 0.45rem;
        margin-bottom: 0.65rem;
    }

    .eyebrow {
        display: none;
    }

    .auth-card {
        padding: 1.05rem 1rem 0.95rem;
    }

    .auth-title {
        max-width: none;
        font-size: clamp(1.95rem, 11vw, 2.45rem);
    }

    h1 {
        font-size: clamp(1.3rem, 6.6vw, 1.85rem);
        line-height: 0.98;
    }

    .lead {
        margin-top: 0.28rem;
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .separator {
        display: none;
    }

    .header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .month-switcher {
        grid-column: 1 / -1;
        width: auto;
        gap: 0.35rem;
    }

    .header-actions > .button {
        width: 100%;
        min-width: 0;
    }

    .header-actions .button,
    .month-switcher .button {
        min-height: 2.5rem;
        padding: 0.5rem 0.7rem;
        font-size: 0.92rem;
    }

    .month-switcher .button {
        min-width: 0;
    }

    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
        padding: 0;
    }

    .card,
    .summary-card {
        padding: 0.85rem;
    }

    .summary-card {
        min-width: 0;
        padding: 0.65rem 0.7rem;
    }

    .summary-label {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .summary-value {
        margin-top: 0.15rem;
        font-size: clamp(1rem, 5vw, 1.3rem);
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .form-grid,
    .entry-card {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .form-grid--settings {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .entry-card {
        padding: 0.75rem;
    }

    .entry-card textarea {
        min-height: 4.4rem;
    }

    .field,
    .field--wide,
    .field--date,
    .field--time,
    .field--break,
    .field--full,
    .duration-box--entry,
    .form-actions,
    .form-grid--settings .form-actions--settings,
    .form-grid--quick-start .form-actions--quick-start,
    .form-grid--quick-finish .form-actions--quick-finish,
    .form-grid--entry .form-actions--entry-create {
        grid-column: 1 / -1;
    }

    .form-grid--settings .field--wide,
    .form-grid--settings .form-actions--settings {
        grid-column: span 1;
    }

    .form-grid--settings label span {
        font-size: 0.7rem;
        line-height: 1.15;
    }

    .form-grid--settings input {
        min-height: 2.55rem;
        padding: 0.5rem 0.58rem;
        font-size: clamp(0.82rem, 3.2vw, 0.92rem);
    }

    .form-grid--settings .form-actions--settings {
        align-self: end;
        justify-content: stretch;
    }

    .form-grid--settings .form-actions--settings .button {
        width: 100%;
        min-height: 2.55rem;
        padding: 0.5rem 0.6rem;
        font-size: clamp(0.8rem, 3vw, 0.92rem);
        line-height: 1.15;
        white-space: normal;
    }

    input,
    select,
    textarea,
    .button {
        min-height: 2.95rem;
    }

    textarea {
        min-height: 4.8rem;
    }

    .form-actions,
    .form-actions--entry-card {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .button,
    .discard-form .button {
        width: 100%;
    }

    .auth-actions .button {
        min-width: 0;
    }

    .entry-card .button {
        min-height: 2.95rem;
        padding: 0.72rem 1rem;
    }
}
