:root {
  --bg: #f6f5f1;
  --surface: #fffefa;
  --text: #243d35;
  --muted: #66716b;
  --line: #dddeda;
  --accent: #2f6f5e;
  --accent-text: #ffffff;
  --soft: #e9f0e8;
  --note: #f4ecdf;
  --danger: #a33a2c;
  --danger-text: #ffffff;
  --danger-soft: #f8e5e0;
  --warn-bg: #fff0ce;
  --shadow: 0 3px 12px #243d3506;
  --menu-shadow: 0 10px 28px #243d3524;
  --backdrop: #141e1966;
  --toast-bg: #2f6f5e;
  --toast-text: #ffffff;
  --toast-action-bg: #ffffff;
  --toast-action: #2f6f5e;
  --important: #b54708;
  --important-text: #ffffff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161e1a;
    --surface: #202b25;
    --text: #ebeee7;
    --muted: #b0bbb2;
    --line: #3c4a40;
    --accent: #9dd2b8;
    --accent-text: #162c22;
    --soft: #2a3b2f;
    --note: #373226;
    --danger: #ffac9c;
    --danger-text: #3a120b;
    --danger-soft: #4a2c26;
    --warn-bg: #443923;
    --shadow: none;
    --menu-shadow: 0 10px 28px #0000005c;
    --backdrop: #00000080;
    --toast-bg: #9dd2b8;
    --toast-text: #162c22;
    --toast-action-bg: #162c22;
    --toast-action: #9dd2b8;
    --important: #f2a65e;
    --important-text: #2b1a08;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 18px;
  color: var(--text);
  background: var(--surface);
}
button, summary, select { cursor: pointer; }
button:hover, select:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); }
button.link { background: none; border: 0; padding: 10px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
button.link.danger { color: var(--danger); }
button.icon { padding: 6px 12px; min-width: 44px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
input, textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; letter-spacing: -0.045em; margin-bottom: 12px; }
h2 { font-size: 1.125rem; margin-bottom: 0; font-weight: 650; }
h3 { font-size: 1.3rem; line-height: 1.35; letter-spacing: -0.025em; }
main { max-width: 1168px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
main:focus { outline: none; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { display: block; padding: 12px; background: var(--surface); }
.masthead { max-width: 1168px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 24px max(24px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; text-decoration: none; color: var(--text); }
.brand-mark { background: var(--accent); color: var(--accent-text); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 0 20px; }
.eyebrow { color: var(--accent); font-size: 0.9375rem; font-weight: 600; margin-bottom: 12px; }
.intro { color: var(--muted); margin-bottom: 0; max-width: 440px; }
.create-actions { display: flex; gap: 10px; flex-shrink: 0; }
form { margin: 0; }
.browse { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.search-field { flex: 1; min-width: 0; }
.search-field input { background: var(--bg); }
.reset-search { padding: 10px 4px; }
.meta { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 24px; align-items: start; }
.group h2 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.group-count { color: var(--muted); font-size: 0.9375rem; font-weight: 400; }
.rows { container-type: inline-size; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.row-line { display: flex; align-items: center; border-top: 1px solid var(--line); }
.row-line:first-child { border-top: 0; }
.row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 14px; color: var(--text); text-decoration: none; }
/* Held to delete (app.js): no selection or phone link menu while holding. */
[data-press-delete] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.row-line:hover { background: var(--soft); }
/* A bin beside every row, item, attachment and in a note's top bar; holding
   a row asks the same (app.js). */
.row-delete, .item-delete, .bar-delete button, .file-delete, .deleted-item .purge { display: grid; place-items: center; flex: none; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.row-delete:hover, .item-delete:hover, .bar-delete button:hover, .file-delete:hover, .deleted-item .purge:hover { color: var(--danger); background: var(--danger-soft); }
.row-delete { margin-right: 4px; }
.row:focus-visible { outline-offset: -3px; }
.row-icon { flex: none; width: 24px; text-align: center; color: var(--accent); }
img.logo { display: block; width: 22px; height: 22px; border-radius: 5px; }
.row-icon img.logo { margin: 0 auto; }
.row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row-title.untitled { color: var(--muted); font-weight: 400; }
.row-meta { flex: none; display: flex; gap: 10px; color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }
.row-count { color: var(--accent); font-variant-numeric: tabular-nums; }
.row-count.complete { color: var(--muted); }
.row-lock { flex: none; display: grid; color: var(--muted); }
.trash-link { grid-column: 1 / -1; margin: 0; }
.trash-link a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); text-decoration: none; }
.trash-link a:hover { color: var(--text); }
/* Important lists, notes and items carry a round "!" and come first. */
.flag { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--important); color: var(--important-text); font-size: 0.8125rem; font-weight: 800; line-height: 1; }
.important-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.important-toggle .flag { background: none; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.important-toggle[aria-pressed="true"] { color: var(--important); border-color: var(--important); font-weight: 600; }
.important-toggle[aria-pressed="true"] .flag { background: var(--important); color: var(--important-text); box-shadow: none; }
.paper-heading .important-toggle { min-height: 40px; padding: 4px 14px 4px 10px; border-radius: 20px; font-size: 0.9375rem; }
.heading-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.owner-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.kind-label { display: inline-flex; gap: 7px; align-items: center; border-radius: 6px; padding: 3px 9px; font-size: 0.9375rem; font-weight: 600; color: var(--accent); background: var(--soft); }
progress { height: 6px; border: 0; border-radius: 3px; background: var(--line); color: var(--accent); overflow: hidden; -webkit-appearance: none; appearance: none; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 24px; border: 1px dashed var(--line); border-radius: 18px; }
.empty-state p { max-width: 480px; color: var(--muted); margin: 0 auto 16px; }
.empty-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; background: var(--soft); color: var(--accent); border-radius: 18px; font-size: 1.7rem; margin-bottom: 20px; }
.empty-state h3 { margin-bottom: 10px; }
.device-help { margin-top: 36px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; }
summary { min-height: 44px; padding: 10px 0; }
.device-help p { max-width: 720px; margin: 8px 0 14px; }
.account { display: flex; justify-content: space-between; gap: 12px 24px; align-items: baseline; flex-wrap: wrap; padding-top: 12px; }
.account-actions { display: flex; gap: 24px; align-items: flex-start; font-size: 0.9375rem; }
.account-menu { color: var(--muted); }
.banner { position: fixed; z-index: 5; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100% - 32px)); padding: 12px 20px; border-radius: 12px; background: var(--warn-bg); color: var(--text); box-shadow: 0 4px 16px #0000002e; text-align: center; font-size: 0.9375rem; }
.note-page { max-width: 880px; }
.bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.editor-bar { position: sticky; top: 0; z-index: 6; flex-wrap: nowrap; gap: 8px; padding: max(12px, env(safe-area-inset-top)) 0 8px; background: var(--bg); }
.back { display: inline-flex; align-items: center; gap: 2px; flex: 1 1 auto; min-height: 44px; font-weight: 600; text-decoration: none; }
.save-status { min-width: 0; font-size: 0.9375rem; color: var(--muted); text-align: right; }
.menu summary::-webkit-details-marker { display: none; }
.note-menu { position: relative; }
.note-menu summary { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; list-style: none; border-radius: 12px; color: var(--muted); }
.note-menu[open] summary { background: var(--soft); }
.menu-panel { position: absolute; top: 100%; right: 0; z-index: 7; display: flex; flex-direction: column; min-width: 240px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--menu-shadow); }
button.menu-item { display: flex; align-items: center; width: 100%; padding: 0 12px; border: 0; border-radius: 10px; background: none; text-align: left; white-space: nowrap; }
button.menu-item:hover { background: var(--soft); }
.paper { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; padding: 32px; }
.paper-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.category-menu { position: relative; }
.category-menu summary { display: inline-flex; align-items: center; gap: 6px; padding: 0; list-style: none; border-radius: 8px; }
.category-menu summary::after { content: ""; width: 7px; height: 7px; margin: 0 4px 4px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.category-menu summary:hover .kind-label, .category-menu[open] .kind-label { box-shadow: inset 0 0 0 1px var(--accent); }
.category-panel { left: 0; right: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: min(360px, calc(100vw - 56px)); }
.category-panel .menu-item { gap: 10px; }
.category-panel .menu-item[aria-pressed="true"] { background: var(--soft); font-weight: 700; }
.category-clear { grid-column: 1 / -1; color: var(--muted); }
#editor { display: grid; gap: 16px; margin-bottom: 20px; }
#editor input[name="title"] { font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; border-color: transparent; background: transparent; padding: 6px 0; border-radius: 2px; }
#editor textarea { min-height: 40vh; resize: none; background: transparent; border-color: transparent; padding: 8px 0; line-height: 1.8; border-radius: 2px; overflow-wrap: anywhere; }
.conflict { background: var(--warn-bg); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.conflict .theirs { background: var(--surface); border-radius: 8px; padding: 12px; margin: 12px 0; max-height: 40vh; overflow: auto; }
.conflict pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0; }
.theirs-title { font-weight: 600; margin: 0 0 4px; }
.conflict button { margin: 4px 0; }

/* Lists. On a PC the add field sits above the items; on a phone it sticks to
   the bottom, by the thumb and above the keyboard. */
.list-body { display: flex; flex-direction: column; }
.add-item { order: -2; display: flex; gap: 10px; margin-bottom: 20px; }
.add-item input { height: 50px; border-radius: 25px; padding: 0 18px; background: var(--bg); }
.add-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; }
.attach-button { display: grid; place-items: center; flex: none; width: 50px; height: 50px; padding: 0; border-radius: 50%; color: var(--muted); }
.sort-bar { order: -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--soft); }
.sort-bar p { margin: 0; font-size: 0.9375rem; }
.item-save-status { order: -1; margin-bottom: 12px; }
.list-summary { margin-bottom: 12px; }
.list-summary progress { display: block; width: 100%; margin-top: 8px; }
.items { display: grid; }
.open-items { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; border-bottom: 1px solid var(--line); background: var(--surface); }
button.item-tick { flex: none; display: grid; place-items: center; width: 52px; min-height: 56px; padding: 0 4px 0 0; border: 0; border-radius: 0; background: none; }
.item-tick:focus-visible { outline-offset: -3px; }
.tick-box { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--muted); border-radius: 8px; }
.item-tick:hover .tick-box { border-color: var(--accent); }
.item-tick[aria-pressed="true"] .tick-box { background: var(--accent); border-color: var(--accent); }
.item-tick[aria-pressed="true"] .tick-box::after { content: ""; width: 6px; height: 12px; margin-top: -3px; border: solid var(--accent-text); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.item-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 4px 8px 0; line-height: 1.35; cursor: default; }
.item-text { overflow-wrap: anywhere; }
.item:has(.item-tick[aria-pressed="true"]) .flag { opacity: 0.55; }
.item:has(.item-tick[aria-pressed="true"]) .item-text { color: var(--muted); text-decoration: line-through; }
.item-delete { min-height: 56px; }
.item-menu { position: relative; flex: none; }
.item-menu summary { display: grid; place-items: center; width: 44px; min-height: 56px; padding: 0; list-style: none; border-radius: 10px; color: var(--muted); }
.item-menu summary:hover { color: var(--accent); background: var(--soft); }
.item-menu[open] summary { background: var(--soft); }
.item-menu[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 30; background: var(--backdrop); cursor: default; }
.item-sheet { position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; display: grid; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-radius: 20px 20px 0 0; background: var(--surface); box-shadow: 0 -8px 24px #00000024; }
.item-sheet::before { content: ""; justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.item-sheet label { margin-bottom: -6px; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.item-sheet input { background: var(--bg); }
.item-sheet button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sheet-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.item-grip { display: none; flex: none; place-items: center; width: 48px; min-height: 56px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.is-sorting .item-grip { display: grid; }
.item-grip:focus-visible { outline-offset: -3px; }
.is-sorting .item-menu, .is-sorting .item-delete, .is-sorting .done, .is-sorting .item-tick { display: none; }
.is-sorting .item-body { padding-left: 4px; }
.item.is-dragging { position: relative; z-index: 2; border-radius: 12px; box-shadow: 0 10px 28px #243d3538, 0 0 0 1px var(--line); }
.is-dragging .item-grip { color: var(--accent); cursor: grabbing; }
.list-empty { padding: 24px 4px; color: var(--muted); }
.list-empty p { margin: 0 0 12px; }
.done > summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 4px; list-style: none; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.done > summary::-webkit-details-marker { display: none; }
.done > summary::after { content: ""; width: 8px; height: 8px; margin: 0 8px 4px 0; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 150ms; }
.done[open] > summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 0 4px; }
.done-actions button { min-height: 44px; padding: 8px 16px; border-radius: 22px; font-size: 0.9375rem; }
.deleted-help { padding: 12px 4px 4px; }
.deleted-items { margin: 0; padding: 0; list-style: none; }
.deleted-item { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 0 4px 4px; border-bottom: 1px solid var(--line); }
.deleted-text { flex: 1; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.deleted-item .restore { flex: none; min-height: 40px; padding: 4px 14px; border-radius: 20px; font-size: 0.9375rem; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(480px, calc(100% - 24px)); min-height: 52px; padding: 6px 6px 6px 16px; border-radius: 14px; background: var(--toast-bg); color: var(--toast-text); box-shadow: 0 6px 20px #00000038; font-size: 0.9375rem; font-weight: 600; }
.toast-text { overflow-wrap: anywhere; }
.toast button { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--toast-action-bg); color: var(--toast-action); font-weight: 700; }
.files { margin-top: 28px; padding: 20px 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.files-heading { margin: 0 0 4px; font-size: 1rem; color: var(--muted); }
.file:last-child { border-bottom: 0; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.file img { max-width: 100%; max-height: 160px; border-radius: 8px; display: block; }
.file a { flex: 1; min-width: 0; }

/* Trash: deleted lists and notes open to show what they hold. */
.trash-page h1 { margin: 8px 0 8px; }
.trash-intro { max-width: 640px; margin-bottom: 24px; }
.trash-entry { border-top: 1px solid var(--line); }
.trash-entry:first-child { border-top: 0; }
.trash-entry > summary { min-height: 50px; padding: 8px 14px; list-style: none; cursor: pointer; }
.trash-entry > summary::-webkit-details-marker { display: none; }
.trash-entry > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 4px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.trash-entry[open] > summary { background: var(--soft); }
.trash-entry[open] > summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
.trash-preview { display: grid; gap: 10px; padding: 12px 16px 16px 50px; }
.trash-body { margin: 0; max-height: 40vh; overflow: auto; overflow-wrap: anywhere; }
.trash-list { margin: 0; padding-left: 20px; }
.trash-list .is-done { color: var(--muted); text-decoration: line-through; }
.trash-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.trash-footer { display: flex; justify-content: flex-end; margin-top: 16px; }

/* The question before deleting. */
.dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 18px 48px #0000004d; }
.dialog::backdrop { background: #141e1980; }
.dialog-body { display: grid; justify-items: center; gap: 6px; padding: 28px 24px 20px; text-align: center; }
.dialog-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); }
.dialog-icon svg { width: 26px; height: 26px; }
.dialog h2 { margin: 0; font-size: 1.25rem; line-height: 1.35; overflow-wrap: anywhere; }
.dialog p { margin: 0; color: var(--muted); }
.dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 18px; }
button.dialog-ok { background: var(--danger); border-color: var(--danger); color: var(--danger-text); font-weight: 600; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.login { max-width: 440px; margin: 12vh auto 0; padding: 36px; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.login h1 { font-size: 2rem; text-align: center; margin: 0; }
.login-intro { color: var(--muted); text-align: center; margin-bottom: 12px; }
.login .meta { margin-top: 8px; text-align: center; }
.error { color: var(--danger); margin: 0; }
@media (min-width: 700px) {
  .item-menu[open] > summary::before { display: none; }
  .item-sheet { position: absolute; top: 100%; right: 0; left: auto; bottom: auto; width: 340px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--menu-shadow); }
  .item-sheet::before { display: none; }
}
@media (max-width: 699px) {
  .add-item, .sort-bar { order: 1; position: sticky; bottom: 0; z-index: 3; margin: 0 -16px -20px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; background: var(--surface); }
  .add-button { width: 50px; height: 50px; padding: 0; border-radius: 50%; }
  .add-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .paper-heading { margin-bottom: 12px; }
}
@media (max-width: 1000px) {
  .welcome { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 359px) {
  .item-delete { display: none; }
  .trash-preview { padding-left: 16px; }
}
@media (max-width: 600px) {
  main { padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .masthead { padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); }
  .brand { font-size: 1.125rem; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .welcome { padding: 16px 0 24px; gap: 20px; }
  .welcome .eyebrow, .welcome .intro { display: none; }
  .welcome h1 { margin-bottom: 0; }
  .create-actions { width: 100%; }
  .create-actions form { flex: 1; }
  .create-actions button { width: 100%; }
  .browse { flex-wrap: wrap; margin-bottom: 20px; }
  .search-field { flex-basis: 100%; }
  .browse select { flex: 1; min-width: 0; }
  .groups { gap: 20px; }
  .account { display: block; }
  .account-actions { margin-top: 8px; }
  .paper, .files { padding: 20px 16px; border-radius: 16px; }
  .paper-heading { flex-wrap: wrap; margin-bottom: 24px; }
  .bar { gap: 8px 12px; }
  .login { margin-top: 8vh; padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
