/* Palma Notities in de browser. Tokens uit CLAUDE.md: Palma (donker) standaard, Glas (licht) via prefers-color-scheme. */
@font-face { font-family: Outfit; src: url(/fonts/outfit.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ground: #0B0D09; --surface: #14170F; --raised: #1C2017; --line: #2A2F24; --line-strong: #4A5240;
  --ink: #EDE6D6; --muted: #A39C8C; --accent: #9CC28A; --on-accent: #14170F; --info: #8FB7D6;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: #DCE6EA; --surface: #F2F4F2; --raised: #FFFFFF; --line: #C9D2D4; --line-strong: #8C979A;
    --ink: #1D1D1F; --muted: #4A4D52; --accent: #2F6B3A; --on-accent: #FFFFFF; --info: #1F5F8B;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body { margin: 0; min-height: 100vh; background: var(--surface); color: var(--ink); font: 400 16px/1.5 Outfit, system-ui, sans-serif;
  max-width: 760px; margin-inline: auto; }
[hidden] { display: none !important; }
h1, h2 { font-weight: 500; margin: 0; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; }
h2.title { font-size: 30px; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 8px 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 8px 16px; border-radius: 999px; z-index: 9; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mark { font-weight: 500; font-size: 24px; letter-spacing: -.01em; }
.mark span { color: var(--accent); }

input, textarea, select, button { font: inherit; color: inherit; }
input[type=text], input[type=search], input[type=date], input[type=time], input[type=number], input:not([type]), textarea, select {
  width: 100%; min-height: 48px; padding: 10px 16px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 18px; }
textarea { resize: vertical; line-height: 1.5; }
input.big { font-size: 19px; }
input[type=checkbox] { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.btn { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 500; }
.btn.danger { color: var(--info); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.msg { min-height: 24px; margin-top: 12px; }
.notice { padding: 12px 16px; border-radius: 18px; background: var(--raised); border: 1px solid var(--line); color: var(--muted); }

/* Inloggen */
.login { padding: 48px 24px; max-width: 460px; margin: 0 auto; }
.login .mark { font-size: 32px; margin-bottom: 32px; }
.login h1 { margin-bottom: 12px; }
.login form { display: grid; gap: 8px; margin: 24px 0; }
.login label[for=code] { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#code { font-size: 19px; letter-spacing: .08em; text-transform: uppercase; }
.lang { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.lang select { width: auto; min-height: 44px; padding: 4px 12px; }

/* Bovenbalk en tabs */
.top { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .search { flex: 1 1 120px; min-width: 0; }
.top .status { flex-basis: 100%; order: 3; margin: 0; min-height: 21px; }
.menu { position: relative; }
.menu summary { list-style: none; min-height: 44px; display: flex; align-items: center; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: 52px; width: min(300px, 80vw); display: grid; gap: 8px; padding: 16px; background: var(--raised); border: 1px solid var(--line); border-radius: 24px; }
.tabs { display: flex; gap: 8px; padding: 8px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs button { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); }
.tabs button[aria-current] { color: var(--ink); background: var(--raised); border-color: var(--line-strong); font-weight: 500; }
.tabs .add { margin-left: auto; color: var(--on-accent); background: var(--accent); font-weight: 500; }
main { padding: 8px 24px 32px; }
main:focus, main:focus-visible { outline: none; }

/* Duimzone: op telefoonbreedte staan de tabs en "+ Nieuw" onderaan. */
@media (max-width: 719px) {
  .top { padding: 12px 16px; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 2; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-bottom: 0; }
  .tabs button { padding: 8px 12px; }
  main { padding: 8px 16px 112px; }
  .row-main { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
  .row-meta { white-space: normal; }
}

/* Rijen, kaarten en snelle invoer */
.rows, .cards { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding-left: 4px; border-bottom: 1px solid var(--line); }
.row-main { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 4px; background: none; border: 0; text-align: start; cursor: pointer; width: 100%; }
.row-title { font-size: 19px; }
.row-meta { font-size: 14px; color: var(--muted); white-space: nowrap; }
.rows.big .row-title { font-size: 22px; }
.row.done .row-title { text-decoration: line-through; color: var(--muted); }
.row.muted .row-title { color: var(--muted); }
.list-item { border-bottom: 1px solid var(--line); border-radius: 0; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 8px; }
.card { width: 100%; height: 100%; display: grid; align-content: start; gap: 6px; padding: 16px; text-align: start; background: var(--raised); border: 1px solid var(--line); border-radius: 24px; cursor: pointer; }
.card:hover { border-color: var(--line-strong); }
.card-title { font-weight: 500; font-size: 17px; overflow-wrap: anywhere; }
.card-body { display: grid; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.pv.done { text-decoration: line-through; }
.box { display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; border: 1.5px solid var(--muted); border-radius: 3px; vertical-align: -1px; }
.pv.done .box { background: var(--muted); }
.dlg-body > .btn { justify-self: start; }
.quick { display: flex; gap: 8px; margin-top: 12px; }
.quick input { flex: 1; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.bar h2.title { margin: 0; }
.empty { margin: 12px 0; }

/* Dialoog (notitie, taak, lijst) */
dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px; }
dialog::backdrop { background: rgb(0 0 0 / .55); }
.dlg-head, .dlg-foot { display: flex; align-items: center; gap: 8px; padding: 16px; }
.dlg-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-foot { flex-wrap: wrap; border-top: 1px solid var(--line); }
.dlg-foot:empty { display: none; }
.dlg-body { display: grid; gap: 12px; padding: 16px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.week { display: flex; flex-wrap: wrap; gap: 0 16px; }
.note-view { display: grid; gap: 2px; min-height: 120px; }
.note-view p { margin: 0; overflow-wrap: anywhere; }
.note-view .gap { height: 12px; }
.line.done span { text-decoration: line-through; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .card, .tabs button { transition: border-color .15s, background-color .15s; }
}
