:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --side: #efefec;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: #e3e3df;
  --accent: #2f6df6;
  --brand: #3F4450;
  --accent-soft: #e6eefe;
  --danger: #d6372f;
  --warn: #c77700;
  --ok: #2d9a55;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .14);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1d;
    --panel: #252528;
    --side: #212123;
    --text: #f2f2f4;
    --muted: #9a9aa0;
    --faint: #66666c;
    --line: #333337;
    --accent: #6c9bff;
    --brand: #E3E6EC;
    --accent-soft: #26324d;
    --danger: #ff6b63;
    --warn: #f0a638;
    --ok: #5fcf8a;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.noscript { padding: 2rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Layout */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100%; }
.side {
  background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 10px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 12px; font-weight: 700; letter-spacing: .08em; }
.brand svg { width: 18px; height: 20px; flex: none; color: var(--brand); fill: currentColor; }
.side-scroll { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 8px; color: var(--text);
}
.nav-item:hover { background: rgba(127, 127, 127, .12); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .count { margin-left: auto; min-width: 1.2em; text-align: center; font-size: 12px; font-weight: 650; color: var(--muted); background: rgba(127, 127, 127, .16); border-radius: 999px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.nav-item .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .ring { width: 16px; height: 16px; flex: none; }
.nav-row { display: flex; align-items: center; }
.nav-row .nav-item { flex: 1; min-width: 0; }
.nav-row-plus { flex: none; }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nav-head.nav-fold { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; justify-content: flex-start; gap: 6px; }
.nav-head.nav-fold:hover { color: inherit; }
.nav-fold .fold-count { margin-left: auto; opacity: .8; }
.nav-fold .chev { display: inline-block; font-size: 15px; line-height: 1; transition: transform .15s; }
.nav-fold.open .chev { transform: rotate(90deg); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; color: var(--muted); }
.icon-btn:hover { background: rgba(127, 127, 127, .15); color: var(--text); }
.side-foot { border-top: 1px solid var(--line); padding-top: 8px; display: flex; gap: 4px; align-items: center; }
.sync-pill { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; padding-right: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.dot.syncing { background: var(--accent); animation: pulse 1s infinite; }
.dot.offline { background: var(--faint); }
.dot.error { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 12px 24px 0; min-height: 52px; }
.topbar .menu-btn { display: none; }
.content { overflow-y: auto; flex: 1; padding: 6px 24px 120px; }
.page { max-width: 760px; margin: 0 auto; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.page-title h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.page-title .big { width: 28px; height: 28px; flex: none; }
.page-title input.title-edit { font-size: 28px; font-weight: 700; border: 0; background: transparent; width: 100%; padding: 0; letter-spacing: -.01em; }
.page-sub { color: var(--muted); margin: 0 0 12px; }
.notes-edit { width: 100%; border: 0; background: transparent; resize: none; color: var(--muted); padding: 0; margin: 2px 0 10px; }
.section-head { display: flex; align-items: center; gap: 8px; margin: 22px 0 4px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font-weight: 700; }
.section-head .count { color: var(--muted); font-weight: 400; font-size: 13px; }
.section-head .spacer { flex: 1; }
.section-head.evening { color: var(--accent); }
.section-head .title-edit { font-weight: 700; border: 0; background: transparent; padding: 0; flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty svg { color: var(--faint); margin-bottom: 8px; }

/* To-do rows */
.row {
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; margin: 1px -8px;
  border-radius: 9px; position: relative; cursor: default;
}
.row:hover { background: rgba(127, 127, 127, .08); }
.row { user-select: none; -webkit-user-select: none; }
.row.selected { background: var(--accent-soft); }
.row.picked { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.row.tagged { box-shadow: inset 3px 0 0 var(--tagc); }
.row.tagged.picked { box-shadow: inset 3px 0 0 var(--tagc), inset 6px 0 0 var(--accent); }
.tag-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 4px; border: 1.5px solid var(--muted); opacity: .6; }
.tag-dot.set { border-color: transparent; opacity: 1; }
.swatches { display: inline-flex; gap: 6px; align-items: center; vertical-align: middle; margin-left: 6px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; padding: 0; background: var(--sw); }
.swatch.on { border-color: var(--text); }
.swatch.none { background: transparent; border: 1.5px dashed var(--muted); }
.row.dragging { opacity: .4; }
.row.drop-before::before, .row.drop-after::after {
  content: ''; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--accent); border-radius: 2px;
}
.row.drop-before::before { top: -2px; }
.row.drop-after::after { bottom: -2px; }
.check {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 2px solid var(--faint);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; background: transparent;
}
.check:hover { border-color: var(--accent); }
.check.done { background: var(--accent); border-color: var(--accent); }
.check svg { width: 12px; height: 12px; stroke-width: 3; }
.row .body { flex: 1; min-width: 0; }
.row .title { overflow-wrap: anywhere; }
.row.done .title { color: var(--muted); text-decoration: line-through; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: 12.5px; color: var(--muted); align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; }
.chip select { font: inherit; color: inherit; background: transparent; border: 0; max-width: 180px; }
.notes-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 8px; }
.note-list { display: grid; gap: 4px; align-content: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.note-new { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 8px; color: var(--accent); font-weight: 600; }
.note-new:hover { background: var(--accent-soft); }
.note-new svg { width: 14px; height: 14px; }
.note-empty, .note-placeholder { margin: 8px; font-size: 13px; }
.note-row { min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.note-row:hover { background: rgba(127, 127, 127, .1); }
.note-row.on { background: var(--accent-soft); }
.note-row strong { font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.note-row em { color: var(--muted); font-size: 11px; font-style: normal; }
.note-row span { color: var(--muted); font-size: 12px; line-height: 1.3; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-pane { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.note-title { width: 100%; font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; border: 0; background: transparent; padding: 0; }
.note-title:focus { outline: none; }
.note-area { align-self: flex-start; max-width: 220px; border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.note-pane .rt-wrap { margin: 0; width: 100%; min-width: 0; }
.note-pane .rt-bar { padding-left: 0; opacity: 1; }
.note-pane .rt-area { display: block; width: 100%; min-width: 0; min-height: 280px; margin: 0; padding: 4px 0 12px; border: 0; background: transparent; white-space: pre-wrap; overflow-wrap: break-word; line-height: 1.5; }
.note-pane .rt-area:focus { outline: none; }
.note-pane .rt-area div { margin: 0; min-height: 0; }
.note-files { display: grid; gap: 6px; }
.note-file { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.note-file-name { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: inherit; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
@media (max-width: 800px) {
  .notes-layout { grid-template-columns: 1fr; }
}
.chip svg { width: 12px; height: 12px; }
.chip.overdue { color: var(--danger); }
.chip.soon { color: var(--warn); }
.chip.tag { background: rgba(127, 127, 127, .15); padding: 0 7px; border-radius: 99px; }
.row .actions { display: none; gap: 2px; }
.row:hover .actions, .row.selected .actions { display: flex; }
.progress { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.progress circle { fill: none; stroke-width: 3; }
.progress .track { stroke: var(--line); }
.progress .bar { stroke: var(--accent); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }

/* Quick add */
.quick { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.quick:focus-within { border-color: var(--accent); }
.quick input { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; }
.quick .hint { font-size: 12px; color: var(--faint); white-space: nowrap; }
.quick .quick-list { flex: 0 0 auto; max-width: 160px; border: 1px solid var(--line); background: transparent; color: var(--muted, var(--faint)); border-radius: 8px; padding: 3px 6px; font-size: 12px; }
.quick .quick-list:focus { outline: 0; border-color: var(--accent); }
.preview { font-size: 12.5px; color: var(--accent); margin: 0 0 8px 4px; min-height: 0; }
.fab {
  position: absolute; right: 24px; bottom: 24px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow);
}

/* Editor sheet: centred, like the Mac app */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 20; }
.editor {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 21;
  width: min(560px, calc(100vw - 24px)); max-height: min(88vh, 860px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.editor header { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; }
.editor header .spacer { flex: 1; }
.editor .done-btn { font-weight: 600; padding: 4px 14px; }
.editor .scroll { overflow-y: auto; padding: 8px 18px 22px; flex: 1; }
.editor .title-line { display: flex; gap: 10px; align-items: flex-start; }
.editor .title-input { font-size: 20px; font-weight: 600; width: 100%; border: 0; background: transparent; outline: 0; padding: 0; resize: none; overflow: hidden; }
.editor .notes { width: 100%; min-height: 80px; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 8px; margin: 8px -8px 4px; resize: vertical; outline: 0; }
.editor .notes:focus { border-color: var(--line); background: var(--bg); }
.editor .fields { margin-top: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.editor .fields .field:first-child { border-top: 0; }
.field { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.field > label, .field > .lab { color: var(--muted); font-size: 13px; }
.field .ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.field input[type=date], .field input[type=datetime-local], .field select, .field input[type=number], .field input[type=text] {
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; min-width: 0; max-width: 100%;
}
.field input[type=number] { width: 70px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 4px 10px; font-size: 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.pill { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: 13px; }
.pill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pill.removable::after { content: ' \00d7'; color: var(--muted); }
.btn { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.default { border-color: currentColor; box-shadow: 0 0 0 1px currentColor; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.small { padding: 3px 9px; font-size: 13px; }
.checklist { margin: 12px 0 4px; }
.checklist .item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist .item textarea.ck-text { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; padding: 0; resize: none; overflow: hidden; font: inherit; color: inherit; line-height: 1.4; }
.checklist .item.done textarea.ck-text { text-decoration: line-through; color: var(--muted); }
.checklist .ck-link { color: var(--accent, #2f6fed); font-size: 12px; white-space: nowrap; padding-top: 2px; }
.checklist .ck-handle { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; padding: 0 6px; color: var(--muted); font-size: 18px; line-height: 1.2; }
.checklist .item.dragging { opacity: .65; background: var(--hover, rgba(127,127,127,.12)); border-radius: 6px; cursor: grabbing; }
.checklist .item input[type=text] { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; padding: 3px 0; }
.checklist .item.done input[type=text] { text-decoration: line-through; color: var(--muted); }
.checklist .add input { width: 100%; border: 0; border-bottom: 1px dashed var(--line); background: transparent; outline: 0; padding: 5px 0; }

/* Palette and menus */
.palette-wrap { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; background: rgba(0, 0, 0, .35); }
.palette { width: min(600px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; outline: 0; padding: 14px 16px; font-size: 16px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.palette li.on { background: var(--accent-soft); color: var(--accent); }
.palette li .kind { margin-left: auto; color: var(--muted); font-size: 12px; }
.palette li kbd { margin-left: auto; }
.palette .none { padding: 14px 16px; color: var(--muted); }
.menu { position: fixed; z-index: 45; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; min-width: 190px; max-height: 60vh; overflow-y: auto; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 7px 10px; border-radius: 7px; }
.menu button:hover, .menu button.on { background: var(--accent-soft); color: var(--accent); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .menu-head { padding: 4px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

kbd {
  display: inline-block; min-width: 20px; text-align: center; padding: 1px 6px; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--muted);
}
.help { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .4); display: flex; justify-content: center; align-items: center; padding: 16px; }
.help .card { background: var(--panel); border-radius: 14px; max-width: 760px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 20px 24px; box-shadow: var(--shadow); }
.help h2 { margin: 0 0 4px; }
.help .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.help h3 { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.help dl { margin: 0; }
.help .line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.help .line .keys { display: flex; gap: 4px; flex: none; }

/* Dialogs and settings */
.dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; width: min(440px, calc(100vw - 24px)); }
.dialog h2 { margin: 0 0 8px; }
.dialog .row-end { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.modal-wrap { position: fixed; inset: 0; z-index: 48; background: rgba(0, 0, 0, .4); display: flex; justify-content: center; align-items: center; padding: 12px; }
.dialog input[type=text], .dialog input[type=email] { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.settings-block { border-top: 1px solid var(--line); padding: 12px 0; }
.settings-block:first-of-type { border-top: 0; }
.settings-block h3 { margin: 0 0 4px; font-size: 14px; }
.settings-block p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }

/* Toasts */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: #2a2a2d; color: #fff; padding: 9px 14px; border-radius: 10px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; max-width: min(520px, 92vw); }
.toast button { color: #8db4ff; font-weight: 600; }

/* Login */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); width: min(460px, 100%); padding: 30px 28px; }
.login .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .1em; margin-bottom: 14px; }
.login .logo svg { width: 26px; height: 29px; color: var(--brand); fill: currentColor; }
.login h1 { font-size: 22px; margin: 0 0 6px; }
.login ol { padding-left: 20px; color: var(--muted); }
.login .code-input { width: 100%; font-size: 28px; letter-spacing: .3em; text-align: center; text-transform: uppercase; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); margin: 8px 0; font-family: ui-monospace, Menlo, monospace; }
.login .error { color: var(--danger); min-height: 1.4em; margin: 4px 0; }
.device-input { width: 100%; box-sizing: border-box; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: inherit; margin: 4px 0 8px; }
.device-label { display: block; text-align: left; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.login .fine { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.login .btn.primary { width: 100%; padding: 11px; font-weight: 600; }

/* Small screens */
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 280px; transform: translateX(-100%); transition: transform .18s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .topbar { padding: 10px 14px 0; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 4px 16px 110px; }
  .fab { display: flex; }
  .quick .hint { display: none; }
  .row .actions { display: none !important; }
  .field { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .topbar, .fab, .quick { display: none; } .shell { display: block; } }

/* Import dialog */
.dialog.wide { width: min(620px, calc(100vw - 24px)); max-height: 90vh; overflow-y: auto; }
.dialog.settings textarea { width: 100%; min-height: 96px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: inherit; font: inherit; resize: vertical; }
.settings-label { margin: 16px 2px 6px; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.settings-group { background: var(--surface, var(--bg)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: transparent; border: 0; border-top: 1px solid var(--line); color: var(--accent, #4c8dff); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.settings-row:first-child { border-top: 0; }
.settings-row:hover { background: color-mix(in srgb, var(--accent, #4c8dff) 8%, transparent); }
.settings-note { margin: 8px 2px 0; color: var(--muted); font-size: 13px; }
.import-body.busy { opacity: .6; pointer-events: none; }
.import-apps { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.import-app { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; background: var(--bg); }
.import-app.active { background: var(--brand); color: var(--panel); border-color: var(--brand); }
.import-how p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.import-link { color: var(--brand); font-weight: 600; text-decoration: underline; }
.import-choose { display: inline-flex; margin: 4px 0 10px; cursor: pointer; }
.import-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.import-choose:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.import-paste label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.import-paste textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; resize: vertical; }
.import-error { color: #d03b3b; font-size: 13px; min-height: 1em; margin: 8px 0 0; }
.import-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.import-stat { display: flex; flex-direction: column; min-width: 80px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.import-stat strong { font-size: 20px; }
.import-stat span { font-size: 12px; color: var(--muted); }
.import-sample { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.import-sample li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; font-size: 13px; border-top: 1px solid var(--line); }
.import-sample li:first-child { border-top: 0; }
.import-kicker { margin: 12px 0 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.import-dup { display: grid; gap: 8px; margin: 0 0 10px; font-size: 13px; }
.import-dup summary { cursor: pointer; }
.import-where, .import-more { color: var(--muted); font-size: 12px; }
.import-warn { font-size: 13px; margin: 0 0 10px; }
.import-warn ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.import-options { display: grid; gap: 8px; margin: 10px 0 0; }
.import-options label:first-child { font-size: 13px; color: var(--muted); }
.import-options select { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13px; }
.import-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }

/* Rich text notes */
.rt-wrap { margin: 8px -8px 4px; position: relative; }
.rt-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 0 8px 2px; opacity: 0.55; transition: opacity 0.15s; }
.rt-wrap:focus-within .rt-bar { opacity: 1; }
.rt-btn { min-width: 28px; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.rt-btn:hover { background: var(--hover, rgba(128,128,128,0.15)); color: var(--text, inherit); }
.rt-b { font-weight: 700; }
.rt-i { font-style: italic; }
.rt-s { text-decoration: line-through; }
.rt-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }
.editor .notes.rt-area { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; resize: none; line-height: 1.45; }
.rt-area:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rt-area h1 { font-size: 1.5em; margin: 0.4em 0 0.2em; line-height: 1.2; }
.rt-area h2 { font-size: 1.3em; margin: 0.4em 0 0.2em; line-height: 1.2; }
.rt-area h3 { font-size: 1.12em; margin: 0.4em 0 0.2em; line-height: 1.2; }
.rt-area ul, .rt-area ol { margin: 0.2em 0; padding-left: 1.4em; }
.rt-area a { color: var(--accent, #3478f6); text-decoration: underline; }

.settings-version { font-size: 12px; opacity: .6; margin: 8px 0 0; text-align: center; }

.rt-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.rt-area img.rt-img { display: block; max-width: 100%; max-height: 420px; border-radius: 10px; margin: 6px 0; cursor: pointer; }
.rt-area img.rt-loading { min-height: 80px; min-width: 120px; background: var(--hover, rgba(128,128,128,0.15)); }
.rt-area img.rt-missing { min-height: 48px; min-width: 120px; max-width: 360px; padding: 12px 14px; box-sizing: border-box; border: 1px dashed var(--line); font-size: 13px; line-height: 1.4; color: var(--muted); cursor: default; }
.rt-area.rt-busy { opacity: .7; }

/* Select several */
.topbar .spacer { flex: 1; }
.select-btn { margin-left: auto; }
.bulkbar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 15;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; width: max-content;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 8px 10px; max-width: calc(100% - 24px);
}
.bulkbar .bulk-count { font-weight: 600; padding: 0 6px; white-space: nowrap; }
.bulkbar .btn { display: inline-flex; align-items: center; gap: 5px; }
.dialog input[type=date], .dialog input[type=datetime-local] { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
@media (max-width: 800px) {
  .editor { max-height: calc(100vh - 16px); }
  .bulkbar { bottom: 12px; }
}

.calendar { margin: 8px 0 18px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head strong { font-size: 18px; flex: 1; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { text-align: center; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.cal-day {
  min-height: 64px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--text); padding: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
}
.cal-day.outside { opacity: .38; }
.cal-day.today { border-color: var(--accent); }
.cal-day.on { background: var(--accent-soft); }
.cal-day .num { font-weight: 600; }
.cal-day .dots { font-size: 11px; color: var(--accent); letter-spacing: 1px; }
@media (max-width: 700px) {
  .cal-day { min-height: 48px; padding: 4px; }
}

/* Habits */
.habits { display: grid; gap: 10px; margin-top: 8px; max-width: 720px; }
.habit-add { display: flex; gap: 8px; }
.habit-input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.habit-summary { margin: 0; font-size: 13px; }
.habit-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.habit-row.rest { opacity: .7; }
.habit-main { display: flex; align-items: center; gap: 10px; }
.habit-main .check.done { background: var(--habit, var(--accent)); border-color: var(--habit, var(--accent)); color: #fff; }
.habit-title { flex: 1; text-align: left; font-weight: 600; }
.habit-week { display: flex; gap: 6px; }
.habit-dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 11px; color: var(--muted); }
.habit-dot.on { background: var(--habit, var(--accent)); border-color: var(--habit, var(--accent)); color: #fff; }
.habit-dot.due:not(.on) { background: color-mix(in srgb, var(--habit, var(--accent)) 18%, transparent); border-color: color-mix(in srgb, var(--habit, var(--accent)) 75%, transparent); color: var(--text, inherit); }
.habit-dot.off { border-style: dashed; opacity: .55; }
.habit-dot.skipped { text-decoration: line-through; opacity: .6; }
.habit-skip { flex: 0 0 auto; margin-left: auto; }
.habit-today.skipped .habit-today-title { opacity: .55; }
.habit-today .habit-skip { margin-left: 0; }
.habit-dot.today { outline: 1.5px solid var(--muted); outline-offset: 2px; }
.habit-edit { display: grid; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.habit-edit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); }
.time-text { width: 11em; margin-left: 6px; }

/* Sharing */
.share-box { display: grid; gap: 8px; }
.share-box input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }

/* Today: what to show, and the extra sections */
.today-filter { align-items: center; gap: 6px; margin: 6px 0 4px; }
.today-extra { display: grid; gap: 4px; margin-bottom: 14px; }
.habit-today, .today-plain { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: transparent; border: 0; color: inherit; font: inherit; text-align: left; width: 100%; }
.habit-today:hover, .today-plain:hover { background: rgba(127, 127, 127, .1); }
.habit-today .check.done { background: var(--habit, var(--accent)); border-color: var(--habit, var(--accent)); color: #fff; }
.habit-today.done .habit-today-title { opacity: .55; text-decoration: line-through; }
.habit-today-title, .today-plain-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-plain { cursor: pointer; }
.habit-time { max-width: 240px; }
.habit-date { flex: 0 0 auto; width: auto; }
.note-pin-row { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.note-pin { border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 8px; padding: 3px 8px; font: inherit; }

.today-filter .btn[draggable="true"] { cursor: grab; }
.today-filter .btn.drop-before { box-shadow: -3px 0 0 0 currentColor; }

.nav-item.nav-gap { margin-top: 10px; }

.nav-row.drop-target, .nav-head.drop-target, .nav-item.drop-target { background: color-mix(in srgb, currentColor 14%, transparent); border-radius: 8px; }

.checklist .add { display: flex; align-items: center; gap: 6px; }
.checklist .add input { flex: 1; min-width: 0; }
.checklist .add .add-item-btn { color: var(--accent, currentColor); }

.habit-today-title { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.habit-today-title:hover { text-decoration: underline; }

.import-cmd { background: var(--bg-2, rgba(128,128,128,.15)); border-radius: 8px; padding: 10px 12px; margin: 8px 0; font: 13px/1.4 ui-monospace, Menlo, monospace; overflow-x: auto; user-select: all; white-space: pre; }

.prefix-block { padding-top: 8px; }
.prefix-block h3 { margin: 0 0 4px; font-size: 14px; }
.prefix-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0; }
.prefix-row.indent { padding-left: 18px; }
.prefix-row input { max-width: 160px; }

.link-box input { width: 100%; box-sizing: border-box; margin: 4px 0 8px; font-size: 12px; }
.link-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.link-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; color: inherit; }

/* Trash */
.trash-note { margin: 4px 0 12px; }
.trash-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0 12px; }
.trash-all { display: flex; align-items: center; gap: 8px; }
.trash-list { display: flex; flex-direction: column; }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line, rgba(128,128,128,.2)); }
.trash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trash-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.trash-main .muted { font-size: 12px; }

.shared-banner { margin: 6px 0; padding: 7px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--text); font-size: 13px; }

/* The editor footer, like a card: tags and When on the left, buttons on the right. */
.editor .foot { margin-top: 6px; }
.foot-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 4px 0 8px 34px; }
.foot-left { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { background: color-mix(in srgb, #2e9e6b 70%, transparent); color: #fff; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.when-sum { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: transparent; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.when-line { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.when-line svg { stroke: currentColor; }
.when-detail { color: var(--muted); font-size: 13px; padding-left: 24px; display: inline-flex; align-items: center; gap: 4px; }
.foot-icons { display: flex; gap: 14px; }
.foot-icon { background: transparent; border: 0; padding: 4px; color: var(--muted); cursor: pointer; border-radius: 6px; }
.foot-icon.on { color: var(--accent); }
.foot-icon:hover { background: var(--accent-soft); }
.more-btn { display: block; margin: 6px auto 2px; background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 10px; }
.editor .foot > .fields { margin-bottom: 8px; }

/* The editor sits in place of the to-do, with no backdrop and no Done button. */
.editor.inline { position: fixed; transform: none; display: flex; flex-direction: column; max-height: none; }
.editor.inline header { position: absolute; top: 6px; right: 8px; padding: 0; z-index: 2; opacity: .45; transition: opacity .15s; }
.editor.inline:hover header, .editor.inline:focus-within header { opacity: 1; }
.editor.inline .scroll { padding: 14px 18px 12px; }
.editor.inline .title-line { padding-right: 64px; }
.editor.inline .notes.rt-area { min-height: 32px; }

/* Priority: a small exclamation mark in green, yellow or red. */
.prio { display: inline-flex; vertical-align: -2px; margin-right: 4px; }
.prio svg { stroke-width: 3; }
.prio-1 { color: #34b35a; }
.prio-2 { color: #e8b60c; }
.prio-3 { color: #e63946; }
.foot-icon.prio-btn.prio-1 { color: #34b35a; } .foot-icon.prio-btn.prio-2 { color: #e8b60c; } .foot-icon.prio-btn.prio-3 { color: #e63946; }
.prio-chip { background: transparent; border: 0; cursor: pointer; font: inherit; color: inherit; padding: 0; }
.prio-chip.prio-1 { color: #34b35a; } .prio-chip.prio-2 { color: #e8b60c; } .prio-chip.prio-3 { color: #e63946; }

/* Email addresses in Settings */
.mail-confirm { display: grid; gap: 8px; padding: 12px 0 0; margin-top: 8px; border-top: 1px solid var(--line); }
.mail-row { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.mail-row:first-child { border-top: 0; }
.mail-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mail-addr { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.mail-actions { display: flex; gap: 8px; }
.mail-row select, .mail-add select, .mail-add input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.mail-add { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Calendar (read only copy of your iPhone or Mac calendar) */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-title-text { font-size: 1.05rem; margin: 0 8px; flex: 1; min-width: 160px; }
.cal-hide { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.cal-empty { color: var(--muted); padding: 8px 2px; }
.cal-foot { color: var(--muted); font-size: .8rem; margin-top: 12px; }
.cal-chip { --c: var(--accent); display: flex; gap: 6px; align-items: baseline; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 4px; padding: 1px 5px; margin: 2px 0; font-size: .78rem; overflow: hidden; white-space: nowrap; }
.cal-chip .cal-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.cal-chip .cal-title { overflow: hidden; text-overflow: ellipsis; }
.cal-chip.declined .cal-title { text-decoration: line-through; color: var(--muted); }
.cal-chip.detailed { flex-wrap: wrap; font-size: .95rem; padding: 6px 10px; white-space: normal; }
.cal-chip.detailed .cal-sub { flex-basis: 100%; color: var(--muted); font-size: .8rem; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head { background: var(--panel); text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.cal-cell { background: var(--panel); min-height: 96px; padding: 3px; min-width: 0; }
.cal-cell.out { opacity: .55; }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; border-radius: 50%; }
.cal-num, .cal-dayname, .cal-more { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0 5px; }
.cal-num { font-size: .8rem; min-width: 1.6em; height: 1.6em; }
.cal-more { font-size: .72rem; color: var(--muted); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; min-height: 160px; min-width: 0; }
.cal-col.today { border-color: var(--accent); }
.cal-dayname { font-weight: 600; font-size: .85rem; padding: 0 0 4px; }
.cal-day { display: grid; gap: 6px; }
@media (max-width: 760px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-cell { min-height: 64px; }
  .cal-cell .cal-chip .cal-time { display: none; }
}
.cal-bar .chips { margin: 0; }
.cal-mode { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer; }
.cal-mode.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.cal-chip { cursor: pointer; }
.cal-pending { border: 1px dashed var(--line); border-radius: var(--radius); padding: 6px 10px; margin-bottom: 10px; font-size: .85rem; }
.cal-pending p { margin: 4px 0; }
.cal-failed { color: #d6372f; }
.cal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.cal-dialog { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; width: min(420px, 100%); display: grid; gap: 8px; max-height: 90vh; overflow: auto; }
.cal-dialog h3 { margin: 0; }
.cal-dialog input[type=text], .cal-dialog input[type=date], .cal-dialog input[type=datetime-local], .cal-dialog select { width: 100%; box-sizing: border-box; padding: 8px; font: inherit; }
.cal-dialog label { font-size: .8rem; color: var(--muted); }
.cal-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-buttons .danger { color: #d6372f; }

.sync-foot { display: grid; justify-items: center; gap: 10px; padding: 36px 0 48px; color: var(--muted); }
.sync-foot-logo { width: 44px; height: 44px; opacity: .5; }
.sync-foot-logo svg { width: 100%; height: 100%; display: block; }
.sync-foot-text { margin: 0; font-size: .85rem; }

.rt-area a.rt-chip { display: inline-block; padding: 2px 10px 2px 8px; margin: 1px 2px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); text-decoration: none; color: inherit; font-size: .92em; cursor: pointer; }
.rt-area a.rt-chip::before { content: '\1F4CE\00a0'; }

.palette-wrap.quick { padding-top: 70px; background: rgba(0, 0, 0, .2); }
.palette.quick { width: min(340px, calc(100vw - 24px)); border-radius: 18px; padding: 8px; backdrop-filter: blur(20px); box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.palette.quick input { border: 0; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); padding: 6px 14px; font-size: 14px; }
.palette.quick ul { padding: 6px 0 0; max-height: 60vh; }
.palette.quick li { padding: 4px 8px; font-size: 13px; font-weight: 500; border-radius: 7px; min-height: 26px; }
.palette.quick li.on { background: var(--accent); color: #fff; }
.palette.quick li .kind { color: inherit; opacity: .6; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette.quick li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette.quick li.more { font-weight: 700; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; margin-top: 4px; }
.qf-box { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; flex: none; opacity: .8; }
.qf-box.done { background: currentColor; }
.qf-done { text-decoration: line-through; opacity: .6; }
.palette.quick { display: block; }
.palette.quick input { box-sizing: border-box; }

/* Day brief and planner */
.planner-card { margin: 4px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft, rgba(127,127,127,.06)); }
.planner-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.planner-nav { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.planner-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.planner-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted, #888); margin-bottom: 3px; }
.planner-tray { padding: 6px; border-radius: 8px; margin-bottom: 6px; }
.planner-tray.drop, .planner-cell.drop { background: rgba(10,132,255,.16); }
.planner-chip { display: flex; align-items: center; gap: 6px; padding: 5px 8px; margin: 2px 0; border-radius: 7px; background: rgba(10,132,255,.14); font-size: 13px; cursor: grab; }
.planner-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-row { display: flex; gap: 8px; align-items: flex-start; }
.planner-allhours { text-align: right; margin-bottom: 4px; }
.planner-time { width: 66px; flex: none; text-align: right; font-size: 11px; color: var(--muted, #888); padding-top: 4px; }
.planner-cell { flex: 1; min-height: 34px; padding: 3px; border-top: 1px solid var(--line); border-radius: 6px; }
.planner-cell.busy { background: rgba(127,127,127,.08); }
.planner-event { padding: 4px 8px; margin: 2px 0; border-radius: 6px; background: rgba(127,127,127,.22); font-size: 12px; }
.daypick { display: inline-flex; gap: 4px; }
.daydot { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(127,127,127,.2); font-size: 12px; font-weight: 600; cursor: pointer; color: inherit; }
.daydot.on { background: #0a84ff; color: #fff; }
.brief-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.brief-card { width: min(520px, 100%); max-height: 86vh; overflow: auto; background: var(--bg, #fff); color: inherit; border-radius: 14px; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.brief-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.brief-head h2 { margin: 0; font-size: 20px; }
.brief-summary { margin: 0 0 14px; }
.brief-section { margin-bottom: 14px; }
.brief-section h3 { margin: 0 0 4px; font-size: 11px; letter-spacing: .05em; color: var(--muted, #888); }
.brief-line { font-size: 14px; padding: 1px 0; }

.announce-item { border-top: 1px solid var(--line); padding: 8px 0; }
.announce-item:first-child { border-top: 0; }
.announce-item h4 { margin: 0 0 2px; font-size: 14px; }
.announce-item p { margin: 0 0 2px; }

/* Last Time */
.lt-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lt-row.overdue { background: color-mix(in srgb, #d6372f 10%, var(--panel)); }
.lt-ideas { display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.lt-ideas h3 { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.lt-idea-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lt-idea-list .pill[disabled] { opacity: .45; }
.lt-month { display: grid; gap: 6px; max-width: 320px; }
.lt-month-head { display: flex; align-items: center; justify-content: space-between; }
.lt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.lt-day { aspect-ratio: 1; border-radius: 50%; border: 0; background: transparent; font-size: 12px; color: inherit; }
.lt-day.blank { visibility: hidden; }
.lt-day.on { background: var(--lt, var(--accent)); color: #fff; font-weight: 700; }
.lt-day.today { outline: 1.5px solid var(--muted); outline-offset: 1px; }
.lt-day[disabled] { opacity: .35; }

.linklike { background: none; border: 0; padding: 0; color: var(--accent, #2f6fed); font: inherit; cursor: pointer; text-decoration: underline; }
.login .device-label { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }

.lt-files { flex-wrap: wrap; align-items: center; }
.lt-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.lt-file-open { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; background: transparent; color: inherit; max-width: 240px; }
.lt-file-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.lt-file-input { max-width: 100%; font-size: 13px; }

/* Pick dates and times from titles: a checkbox and its words on one line. */
.check-line { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check-line input { width: auto; margin: 0; }

/* Note formatting: menus, quotes, code, dividers, tables */
.rt-u { text-decoration: underline; }
.rt-pop { position: absolute; z-index: 30; min-width: 190px; max-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.rt-pop-title { font-size: 11px; font-weight: 650; color: var(--muted); padding: 4px 4px 2px; }
.rt-item { text-align: left; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.rt-item:hover { background: var(--hover, rgba(128,128,128,0.15)); }
.rt-size-small { font-size: 11.5px; }
.rt-size-large { font-size: 17px; }
.rt-size-huge { font-size: 22px; }
.rt-swatches { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 2px 4px; }
.rt-swatch { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: transparent; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; }
.rt-area blockquote { margin: 0.3em 0; padding: 0.1em 0 0.1em 12px; border-left: 3px solid var(--line); color: var(--muted); }
.rt-area code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: rgba(128,128,128,0.18); border-radius: 4px; padding: 1px 4px; }
.rt-area pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: rgba(128,128,128,0.14); border-radius: 8px; padding: 10px 12px; margin: 0.3em 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rt-area hr { border: 0; border-top: 1px solid var(--line); margin: 0.8em 0; }
.rt-area table { border-collapse: collapse; margin: 0.4em 0; max-width: 100%; }
.rt-area th, .rt-area td { border: 1px solid var(--line); padding: 5px 9px; min-width: 60px; vertical-align: top; text-align: left; }
.rt-area th { background: rgba(128,128,128,0.14); font-weight: 650; }

/* DOEN Plus plans in Settings */
.plans-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
