:root {
    --nav-height: 56px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.45;
}

strong, b { color: var(--text-strong); font-weight: 600; }

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: .5rem 1rem;
    padding-top: calc(.5rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    background: var(--accent-light);
    border-bottom: 3px solid var(--accent);
}

.app-header a { display: inline-flex; min-height: 44px; align-items: center; }
.app-header img { display: block; height: 32px; width: auto; }
.login-logo { display: block; height: 44px; width: auto; margin: 0 0 1.5rem; }

.page {
    max-width: 40rem;
    margin: 0 auto;
    padding: 1rem;
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
}

.page.with-nav {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 1rem);
}

h1, h2 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-strong);
}
h1 { font-size: 1.75rem; line-height: 1.1; margin: 0 0 1rem; padding-bottom: .4rem; border-bottom: 3px solid var(--accent); }
h2 { font-size: 1.35rem; margin: 1.5rem 0 .75rem; }

a { color: var(--text-strong); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.stack { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }

label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; color: var(--text-strong); }

label.check { flex-direction: row; align-items: center; gap: .5rem; min-height: 44px; font-weight: 500; color: var(--text); }

input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); }

input:not([type=checkbox]), select, textarea {
    min-height: 44px;
    padding: .5rem .75rem;
    font: inherit;
    color: var(--text-strong);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
}

input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: .5rem 1rem;
    font: inherit;
    font-weight: 600;
    color: var(--text-strong);
    background: var(--card);
    border: 1px solid var(--text-strong);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

.btn.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

.error { color: var(--error); font-weight: 600; }
.notice { color: var(--ok); font-weight: 600; }
.muted { color: var(--text); font-size: .9rem; }

.cards, .menu { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 1rem; }
.card.inactive { opacity: .65; }
.card summary { display: flex; flex-direction: column; min-height: 44px; justify-content: center; padding: .5rem 0; cursor: pointer; }
.card details[open] summary { margin-bottom: .75rem; }
.card details > form:last-child { padding-bottom: .5rem; }

.menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
}

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

.bottom-nav a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--nav-height);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.bottom-nav a.active { color: var(--text-strong); background: var(--accent-light); box-shadow: inset 0 4px 0 var(--accent); }

textarea { width: 100%; font: inherit; color: var(--text-strong); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; background: var(--card); }

fieldset.assignees { border: 1px solid var(--line); border-radius: 8px; padding: .25rem .75rem; margin: 0; }
fieldset.assignees legend { font-weight: 600; color: var(--text-strong); padding: 0 .25rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.task-row {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-height: 56px;
    padding: .6rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 6px solid var(--accent);
    border-radius: 10px;
    text-decoration: none;
}
.task-row.overdue { border-left-color: var(--overdue); background: var(--overdue-bg); }
.task-row.archived { opacity: .65; }
.task-title { color: var(--text-strong); font-weight: 600; }
.task-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; color: var(--text); font-size: .9rem; font-weight: 500; }

.recurring { margin-right: .35rem; color: var(--text-strong); font-weight: 700; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: var(--accent-light); color: var(--text-strong); font-size: .85rem; font-weight: 600; }
.badge.status-inprogress { background: var(--accent); color: var(--on-accent); }
.badge.status-done { background: var(--line); }
.overdue-text { color: var(--overdue); font-weight: 600; }

