:root {
    --fg: #222;
    --muted: #777;
    --bg: #fafaf7;
    --accent: #2b6cb0;
    --border: #ddd;
    --done: #999;
    --error-bg: #fdecea;
    --error-fg: #8b1a1a;
    --banner-bg: #fff8d8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.5;
}

header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fg);
    text-decoration: none;
    text-align: center;
}

.nav-left { justify-self: start; }
.nav-right { justify-self: end; }

nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

nav.nav-left a { margin-right: 1rem; }
nav.nav-right a { margin-left: 1rem; }

nav a:hover { text-decoration: underline; }

main {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.checklist,
.day-nav,
.banner {
    max-width: 720px;
}

h1 { margin-top: 0; }
h2 { margin-top: 2rem; font-size: 1.1rem; color: #444; }

.day-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.day-nav .btn,
.day-nav button {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    text-decoration: none;
    color: var(--fg);
    font-size: 0.9rem;
    cursor: pointer;
}

.day-nav input[type="date"] {
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.banner {
    background: var(--banner-bg);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.checklist {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.checklist li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.checklist li.task form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.checklist li.done .task-name {
    color: var(--done);
    text-decoration: line-through;
}

.checklist li.over-budget {
    opacity: 0.55;
}

.checklist li.over-budget .suffix {
    color: var(--error-fg);
}

.checkbox,
.checkbox-static {
    font-size: 1.4rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--fg);
}

.checkbox-static { cursor: default; }

.task-name { flex: 1; }
.suffix { color: var(--muted); font-size: 0.85rem; }
.note { color: var(--muted); font-style: italic; }
.muted { color: var(--muted); font-style: italic; }

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    table-layout: fixed;
}

.tasks-table col.col-name { width: auto; }
.tasks-table col.col-frequency { width: 10rem; }
.tasks-table col.col-every { width: 6rem; }
.tasks-table col.col-start { width: 9rem; }
.tasks-table col.col-time { width: 6rem; }
.tasks-table col.col-notes { width: 14rem; }
.tasks-table col.col-remove { width: 2.25rem; }

.tasks-table th,
.tasks-table td {
    padding: 0.4rem;
    text-align: left;
    vertical-align: middle;
}

.tasks-table th {
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-weight: 500;
}

.tasks-table input,
.tasks-table select {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.9rem;
}

.tasks-table .remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
}

.actions button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.actions button[type="submit"] {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.error {
    background: var(--error-bg);
    color: var(--error-fg);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.settings-form {
    max-width: 540px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.settings-form label,
.settings-form .label {
    font-weight: 500;
    color: #444;
}

.settings-form input[type="number"],
.settings-form textarea {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

.settings-form input[type="number"] {
    width: 6rem;
}

.settings-form textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.settings-form .hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.weekday-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.weekday {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-weight: 400;
}
