:root {
    --bg: #fafafa;
    --fg: #1a1a1a;
    --accent: #0f766e;
    --border: #e0e0e0;
    --nav-height: 56px;
}

* { box-sizing: border-box; }

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

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.app-main {
    padding: 1rem;
    padding-bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
    max-width: 720px;
    margin: 0 auto;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: #fff;
    border-top: 1px solid var(--border);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
}

.bottom-nav a.active {
    color: var(--accent);
    font-weight: 600;
}

h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }

button, .btn-primary, .btn-secondary {
    font: inherit;
    padding: 0.65rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    min-height: 44px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    width: 100%;
}

.btn-secondary { background: #fff; }

.login-wrap {
    max-width: 360px;
    margin: 15vh auto 0;
    padding: 1rem;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }

.login-form input {
    font: inherit;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 44px;
}

.login-error { color: #b91c1c; }

.muted { color: #666; }

.toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }

.text-input {
    font: inherit;
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 44px;
    background: #fff;
}

.btn-inline { width: auto; white-space: nowrap; }

.btn-danger {
    background: #b91c1c;
    color: #fff;
    border-color: #b91c1c;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.checkbox-row input { min-height: auto; width: 1.1rem; height: 1.1rem; }

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

.card-row {
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    min-height: 44px;
}

.card-row.is-archived { opacity: 0.55; }

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

.card-title { font-weight: 600; }

.card-row-sub { color: #666; font-size: 0.85rem; margin-top: 0.2rem; }

.badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #e6f2f1;
    color: var(--accent);
}

.badge-muted { background: #eee; color: #666; }

.back-link { display: inline-block; margin-bottom: 0.5rem; color: var(--accent); text-decoration: none; }

.detail-list { margin: 0 0 1.5rem; }

.detail-list dt { font-size: 0.75rem; text-transform: uppercase; color: #666; margin-top: 0.75rem; }

.detail-list dd { margin: 0.15rem 0 0; }

.detail-list dd.notes { white-space: pre-wrap; }

.placeholder-section {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-bottom: 1rem;
}

.placeholder-section h2 { font-size: 1rem; margin: 0 0 0.25rem; }

.action-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.field { margin-bottom: 1rem; }

.field label { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; }

.validation-message { color: #b91c1c; font-size: 0.85rem; }

.import-section {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-bottom: 1.5rem;
}

.import-section h2 { font-size: 1rem; margin: 0 0 0.35rem; }

.skipped-list { margin: 0.25rem 0 1rem; padding-left: 1.2rem; color: #666; font-size: 0.9rem; }

.task-group { margin-bottom: 1.25rem; }

.task-group h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #666; margin: 0 0 0.4rem; }

.task-group h2.group-overdue { color: #b91c1c; }

.task-row { display: flex; align-items: flex-start; gap: 0.6rem; }

.task-check { min-height: auto; width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; flex: none; }

.task-body { flex: 1; }

.is-done .card-title, h1.is-done { text-decoration: line-through; color: #666; }

.badge-overdue { background: #fdecec; color: #b91c1c; }

.task-section { border-top: 1px solid var(--border); padding-top: 0.75rem; margin-bottom: 1.5rem; }

.task-section h2 { font-size: 1rem; margin: 0 0 0.5rem; }

.task-section textarea { margin-bottom: 0.5rem; }

.notes { white-space: pre-wrap; }

.step-row { display: flex; gap: 0.35rem; margin-bottom: 0.4rem; align-items: center; }

.btn-icon { width: 44px; padding: 0.4rem; flex: none; text-align: center; }

.plain-link { text-decoration: none; color: inherit; display: block; }

.week-nav { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }

.week-label { flex: 1; text-align: center; font-weight: 600; font-size: 0.95rem; }

.day { margin-bottom: 1.1rem; }

.day h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #666; margin: 0 0 0.4rem; }

.day.is-today h2 { color: var(--accent); }

.day.is-today { border-left: 3px solid var(--accent); padding-left: 0.6rem; margin-left: -0.6rem; }

.day-empty { margin: 0 0 0.25rem; font-size: 0.85rem; }

.feed-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; word-break: break-all; color: #444; margin: 0.25rem 0; }