.task-head p { margin: .25rem 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.btn.big { min-height: 64px; width: 100%; font-size: 1.25rem; }
.btn.wide { width: 100%; }
.done-box { margin-bottom: .75rem; }
.done-box summary { list-style: none; cursor: pointer; }
.done-box summary::-webkit-details-marker { display: none; }
.done-box form { margin-top: .75rem; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions form { margin: 0; }

.history { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.history li { display: flex; flex-direction: column; gap: .1rem; padding-left: .75rem; border-left: 3px solid var(--line); }

.history .thumb { display: block; max-width: 100%; width: 12rem; height: auto; max-height: 12rem; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }

/* Time booking: quick-pick radios rendered as large buttons (no JS) */
.quick-pick { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; margin: 0; padding: 0; }
.quick-pick legend { padding: 0; margin-bottom: .25rem; font-weight: 600; color: var(--text-strong); }
.quick-pick label { position: relative; flex-direction: row; font-weight: 600; }
.quick-pick input[type=radio] { position: absolute; opacity: 0; width: 100%; height: 100%; min-height: 0; margin: 0; cursor: pointer; }
.quick-pick span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; min-height: 52px; padding: .5rem 1rem;
    color: var(--text-strong); background: var(--card);
    border: 1px solid var(--text-strong); border-radius: 8px;
}
.quick-pick input:checked + span { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.quick-pick input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.time-total { font-weight: 600; color: var(--text-strong); }
.history .row-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.history .row-actions form { margin: 0; }

/* Attendance: Kommen/Gehen is the first element of the start page, full width, one tap */
.clock-box { margin: 0 0 .5rem; }
.btn.clock { min-height: 72px; font-size: 1.5rem; flex-direction: column; line-height: 1.2; }
.btn.clock small { font-size: 1rem; font-weight: 500; }
.btn.clock.come { color: var(--on-come); background: var(--come); border-color: var(--come); }
.clock-hint { margin: 0 0 .75rem; padding: .75rem 1rem; background: var(--accent-light); border-left: 6px solid var(--accent); border-radius: 10px; color: var(--text-strong); font-weight: 600; }
.clock-link { margin: 0 0 1rem; }

.month-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 1rem; }
.att-days, .att-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.att-day { border: 1px solid var(--line); border-radius: 10px; padding: .5rem 1rem; }
.att-day-head { display: flex; justify-content: space-between; color: var(--text-strong); }
.att-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.att-time { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.att-log { flex-basis: 100%; }
.att-log summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.att-log ul { margin: 0; padding-left: 1.25rem; }

fieldset.time-pair { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; margin: 0; padding: 0; }
fieldset.time-pair legend { padding: 0; margin-bottom: .25rem; font-weight: 600; color: var(--text-strong); }
fieldset.time-pair input { flex: 1 1 9rem; }

/* Übersicht (what was done during attendance) */
.sum-person { margin: 0 0 1.5rem; }
.sum-box { border: 1px solid var(--line); border-radius: 10px; padding: 0 1rem 1rem; margin: 0 0 .75rem; }
.sum-box.outside { background: var(--accent-light); }
.sum-box h3 { margin: 1rem 0 .5rem; color: var(--text-strong); }
.sum-banner { background: var(--accent-light); border-left: 4px solid var(--accent); color: var(--text-strong); padding: .5rem .75rem; margin: 0 0 .5rem; }
.sum-tasks { list-style: none; margin: 0; padding: 0; }
.sum-task { display: flex; align-items: center; gap: .75rem; min-height: 44px; padding: .25rem 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.sum-check { flex: 0 0 1.5rem; text-align: center; font-weight: 700; color: var(--ok); }
.sum-main { display: flex; flex-direction: column; }

/* Meldungen */
.nav-badge { display: inline-block; min-width: 1.4rem; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .85rem; line-height: 1.4rem; text-align: center; }
.report-text { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.photo-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.photo-grid .thumb, .origin .thumb { display: block; width: 12rem; max-width: 100%; height: auto; max-height: 12rem; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }
.origin { border-left: 4px solid var(--accent); background: var(--accent-light); border-radius: 0 10px 10px 0; padding: .5rem 1rem; margin: 0 0 1rem; }
.origin p { margin: .25rem 0; }

/* Notifications: bell in the header, "Neu für dich" lists */
.bell { position: relative; min-width: 44px; justify-content: center; color: var(--text-strong); text-decoration: none; gap: .1rem; }
.bell-icon { display: block; }
.bell-count { margin-left: 0; }
.notes form { margin: 0; }
.note {
    display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; width: 100%; min-height: 48px;
    padding: .75rem 1rem; text-align: left; font: inherit; color: var(--text-strong);
    background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.note.unread { border-left: 6px solid var(--accent); font-weight: 600; }
.note.read { color: var(--text); font-weight: 400; background: transparent; }
.note-when { font-size: .85rem; font-weight: 400; color: var(--text); }
.news { margin: 0 0 1rem; }
.news h2 { margin: 0 0 .5rem; }
fieldset.settings { border: 0; margin: 0 0 .5rem; padding: 0; }
fieldset.settings legend { padding: 0; margin-bottom: .25rem; font-weight: 600; color: var(--text-strong); }

/* Install hint and push controls: hidden until push.js adds "show" */
.js-reveal { display: none; }
.js-reveal.show { display: block; }
button.js-reveal.show { display: inline-flex; }
.install-hint { padding: .75rem 1rem; margin: 0 0 1rem; background: var(--accent-light); border: 1px solid var(--line); border-radius: 8px; }
.install-hint p { margin: 0 0 .5rem; }
.install-hint .btn { margin-top: .25rem; }
.steps { padding-left: 1.5rem; }
.steps li { margin-bottom: .75rem; }
.share-icon { width: 1.25em; height: 1.25em; vertical-align: -.25em; }

.report-actions { display: flex; gap: .5rem; margin: 0 0 1rem; }
.report-actions .btn { flex: 1; }
.table-scroll { overflow-x: auto; margin: 0 0 1rem; }
.report-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.report-table th, .report-table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-table th { background: var(--accent-light); color: var(--text-strong); }
.report-table .num { text-align: right; white-space: nowrap; }
.report-table .day-sum td { font-style: italic; }

/* Planung (calendar, backlog) */
.plan-head { margin: 0 0 .5rem; color: var(--text-strong); font-weight: 600; }
.plan-details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
