/* Mobile-first; udvides på bredere skærme nederst. Lyst/mørkt tema følger enheden. */
:root {
  --bg: #f4f6f5; --card: #fff; --text: #1d2b27; --muted: #6a7a75; --line: #dde4e1;
  --brand: #2f6f5e; --ok: #2f7d4f; --bad: #c0392b; --bad-bg: #fdecea;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a19; --card: #1f2625; --text: #e6eeeb; --muted: #94a5a0; --line: #324039; --brand: #4fa38b; --ok: #4caf7a; --bad: #ef6b5c; --bad-bg: #3a2220; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 1.5rem; margin: .5rem 0; }
h2 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }

/* Header: på mobil er navigationen en fast bundbjælke */
.top { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; background: var(--brand); color: #fff; }
.top .link { color: #fff; }
.top nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.top nav a { flex: 1; text-align: center; padding: .85rem .5rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.top nav a.on { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
main { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 6rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin-bottom: .75rem; }
.list { list-style: none; padding: 0; margin: 0; }
.item.late { border-color: var(--bad); background: var(--bad-bg); border-left-width: 6px; }
.item.done { opacity: .55; }
.item.done .item-title { text-decoration: line-through; }
.item-title { font-weight: 700; font-size: 1.05rem; }
.meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.meta a { color: var(--brand); }
.comment { margin-top: .4rem; font-size: .95rem; }
.actions { display: flex; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }

.btn, .link { font: inherit; cursor: pointer; }
.btn { display: inline-block; padding: .55rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; min-height: 42px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.btn.danger { color: var(--bad); }
.link { background: none; border: 0; padding: .3rem; text-decoration: underline; }

details > summary { list-style: none; text-align: center; }
details > summary::-webkit-details-marker { display: none; }
.form { display: grid; gap: .7rem; margin-top: .9rem; }
.form label, .login-card label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }
.row { display: flex; gap: .6rem; } .row > label { flex: 1; }
input, select, textarea { width: 100%; font: inherit; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }

.login { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card { width: 100%; max-width: 340px; display: grid; gap: .9rem; }
.err { color: var(--bad); margin: 0; }

/* Større skærme: navigation i headeren, knapper kompakte */
@media (min-width: 720px) {
  .top nav { position: static; background: none; border: 0; padding: 0; gap: .5rem; }
  .top nav a { color: #ffffffcc; padding: .4rem .9rem; border-radius: 8px; box-shadow: none; }
  .top nav a.on { color: #fff; background: #ffffff26; box-shadow: none; }
  main { padding-bottom: 2rem; }
  .item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
  .actions { margin-top: 0; flex-wrap: nowrap; }
  .btn { min-height: 0; padding: .4rem .8rem; }
  details > summary.btn { min-height: 0; }
}
