/* RuSh Notes — dark, minimal, Outfit only */
@font-face { font-family: 'Outfit'; font-weight: 300; font-style: normal; font-display: swap; src: url('fonts/outfit-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/outfit-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/outfit-latin-600-normal.woff2') format('woff2'); }

:root {
  --accent: #ff3346;
  --accent-soft: rgba(255, 51, 70, .12);
  --bg: #0a0a0b;
  --side: #0d0d0f;
  --raise: #131316;
  --line: #1a1a1e;
  --line-2: #26262b;
  --text: #ececef;
  --body: #cfcfd5;
  --muted: #7a7a84;
  --faint: #45454c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255, 51, 70, .3); }
[hidden] { display: none !important; }

* { scrollbar-width: thin; scrollbar-color: #222226 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #222226; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2e2e34; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { display: block; flex: none; }
.logo-text { font-size: 19px; font-weight: 300; letter-spacing: -.01em; color: var(--muted); }
.logo-text b { font-weight: 600; color: #fff; letter-spacing: -.02em; }

/* ---------- Auth ---------- */
body.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(700px 420px at 50% -8%, rgba(255, 51, 70, .16), transparent 70%),
    var(--bg);
}
.auth-wrap { width: 100%; max-width: 372px; }
.auth-logo { display: inline-block; margin-bottom: 44px; }
.auth-logo .logo-text { font-size: 22px; }
.auth-logo .logo-mark { width: 34px; height: 34px; }
.auth-wrap h1 { margin: 0 0 8px; font-size: 30px; font-weight: 600; letter-spacing: -.03em; color: #fff; }
.auth-wrap .sub { margin: 0 0 30px; color: var(--muted); font-weight: 300; font-size: 16px; }
.auth-wrap label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.auth-wrap input {
  width: 100%;
  padding: 14px 15px;
  background: #0f0f12;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  outline: none;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.auth-wrap input::placeholder { color: var(--faint); }
.auth-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 51, 70, .14); }
.pw { position: relative; }
.auth-wrap .pw input { padding-right: 48px; }
.pw-toggle { position: absolute; top: 0; right: 0; bottom: 0; width: 48px; display: grid; place-items: center; color: var(--muted); border-radius: 0 11px 11px 0; transition: color .15s; }
.pw-toggle:hover, .pw-toggle[aria-pressed='true'] { color: var(--accent); }
.pw-toggle svg[hidden] { display: none; }
.auth-error {
  margin: 0 0 6px; padding: 12px 14px; border-radius: 11px;
  background: var(--accent-soft); border: 1px solid rgba(255, 51, 70, .3);
  color: #ff8d98; font-size: 14px;
}
.btn {
  display: block; width: 100%; margin-top: 26px; padding: 14px 18px;
  background: var(--accent); color: #fff; font-weight: 500; font-size: 16px;
  border-radius: 11px; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.small { display: inline-block; width: auto; margin-top: 22px; padding: 11px 22px; font-size: 15px; }
.alt { margin: 26px 0 0; color: var(--muted); font-size: 14.5px; font-weight: 300; }
.alt a { color: var(--accent); font-weight: 500; }
.alt a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- App shell ---------- */
body.app { display: flex; height: 100vh; overflow: hidden; }

#sidebar {
  width: 268px; flex: none;
  display: flex; flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 16px 14px 20px; }
.side-logo .logo-text { font-size: 18px; }

.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--raise); color: #fff; }
.icon-btn.accent { background: var(--accent-soft); color: var(--accent); }
.icon-btn.accent:hover { background: var(--accent); color: #fff; }

.note-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.note-item {
  position: relative; display: flex; align-items: center;
  border-radius: 0; margin-bottom: 1px;
  transition: background .12s;
}
.note-item:hover { background: #121215; }
.note-item.is-active { background: var(--raise); box-shadow: inset 2px 0 0 var(--accent); }
.note-title {
  flex: 1; min-width: 0; padding: 10px 12px; text-align: left;
  font-size: 15px; font-weight: 400; color: #9d9da6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.note-title.is-untitled { color: var(--faint); }
.note-item:hover .note-title { color: #d8d8dd; }
.note-item.is-active .note-title { color: #fff; }
.note-del {
  display: none; margin-right: 6px; padding: 3px 8px; border-radius: 7px;
  font-size: 17px; line-height: 1; color: var(--muted);
}
.note-item:hover .note-del, .note-del.is-armed { display: block; }
.note-del:hover { color: var(--accent); }
.note-del.is-armed { font-size: 12.5px; font-weight: 500; color: #fff; background: var(--accent); }

.side-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.side-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 300; }
.side-foot form { margin: 0; }
.link-btn { font-size: 13px; color: var(--muted); font-weight: 400; transition: color .15s; }
.link-btn:hover { color: var(--accent); }

#main { position: relative; flex: 1; min-width: 0; overflow-y: auto; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  height: 56px; padding: 0 24px;
  background: linear-gradient(var(--bg) 60%, transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
#menuBtn { display: none; margin-right: auto; }
.status { font-size: 12.5px; font-weight: 400; color: var(--faint); letter-spacing: .01em; transition: color .2s; }
.status:hover { color: var(--muted); }
.status[data-state='saving'], .status[data-state='unsaved'] { color: var(--muted); }
.status[data-state='error'] { color: var(--accent); }

.empty { min-height: calc(100vh - 56px); display: grid; place-content: center; text-align: center; padding: 0 24px 80px; }
.empty h2 { margin: 0 0 6px; font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.empty p { margin: 0; color: var(--muted); font-weight: 300; font-size: 17px; }

.editor-wrap { max-width: 760px; margin: 0 auto; padding: 28px 40px 0; }

/* ---------- Editor content ---------- */
.ProseMirror { outline: none; min-height: 60vh; padding-bottom: 45vh; caret-color: var(--accent); font-size: 17.5px; line-height: 1.75; color: var(--body); }
.ProseMirror > * + * { margin-top: .25em; }
.ProseMirror p { margin: 0; }
.ProseMirror strong { color: #fff; font-weight: 600; }
.ProseMirror .doc-title { margin: 0 0 .55em; font-size: 2.9rem; line-height: 1.12; font-weight: 600; letter-spacing: -.035em; color: #fff; }
.ProseMirror h2 { margin: 1.7em 0 .35em; font-size: 1.65rem; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; color: #fff; }
.ProseMirror h3 { margin: 1.4em 0 .3em; font-size: 1.28rem; line-height: 1.3; font-weight: 500; letter-spacing: -.015em; color: #f2f2f4; }
.ProseMirror ul, .ProseMirror ol { margin: .3em 0; padding-left: 1.5em; }
.ProseMirror li > p { margin: 0; }
.ProseMirror li { margin: .12em 0; padding-left: .2em; }
.ProseMirror ul li::marker { color: var(--accent); }
.ProseMirror ol li::marker { color: var(--muted); }
.ProseMirror blockquote { margin: .8em 0; padding: .1em 0 .1em 1.1em; border-left: 2px solid var(--accent); color: #a9a9b2; font-weight: 300; }
.ProseMirror code { padding: .12em .42em; border-radius: 6px; background: #1a1a1e; color: #ff7f8c; font-family: 'Outfit', sans-serif; font-size: .92em; }
.ProseMirror pre { margin: .8em 0; padding: 16px 18px; border-radius: 12px; background: #111114; border: 1px solid #1d1d21; overflow-x: auto; }
.ProseMirror pre code { padding: 0; background: none; color: #d6d6dc; font-size: .95em; }
.ProseMirror hr { border: 0; height: 1px; margin: 2em 0; background: var(--line-2); }
.ProseMirror hr.ProseMirror-selectednode { background: var(--accent); }
.ProseMirror s { color: var(--muted); }
.ProseMirror p.is-empty::before,
.ProseMirror h1.is-empty::before,
.ProseMirror h2.is-empty::before,
.ProseMirror h3.is-empty::before {
  content: attr(data-placeholder);
  float: left; height: 0; pointer-events: none;
  color: var(--faint);
}
.ProseMirror p.is-empty::before { font-weight: 300; }

/* ---------- Floating bits ---------- */
.bubble {
  position: fixed; z-index: 30; display: flex; align-items: center; gap: 2px; padding: 4px;
  background: #151518; border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.bubble button {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  font-size: 14px; color: #b6b6bd; transition: background .12s, color .12s;
}
.bubble button:hover { background: #202025; color: #fff; }
.bubble button.is-on { color: var(--accent); background: var(--accent-soft); }
.bubble .sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-2); }

.slash {
  position: fixed; z-index: 40; width: 272px; max-height: 340px; overflow-y: auto; padding: 6px;
  background: #121215; border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
}
.slash-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 9px; text-align: left; }
.slash-item.is-sel { background: #1c1c21; }
.slash-ico {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px;
  border-radius: 9px; background: #19191d; border: 1px solid var(--line-2);
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.slash-item.is-sel .slash-ico { color: var(--accent); border-color: rgba(255, 51, 70, .4); }
.slash-txt { display: flex; flex-direction: column; min-width: 0; }
.slash-txt b { font-weight: 500; font-size: 14.5px; color: #f1f1f3; }
.slash-txt small { font-size: 12.5px; font-weight: 300; color: var(--muted); }
.slash-empty { padding: 12px; color: var(--muted); font-size: 14px; }

#scrim { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  #sidebar {
    position: fixed; z-index: 50; inset: 0 auto 0 0; width: 286px;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  body.sidebar-open #sidebar { transform: none; }
  body.sidebar-open #scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .6); }
  #menuBtn { display: grid; }
  .topbar { padding: 0 14px; }
  .editor-wrap { padding: 12px 22px 0; }
  .ProseMirror .doc-title { font-size: 2.2rem; }
  .ProseMirror { font-size: 17px; }
}

/* ---------- Settings ---------- */
.side-foot a.who { color: var(--muted); transition: color .15s; }
.side-foot a.who:hover { color: #fff; }
body.auth.settings { place-items: start center; padding-top: 48px; padding-bottom: 80px; }
.settings .auth-wrap { max-width: 480px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 36px; font-size: 14px; color: var(--muted); transition: color .15s; }
.back:hover { color: #fff; }
.panel { margin-top: 28px; padding: 24px; border: 1px solid var(--line-2); border-radius: 14px; background: #0d0d10; }
.panel h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.panel .auth-error { margin-top: 14px; }
.panel label:first-of-type { margin-top: 14px; }
.panel .btn.small { margin-top: 22px; }
.details { margin: 14px 0 0; }
.details div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.details div:first-child { border-top: 0; }
.details dt { color: var(--muted); font-weight: 300; }
.details dd { margin: 0; color: var(--text); text-align: right; overflow-wrap: anywhere; }
.panel.danger { border-color: rgba(255, 51, 70, .35); }
.panel.danger h2 { color: var(--accent); }
.warn { margin: 0; color: var(--muted); font-size: 14.5px; font-weight: 300; line-height: 1.55; }
.auth-wrap label b { color: var(--accent); font-weight: 600; }
.btn.danger { background: transparent; color: var(--accent); border: 1px solid rgba(255, 51, 70, .5); }
.btn.danger:hover { background: var(--accent); color: #fff; filter: none; }
.auth-ok { margin: 0 0 4px; padding: 12px 14px; border-radius: 11px; background: #131316; border: 1px solid var(--line-2); color: #d8d8dd; font-size: 14px; }

/* ---------- Bulk delete ---------- */
.side-bulk { padding: 0 18px 16px; }
.side-foot { padding-bottom: 10px; }
.bulk-link { font-size: 13px; font-weight: 500; color: var(--accent); transition: opacity .15s; }
.bulk-link:hover { opacity: .75; text-decoration: underline; text-underline-offset: 3px; }
.bulk-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bulk-delete { flex: 1; padding: 10px 12px; font-size: 13.5px; font-weight: 500; color: #fff; background: var(--accent); border-radius: 9px; transition: filter .15s, opacity .15s; }
.bulk-delete:hover:not(:disabled) { filter: brightness(1.1); }
.bulk-delete:disabled { opacity: .35; cursor: not-allowed; }
.bulk-delete.is-armed { background: #fff; color: var(--accent); }

.select-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 20px 10px; border-bottom: 1px solid var(--line); margin: 0 0 6px; }
.sel-count { font-size: 12.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: #cfcfd5; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.box { position: relative; flex: none; width: 17px; height: 17px; border: 1.5px solid #3b3b42; border-radius: 4px; background: transparent; transition: background .12s, border-color .12s; }
.check input:checked + .box, .box.on { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after, .box.on::after { content: ''; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check input:indeterminate + .box { background: var(--accent); border-color: var(--accent); }
.check input:indeterminate + .box::after { content: ''; position: absolute; left: 3px; top: 6.5px; width: 8px; height: 2px; background: #fff; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(255, 51, 70, .3); }
.note-item.is-selecting { padding-left: 12px; gap: 2px; cursor: pointer; }
.note-item.is-selecting .note-title { padding-left: 10px; }
.note-item.is-picked { background: var(--raise); }
.note-item.is-picked .note-title { color: #fff; }

/* ---------- Note list spacing ---------- */
.note-list { padding-top: 8px; }
.note-item { margin-bottom: 0; border-bottom: 1px solid rgba(255, 255, 255, .045); }
.note-item:last-child { border-bottom-color: transparent; }
.note-title { padding-top: 14px; padding-bottom: 14px; }

/* ---------- Numbers + sort ---------- */
.note-num { flex: none; width: 34px; padding-left: 12px; font-size: 11px; font-weight: 400; letter-spacing: .04em; color: var(--faint); font-variant-numeric: tabular-nums; }
.note-item.is-active .note-num { color: var(--accent); }
.note-item.is-selecting .note-num { width: 22px; padding-left: 10px; }
.note-title { padding-left: 4px; }
.note-item.is-selecting .note-title { padding-left: 6px; }

.sort-row { position: relative; padding: 2px 20px 8px; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); transition: color .15s; }
.sort-btn:hover, .sort-btn[aria-expanded='true'] { color: #fff; }
.sort-menu { position: absolute; z-index: 20; left: 14px; top: 100%; width: 190px; margin-top: -2px; padding: 6px; background: #151518; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); }
.sort-menu button { display: block; width: 100%; padding: 9px 10px; border-radius: 8px; text-align: left; font-size: 14px; color: #b6b6bd; }
.sort-menu button:hover { background: #202025; color: #fff; }
.sort-menu button.is-on { color: var(--accent); }

/* ---------- Created-at line ---------- */
.note-meta { margin-bottom: 18px; font-size: 14.5px; font-weight: 500; letter-spacing: .01em; color: var(--accent); }
.note-meta:empty { display: none; }

/* ---------- Clock widget (glass) ---------- */
.clock {
  position: fixed; right: 28px; bottom: 28px; z-index: 4;
  min-width: 200px; padding: 18px 24px 16px;
  border-radius: 24px; pointer-events: none; user-select: none;
  background:
    radial-gradient(160px 110px at 100% 100%, rgba(255, 51, 70, .20), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
}
.clock-time { display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.clock-time span { font-size: 58px; font-weight: 500; letter-spacing: -.04em; color: #fff; font-variant-numeric: tabular-nums; }
.clock-time small { font-size: 15px; font-weight: 500; letter-spacing: .06em; color: var(--accent); }
.clock-date { margin-top: 10px; font-size: 13.5px; font-weight: 400; letter-spacing: .02em; color: rgba(255, 255, 255, .62); white-space: nowrap; }
@media (max-width: 820px) { .clock { display: none; } }

/* ---------- Editor aligned left (clear of the clock) ---------- */
.editor-wrap { margin: 0; max-width: 860px; padding-left: 56px; padding-right: 40px; }
@media (max-width: 820px) { .editor-wrap { max-width: none; padding-left: 22px; padding-right: 22px; } }

/* =====================================================================
   v3: tabs, + menu, search, trash, to-dos, print
   ===================================================================== */

/* ---------- Top bar: Notes | To-dos switch in the centre ---------- */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; justify-content: normal; }
.tb-side { display: flex; align-items: center; min-width: 0; }
.tb-side.right { justify-content: flex-end; gap: 6px; }
#menuBtn { margin-right: 0; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .03); }
.tabs button { position: relative; padding: 6px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: color .15s, background .15s; }
.tabs button:hover { color: #e4e4e8; }
.tabs button.is-on { background: #1c1c21; color: #fff; }
.tabs button.is-on::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 14px; height: 2px; margin-left: -7px; border-radius: 2px; background: var(--accent); }

/* ---------- Sidebar header actions + shared pop menus ---------- */
.head-actions { display: flex; align-items: center; gap: 6px; }
.new-wrap { position: relative; }
.icon-btn.small { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.danger { color: var(--accent); }
.icon-btn.danger:hover { background: var(--accent); color: #fff; }
#trashBtn[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); }

.pop-menu { position: absolute; z-index: 20; padding: 6px; background: #151518; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); }
.pop-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px; border-radius: 8px; text-align: left; font-size: 14px; color: #c4c4cb; white-space: nowrap; }
.pop-menu button:hover { background: #202025; color: #fff; }
.pop-menu button svg { flex: none; color: var(--accent); }
.new-menu { right: 0; left: auto; top: calc(100% + 8px); width: 214px; margin-top: 0; }
.sort-menu button svg { display: none; }

/* ---------- Sort + search row ---------- */
.sort-row { display: flex; align-items: center; gap: 10px; padding: 2px 14px 10px 20px; }
.sort-btn { flex: none; white-space: nowrap; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 9px; background: rgba(255, 255, 255, .02); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 51, 70, .12); color: #fff; }
.search svg { flex: none; }
.search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 13px; }
.search input::placeholder { color: var(--faint); }

/* ---------- Trash ---------- */
.trash-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 14px 10px 20px; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.list-empty { padding: 22px 14px; font-size: 13.5px; font-weight: 300; color: var(--faint); text-align: center; }
.note-title em { margin-left: 8px; font-style: normal; font-size: 11px; letter-spacing: .04em; color: var(--faint); }
.note-act { display: none; margin-right: 2px; padding: 5px 7px; border-radius: 7px; font-size: 17px; line-height: 1; color: var(--muted); }
.note-item:hover .note-act { display: block; }
.note-act:hover { color: #fff; background: #1d1d22; }
.note-act.danger:hover { color: #fff; background: var(--accent); }
body.in-trash .note-item.is-active { box-shadow: inset 2px 0 0 var(--muted); }
body.in-trash .ProseMirror { cursor: default; caret-color: transparent; }

/* ---------- To-do lists ---------- */
.ProseMirror ul[data-type='taskList'] { list-style: none; margin: .4em 0; padding: 0; }
.ProseMirror ul[data-type='taskList'] > li { display: flex; align-items: flex-start; gap: 12px; margin: .15em 0; padding: 0; }
.ProseMirror ul[data-type='taskList'] > li::marker { content: ''; }
.ProseMirror ul[data-type='taskList'] > li > label { flex: none; margin-top: .45em; line-height: 0; user-select: none; }
.ProseMirror ul[data-type='taskList'] > li > label input[type='checkbox'] {
  appearance: none; -webkit-appearance: none; display: block; position: relative;
  width: 19px; height: 19px; margin: 0; border: 1.6px solid #3d3d44; border-radius: 6px;
  background: transparent; cursor: pointer; transition: background .12s, border-color .12s;
}
.ProseMirror ul[data-type='taskList'] > li > label input[type='checkbox']:hover { border-color: var(--accent); }
.ProseMirror ul[data-type='taskList'] > li > label input[type='checkbox']:checked { background: var(--accent); border-color: var(--accent); }
.ProseMirror ul[data-type='taskList'] > li > label input[type='checkbox']:checked::after {
  content: ''; position: absolute; left: 5.5px; top: 1.8px; width: 4.5px; height: 9.5px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ProseMirror ul[data-type='taskList'] > li > div { flex: 1; min-width: 0; }
.ProseMirror ul[data-type='taskList'] > li[data-checked='true'] > div { color: var(--muted); text-decoration: line-through; text-decoration-color: #55555c; }
.ProseMirror ul[data-type='taskList'] ul[data-type='taskList'] { margin: .1em 0 .1em .4em; }

@media (max-width: 820px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; }
  .tabs { justify-self: center; }
  .tabs button { padding: 6px 14px; }
}

/* ---------- Print: just the note, on white ---------- */
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body, body.app { height: auto !important; overflow: visible !important; display: block !important; background: #fff !important; color: #000 !important; }
  #sidebar, #scrim, .topbar, .clock, .bubble, .slash, .empty { display: none !important; }
  #main { position: static !important; overflow: visible !important; height: auto !important; }
  .editor-wrap { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .note-meta { margin-bottom: 12pt !important; font-size: 10pt !important; font-weight: 400 !important; color: #666 !important; }
  .ProseMirror { min-height: 0 !important; padding-bottom: 0 !important; color: #111 !important; font-size: 12pt !important; line-height: 1.6 !important; }
  .ProseMirror .doc-title { margin-bottom: 14pt !important; font-size: 26pt !important; color: #000 !important; }
  .ProseMirror h2, .ProseMirror h3, .ProseMirror strong { color: #000 !important; }
  .ProseMirror .is-empty::before { content: none !important; }
  .ProseMirror code { background: #f0f0f0 !important; color: #222 !important; }
  .ProseMirror pre { background: #f6f6f6 !important; border-color: #ddd !important; }
  .ProseMirror pre code { color: #222 !important; }
  .ProseMirror blockquote { border-left-color: #888 !important; color: #333 !important; }
  .ProseMirror hr { background: #bbb !important; }
  .ProseMirror s { color: #666 !important; }
  .ProseMirror ul li::marker, .ProseMirror ol li::marker { color: #333 !important; }
  .ProseMirror ul[data-type='taskList'] > li > label input[type='checkbox'] { border-color: #555 !important; }
  .ProseMirror ul[data-type='taskList'] > li > label input[type='checkbox']:checked { background: #000 !important; border-color: #000 !important; }
  .ProseMirror ul[data-type='taskList'] > li[data-checked='true'] > div { color: #777 !important; }
  .ProseMirror li, .ProseMirror p, .ProseMirror h2, .ProseMirror h3, .ProseMirror pre, .ProseMirror blockquote { break-inside: avoid; }
}

/* To-do lists: no block-level formatting in the bubble toolbar */
body.is-todo .bubble [data-cmd='h2'],
body.is-todo .bubble [data-cmd='h3'],
body.is-todo .bubble [data-cmd='ul'],
body.is-todo .bubble .sep { display: none; }

/* ---------- Clock toggle ---------- */
.clock { bottom: 54px; }
.clock-toggle { position: fixed; right: 14px; bottom: 14px; z-index: 5; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--faint); transition: color .15s, background .15s; }
.clock-toggle:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.clock-toggle[aria-pressed='true'] { color: var(--accent); }
@media (max-width: 820px) { .clock-toggle { display: none; } }
@media print { .clock-toggle { display: none !important; } }

/* ---------- Clock: animated show / hide ---------- */
.clock {
  transform-origin: 100% 100%;
  transition: opacity .38s ease, transform .45s cubic-bezier(.2, .9, .25, 1.15), visibility 0s linear 0s;
}
body.clock-off .clock {
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.9);
  transition: opacity .28s ease, transform .3s ease, visibility 0s linear .3s;
}
.clock-toggle svg { transition: transform .45s cubic-bezier(.2, .9, .25, 1.15); }
.clock-toggle[aria-pressed='true'] svg { transform: rotate(360deg); }
@media (prefers-reduced-motion: reduce) {
  .clock, body.clock-off .clock, .clock-toggle svg { transition: none; }
}

/* ---------- Print page: equal margins on every side of the A4 sheet ---------- */
@page { size: A4; margin: 18mm; }

/* Print: force a light canvas so the page margins are white, not dark */
@media print {
  :root { color-scheme: light !important; background: #fff !important; }
  html { background: #fff !important; }
}

/* ---------- Light theme ---------- */
.i-sun { display: none; }
html[data-theme='light'] .i-sun { display: block; }
html[data-theme='light'] .i-moon { display: none; }

html[data-theme='light'] {
  --accent-soft: rgba(255, 51, 70, .10);
  --bg: #ffffff;
  --side: #f7f7f8;
  --raise: #efeff2;
  --line: #ebebee;
  --line-2: #dcdce1;
  --text: #17171a;
  --body: #34343a;
  --muted: #6e6e78;
  --faint: #a4a4ad;
  color-scheme: light;
}
html[data-theme='light'] * { scrollbar-color: #cfcfd5 transparent; }
html[data-theme='light'] ::-webkit-scrollbar-thumb { background: #cfcfd5; }
html[data-theme='light'] ::-webkit-scrollbar-thumb:hover { background: #b8b8c0; }
html[data-theme='light'] .logo-text b,
html[data-theme='light'] .auth-wrap h1,
html[data-theme='light'] .panel h2,
html[data-theme='light'] .ProseMirror strong,
html[data-theme='light'] .ProseMirror .doc-title,
html[data-theme='light'] .ProseMirror h2,
html[data-theme='light'] .ProseMirror h3,
html[data-theme='light'] .note-item.is-active .note-title,
html[data-theme='light'] .note-item.is-picked .note-title,
html[data-theme='light'] .side-foot a.who:hover,
html[data-theme='light'] .back:hover,
html[data-theme='light'] .icon-btn:hover,
html[data-theme='light'] .sort-btn:hover,
html[data-theme='light'] .sort-btn[aria-expanded='true'],
html[data-theme='light'] .search:focus-within,
html[data-theme='light'] .search input,
html[data-theme='light'] .bubble button:hover,
html[data-theme='light'] .sort-menu button:hover,
html[data-theme='light'] .pop-menu button:hover,
html[data-theme='light'] .note-act:hover,
html[data-theme='light'] .tabs button.is-on { color: #111114; }
html[data-theme='light'] .icon-btn.accent:hover,
html[data-theme='light'] .icon-btn.danger:hover,
html[data-theme='light'] .note-act.danger:hover,
html[data-theme='light'] .btn.danger:hover { color: #fff; }
html[data-theme='light'] .auth-wrap input { background: #fff; }
html[data-theme='light'] .auth-error { color: #c4182b; }
html[data-theme='light'] .note-item:hover { background: #efeff2; }
html[data-theme='light'] .note-item { border-bottom-color: rgba(0, 0, 0, .06); }
html[data-theme='light'] .note-title { color: #5d5d66; }
html[data-theme='light'] .note-item:hover .note-title { color: #1c1c20; }
html[data-theme='light'] .ProseMirror h3 { color: #26262b; }
html[data-theme='light'] .ProseMirror blockquote { color: #55555e; }
html[data-theme='light'] .ProseMirror code { background: #f0f0f3; color: #d11f33; }
html[data-theme='light'] .ProseMirror pre { background: #f6f6f8; border-color: #e3e3e8; }
html[data-theme='light'] .ProseMirror pre code { color: #2a2a30; background: none; }
html[data-theme='light'] .bubble,
html[data-theme='light'] .slash,
html[data-theme='light'] .sort-menu,
html[data-theme='light'] .pop-menu { background: #fff; box-shadow: 0 14px 34px rgba(20, 20, 30, .14); }
html[data-theme='light'] .bubble button,
html[data-theme='light'] .sort-menu button,
html[data-theme='light'] .pop-menu button { color: #4a4a52; }
html[data-theme='light'] .bubble button:hover,
html[data-theme='light'] .sort-menu button:hover,
html[data-theme='light'] .pop-menu button:hover,
html[data-theme='light'] .slash-item.is-sel,
html[data-theme='light'] .note-act:hover { background: #efeff2; }
html[data-theme='light'] .slash-ico { background: #f3f3f6; }
html[data-theme='light'] .slash-txt b { color: #17171a; }
html[data-theme='light'] .panel { background: #fafafb; }
html[data-theme='light'] .auth-ok { background: #f3f3f6; color: #34343a; }
html[data-theme='light'] .check { color: #34343a; }
html[data-theme='light'] .box { border-color: #b5b5bd; }
html[data-theme='light'] .bulk-delete.is-armed { background: #17171a; color: #fff; }
html[data-theme='light'] .tabs { background: rgba(0, 0, 0, .03); }
html[data-theme='light'] .tabs button:hover { color: #1c1c20; }
html[data-theme='light'] .tabs button.is-on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
html[data-theme='light'] .ProseMirror ul[data-type='taskList'] > li > label input[type='checkbox'] { border-color: #b5b5bd; }
html[data-theme='light'] .ProseMirror ul[data-type='taskList'] > li[data-checked='true'] > div { text-decoration-color: #9a9aa3; }
html[data-theme='light'] .clock {
  background:
    radial-gradient(160px 110px at 100% 100%, rgba(255, 51, 70, .14), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .55));
  border-color: rgba(0, 0, 0, .08);
  box-shadow: 0 24px 60px rgba(20, 20, 30, .16), inset 0 1px 0 rgba(255, 255, 255, .9);
}
html[data-theme='light'] .clock-time span { color: #17171a; }
html[data-theme='light'] .clock-date { color: rgba(0, 0, 0, .55); }
html[data-theme='light'] .clock-toggle:hover { color: #17171a; background: rgba(0, 0, 0, .06); }
html[data-theme='light'] .clock-toggle[aria-pressed='true'] { color: var(--accent); }
html[data-theme='light'] #scrim { background: rgba(0, 0, 0, .25); }
@media print { html[data-theme='light'], html[data-theme='dark'] { --bg: #fff; } }

/* ---------- Settings: appearance picker ---------- */
.theme-pick { display: flex; gap: 10px; margin-top: 14px; }
.theme-pick button { display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px; border: 1px solid var(--line-2); border-radius: 11px; color: var(--muted); font-size: 15px; transition: color .15s, border-color .15s, background .15s; }
.theme-pick button:hover { color: var(--text); }
.theme-pick button.is-on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Legal pages + footer links ---------- */
.legal-links { margin: 34px 0 0; text-align: center; font-size: 13px; color: var(--faint); }
.legal-links a { color: var(--muted); transition: color .15s; }
.legal-links a:hover { color: var(--accent); }
.legal-links span { margin: 0 8px; }
body.auth.legal { place-items: start center; }
.legal .auth-wrap { max-width: 640px; padding: 44px 0 70px; }
.legal .auth-logo { display: inline-block; margin-bottom: 38px; }
.legal .auth-wrap .sub { margin-bottom: 10px; line-height: 1.55; }
.legal-date { margin: 0 0 34px; font-size: 13px; color: var(--faint); }
.legal-sec { padding: 22px 0; border-top: 1px solid var(--line); }
.legal-sec h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.legal-sec h2 span { font-size: 12.5px; font-weight: 500; color: var(--accent); letter-spacing: .04em; }
.legal-sec ul { margin: 0; padding: 0 0 0 20px; }
.legal-sec li { margin: 0 0 9px; color: var(--body); font-size: 15.5px; font-weight: 300; line-height: 1.65; }
.legal-sec li::marker { color: var(--faint); }
.legal-sec b { font-weight: 500; color: var(--text); }
.legal-sec code { padding: .1em .4em; border-radius: 6px; background: var(--raise); font-family: 'Outfit', sans-serif; font-size: .92em; color: var(--accent); }
.legal-sec a, .legal-foot a { color: var(--accent); }
.legal-foot { margin: 14px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--faint); }
.legal-foot span { margin: 0 8px; }
.legal-foot a:hover { text-decoration: underline; }

/* ---------- Documentation page ---------- */
.docs .auth-wrap { max-width: 760px; }
.docs-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 34px; }
.docs-toc a { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--muted); transition: color .15s, border-color .15s; }
.docs-toc a:hover { color: var(--text); border-color: var(--accent); }
.docs-p { margin: 0 0 12px; color: var(--body); font-size: 15.5px; font-weight: 300; line-height: 1.65; }
.docs-p b, .docs-sec b { font-weight: 500; color: var(--text); }
.docs .legal-sec { scroll-margin-top: 20px; }
.docs-shot { margin: 18px 0 4px; }
.docs-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 12px; background: var(--raise); }
.docs-shot figcaption { margin-top: 10px; font-size: 13px; color: var(--faint); text-align: center; }
