
/* Daily Notes Planner — a quiet workspace for everyday thoughts. */
:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  --font-note: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  --canvas: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --surface-hover: #f0f2fa;
  --sidebar: #eff1fa;
  --sidebar-hover: #e4e8f7;
  --ink: #292b3b;
  --ink-soft: #5d637b;
  --muted: #8a90a4;
  --line: #e8eaf2;
  --line-strong: #d9ddea;
  --accent: #5262d7;
  --accent-hover: #4353c8;
  --accent-soft: #e9edff;
  --accent-ink: #4757c5;
  --success: #3d876d;
  --success-soft: #eaf5ef;
  --warning: #997029;
  --warning-soft: #fff7e7;
  --danger: #c2555c;
  --danger-soft: #fff0f0;
  --find: #f8e8a9;
  --find-current: #f4cc63;
  --shadow-sm: 0 2px 7px rgb(35 40 82 / 4%);
  --shadow-md: 0 8px 28px rgb(35 40 82 / 7%);
  --shadow-lg: 0 24px 80px rgb(35 40 82 / 12%);
  --radius: 12px;
  --radius-sm: 8px;
  --editor-font-size: 16px;
  --editor-line-height: 1.85;
  --editor-padding: 22px 0 64px; --dnp-editor-inner-left:0px; --dnp-editor-inner-right:0px;
  --calendar-note-fill: #e9ecf4;
  --calendar-today-ink: #b65100;
  --calendar-holiday-dot: #dc303e;
  --selection-border: var(--accent);
  --selection-radius: 2px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 3px;
}
button:disabled, .button:disabled { opacity: .45; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
::selection { background: #dce2ff; color: #252d64; }
[hidden], .hidden { display: none !important; }
.sr-only, .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.subtle { color: var(--ink-soft); }
.accent { color: var(--accent); }
.spacer { flex: 1; }
.icon { display: inline-block; }
.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* Shared controls */
.button, .icon-button, .text-button, .store-link, .store-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; background: transparent; text-decoration: none;
  border-radius: var(--radius-sm); font-weight: 550; white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}
.button { min-height: 42px; padding: 10px 17px; font-size: 13px; line-height: 1.4; }
.button.primary { background: var(--accent); color: #fff; box-shadow: 0 2px 4px rgb(63 81 185 / 12%); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 3px 9px rgb(63 81 185 / 18%); }
.button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: #c8cee4; }
.button.ghost { color: var(--ink-soft); }
.button.ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; }
.button.danger:hover:not(:disabled) { filter: brightness(.95); }
.button.small { min-height: 32px; padding: 6px 11px; font-size: 12px; }
.button.large { min-height: 48px; padding: 13px 21px; font-size: 14px; }
.button.full, .button.full-width { width: 100%; }
.icon-button { width: 34px; height: 34px; padding: 0; color: var(--ink-soft); flex: 0 0 auto; }
.icon-button:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); }
.icon-button.is-active { background: var(--accent-soft); color: var(--accent); }
.icon-button.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-button.small { width: 28px; height: 28px; }
.text-button { padding: 3px 0; border-radius: 4px; color: var(--accent); font-size: 13px; }
.text-button:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.text-button.danger { color: var(--danger); }
.button-row, .toolbar-actions, .editor-actions { display: flex; align-items: center; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
  color: var(--ink-soft); background: var(--surface-soft); font-size: 10px;
  line-height: 1.5; font-weight: 600; letter-spacing: .03em;
}
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.kbd, kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 21px; padding: 0 5px; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface);
  font: 10px var(--font-sans); box-shadow: 0 1px 0 var(--line);
}
.input, .select, .field input:not([type="checkbox"]):not([type="range"]), .field select {
  display: block; width: 100%; min-height: 44px; padding: 11px 13px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 14px; transition: border-color 140ms, box-shadow 140ms;
}
.input::placeholder, .field input::placeholder { color: #9ba0b2; }
.input:focus, .select:focus, .field input:focus, .field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.field { display: block; margin-bottom: 17px; color: var(--ink-soft); font-size: 12px; font-weight: 500; }
label.field > .input, label.field > .select { margin-top: 7px; font-weight: 400; }
.field > label, .field-label { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.field .hint, .field small { display: block; font-size: 11px; color: var(--muted); line-height: 1.55; margin-top: 6px; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 7px; font-size: 12px; line-height: 1.55; margin: 12px 0; }
.form-error:empty { display: none; }
.form-success { color: var(--success); background: var(--success-soft); padding: 10px 12px; border-radius: 7px; font-size: 12px; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }

/* Restore authentication before showing either the login form or private notes. */
.session-loading { position: fixed; inset: 0; z-index: 160; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 17px; background: var(--canvas); color: var(--ink-soft); }
.session-loading img { border-radius: 14px; }
.session-loading p { margin: 0; font-size: 14px; }
#resume-email { overflow-wrap: anywhere; }
#auth-resume-panel .auth-code-actions { align-items: center; }
#auth-resume-panel .auth-footnote { margin: 0; }

/* Public entry */
.site-header {
  max-width: 1360px; height: 98px; padding: 0 52px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; text-decoration: none; }
.brand img, .brand-icon { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.23; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -.35px; }
.brand-subtitle, .brand-version { color: var(--muted); font-size: 10px; letter-spacing: .02em; margin-top: 3px; font-weight: 450; }
.site-header .brand img { width: 39px; height: 39px; border-radius: 10px; }
.site-header .brand-name { font-size: 16px; }
.header-links, .store-links { display: flex; gap: 22px; align-items: center; }
.store-link { padding: 6px 0; gap: 6px; color: var(--ink-soft); font-size: 12px; }
.store-link:hover { color: var(--accent); }
.site-header .button { margin-left: 3px; min-height: 36px; padding: 8px 14px; font-size: 12px; }
.landing-wrap {
  max-width: 1360px; margin: 0 auto; padding: 62px 52px 66px;
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.1fr); gap: 76px; align-items: center;
}
.landing-copy { max-width: 490px; }
.landing-eyebrow, .eyebrow {
  display: flex; align-items: center; gap: 8px; color: var(--accent);
  font-size: 10px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 21px;
}
.landing-eyebrow .icon { width: 15px; height: 15px; }
.landing-copy h1 {
  font-size: clamp(34px, 3.65vw, 50px); font-weight: 600; line-height: 1.17;
  letter-spacing: -1.9px; margin: 0 0 25px; text-wrap: balance;
}
.landing-copy h1 strong { color: var(--accent); font-weight: inherit; }
.landing-copy > p { max-width: 390px; font-size: 15px; color: var(--ink-soft); line-height: 1.75; }
.landing-copy .tagline { max-width: 430px; }
.auth-card { margin-top: 31px; padding-top: 25px; border-top: 1px solid var(--line-strong); max-width: 395px; }
.auth-card h2 { font-size: 16px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.2px; }
.auth-card > p, .auth-description { color: var(--ink-soft); font-size: 12px; line-height: 1.65; margin-bottom: 20px; }
.auth-card .field { margin-bottom: 11px; }
.auth-card .button.primary { min-height: 45px; width: 100%; }
.auth-card .button.primary .icon:last-child { margin-left: auto; }
.auth-card .button.primary .icon:first-child:not(:last-child) { margin-left: 0; }
.auth-card .button.primary:not(:has(.icon)) { justify-content: center; }
.auth-meta, .auth-footnote {
  display: flex; gap: 6px; align-items: center; color: var(--muted);
  font-size: 10px; line-height: 1.6; margin-top: 11px;
}
.auth-meta .icon, .auth-footnote .icon { width: 12px; height: 12px; }
.auth-card .auth-back { margin-top: 14px; }
.auth-input-row { position: relative; }
.auth-input-row > .icon { position: absolute; top: 14px; left: 13px; color: var(--muted); width: 17px; height: 17px; }
.auth-input-row > input { padding-left: 39px; }
.otp-input, input[autocomplete="one-time-code"] { font-variant-numeric: tabular-nums; text-align: center; font-size: 25px !important; letter-spacing: .35em; font-weight: 600; padding-left: 25px !important; }
.otp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.otp-grid input { width: 100%; height: 51px; text-align: center; padding: 5px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 22px; }
.auth-secondary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.landing-visual { min-width: 0; }
.preview-card {
  overflow: hidden; border: 1px solid #dde2f2; background: var(--surface);
  border-radius: 14px; box-shadow: 0 22px 65px rgb(46 54 110 / 10%), 0 2px 9px rgb(46 54 110 / 3%);
  transform: translateY(8px);
}
.preview-toolbar { min-height: 44px; padding: 0 15px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); background: #fafbff; }
.window-dots { display: flex; gap: 5px; }
.window-dots i, .window-dots span { width: 7px; height: 7px; border-radius: 50%; background: #d8ddea; display: block; }
.preview-toolbar .preview-label { flex: 1; color: var(--muted); font-size: 9px; text-align: center; margin-right: 26px; }
.preview-toolbar .icon { color: var(--muted); }
.preview-body { display: grid; grid-template-columns: 175px minmax(0, 1fr); min-height: 416px; }
.preview-sidebar, .preview-calendar {
  background: #f3f5fd; border-right: 1px solid var(--line); padding: 23px 14px 16px;
}
.preview-sidebar h3, .preview-calendar h3 { font-size: 11px; font-weight: 600; margin: 0 0 18px; letter-spacing: -.1px; }
.preview-sidebar .calendar-top, .preview-calendar .calendar-top { padding: 0 0 12px; font-size: 10px; }
.preview-sidebar .calendar-top .icon-button, .preview-calendar .calendar-top .icon-button { width: 18px; height: 18px; }
.preview-sidebar .calendar-top .icon, .preview-calendar .calendar-top .icon { width: 12px; height: 12px; }
.preview-sidebar .weekdays, .preview-calendar .weekdays { font-size: 8px; margin-bottom: 4px; }
.preview-sidebar .calendar-grid, .preview-calendar .calendar-grid { gap: 3px 0; }
.preview-sidebar .day, .preview-calendar .day { width: 21px; height: 21px; font-size: 9px; border-radius: 6px; min-height: 0; }

.preview-section-label { margin: 27px 0 10px; font-size: 8px; text-transform: uppercase; letter-spacing: .11em; font-weight: 600; color: var(--muted); }
.preview-folder { display: flex; align-items: center; gap: 7px; padding: 7px 5px; color: var(--ink-soft); font-size: 10px; border-radius: 5px; }
.preview-folder .icon { width: 13px; height: 13px; color: #909ac5; }
.preview-folder.active, .preview-folder.is-active { background: var(--accent-soft); color: var(--accent); }
.preview-note { padding: 26px 23px; min-width: 0; }
.preview-note .preview-date, .preview-note .editor-eyebrow { font-size: 8px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; margin: 0 0 11px; }
.preview-note h2 { font-size: 23px; font-weight: 600; line-height: 1.25; letter-spacing: -.8px; margin-bottom: 21px; }
.preview-note h3 { font-size: 11px; margin: 21px 0 7px; font-weight: 650; }
.preview-note p { font-size: 10px; line-height: 1.9; color: var(--ink-soft); margin-bottom: 12px; }
.preview-note ul { list-style: none; padding: 0; margin: 13px 0; }
.preview-note li { display: flex; align-items: flex-start; gap: 7px; font-size: 10px; line-height: 1.7; color: var(--ink-soft); margin: 8px 0; }
.preview-note li .icon { width: 12px; height: 12px; margin-top: 2px; color: var(--accent); }
.preview-note li .check-box, .preview-check { width: 11px; height: 11px; border-radius: 3px; border: 1px solid #c5cce3; flex: 0 0 auto; margin-top: 3px; }
.preview-note li.done { color: var(--muted); }
.preview-note li.done .check-box { background: var(--accent-soft); border-color: var(--accent); }
.preview-note blockquote { margin: 19px 0 0; padding: 8px 11px; border-left: 2px solid #adb8ee; color: var(--ink-soft); background: #f6f7fe; font-size: 10px; line-height: 1.8; }
.preview-note .note-lines { display: grid; gap: 10px; margin-top: 16px; }
.preview-note .note-lines span { height: 4px; background: #eef0f6; border-radius: 3px; }
.preview-status { padding: 8px 15px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 8px; color: var(--muted); }
.preview-status span { display: inline-flex; align-items: center; gap: 4px; }
.preview-status .icon { width: 10px; height: 10px; color: var(--success); }
.preview-caption { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 29px; color: var(--muted); font-size: 11px; }
.preview-caption .text-button { font-size: 11px; }
.preview-caption .icon { width: 13px; height: 13px; }
.open-demo { display: inline-flex; align-items: center; gap: 7px; }
.landing-footer { max-width: 1256px; margin: 0 auto; padding: 22px 0 28px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 11px; color: var(--muted); }
.landing-footer a { color: var(--ink-soft); }
.landing-footer .footer-links { display: flex; align-items: center; gap: 20px; }
.store-button { background: var(--ink); color: var(--surface); border-radius: 8px; padding: 8px 13px; gap: 8px; }
.store-button .store-text { display: flex; flex-direction: column; font-size: 13px; line-height: 1.2; align-items: flex-start; }
.store-button small { font-size: 8px; font-weight: 400; }

/* Three-pane workspace */
body[data-view="app"] { overflow: hidden; }
.app-shell {
  position: fixed; inset: 0; z-index: 5; width: 100%; height: 100dvh;
  display: grid; grid-template-columns: 248px 320px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr); background: var(--surface); overflow: hidden;
}
.demo-banner {
  grid-column: 1 / -1; grid-row: 1; min-height: 34px; padding: 6px 20px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: #e9edfd; color: #5763a0; border-bottom: 1px solid #dfe4f5;
  font-size: 11px; line-height: 1.5;
}
.demo-banner .icon { width: 13px; height: 13px; }
.demo-banner .text-button { color: var(--accent); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.demo-banner .icon-button { position: absolute; right: 13px; width: 25px; height: 25px; color: #7882b5; }
.sidebar {
  grid-column: 1; grid-row: 2; display: flex; flex-direction: column; min-height: 0;
  padding: 25px 14px 14px; background: var(--sidebar); border-right: 1px solid var(--line);
}
.sidebar > .brand, .sidebar-brand { padding: 0 10px; margin-bottom: 32px; }
.sidebar .brand img { width: 33px; height: 33px; border-radius: 8px; }
.sidebar .brand-name { font-size: 13px; letter-spacing: -.25px; }
.sidebar .brand-subtitle { font-size: 9px; margin-top: 2px; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 0;
  display: flex; align-items: center; gap: 11px; background: transparent;
  color: var(--ink-soft); border-radius: 8px; text-align: left;
  font-size: 12px; font-weight: 500; line-height: 1.5; transition: background 140ms, color 140ms;
}
.nav-item > .icon { width: 18px; height: 18px; color: #8993b7; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--ink); }
.nav-item.is-active { background: var(--surface); color: var(--accent); box-shadow: 0 2px 6px rgb(51 62 112 / 4%); font-weight: 600; }
.nav-item.is-active > .icon { color: var(--accent); }
.nav-item .badge, .folder-row .badge, .nav-count { margin-left: auto; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 500; color: #98a1bc; }
.nav-item.is-active .badge, .nav-item.is-active .nav-count { color: var(--accent); }
.nav-item .kbd { margin-left: auto; background: transparent; font-size: 9px; height: 17px; border-color: #d7dcef; }
.sidebar-section { margin-top: 30px; }
.sidebar-section-header { min-height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; margin-bottom: 5px; }
.sidebar-section-title, .sidebar-section h2 {
  margin: 0; font-size: 9px; font-weight: 650; text-transform: uppercase;
  color: #939bb8; letter-spacing: .105em; line-height: 1.5;
}
.sidebar-section-header .icon-button { width: 24px; height: 24px; color: #939bb8; }
.sidebar-section-header .icon-button .icon { width: 14px; height: 14px; }
.folders-list { display: flex; flex-direction: column; gap: 2px; }
.folder-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 35px; padding: 7px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft); text-align: left; font-size: 11px; }
.folder-row > .icon { width: 15px; height: 15px; color: #8c97bd; }
.folder-row:hover { background: var(--sidebar-hover); }
.folder-row.is-active { background: #e1e6fb; color: var(--accent); }
.folder-row.is-active > .icon { color: var(--accent); }
.folder-row .folder-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.folder-row .folder-toggle { display: inline-flex; border: 0; padding: 0; width: 12px; background: transparent; color: #909bb7; }
.folder-row .folder-toggle .icon { width: 11px; height: 11px; }
.folder-row .folder-toggle.expanded { transform: rotate(90deg); }
.folder-row .row-more { margin-left: auto; opacity: 0; width: 22px; height: 22px; flex-shrink: 0; }
.folder-row:hover .row-more, .folder-row:focus-within .row-more, .folder-row.is-active .row-more { opacity: 1; }
.folder-row.nested { padding-left: 29px; }
.folder-row.level-2 { padding-left: 43px; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; }
.sidebar-bottom .nav-item { min-height: 36px; font-size: 11px; }
.sidebar-bottom .nav-item .icon { width: 16px; height: 16px; }
.sidebar-note { color: #9aa3bd; font-size: 10px; padding: 10px 12px; line-height: 1.65; }
.account-card {
  display: flex; align-items: center; gap: 9px; padding: 15px 8px 2px;
  margin-top: 14px; border-top: 1px solid #dfe4f2; min-width: 0;
}
.account-avatar, .avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: #dfe5fb; color: #6574bb; font-weight: 650; font-size: 11px; }
.account-info { min-width: 0; flex: 1; }
.account-name { font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-email, .account-status { font-size: 9px; color: var(--muted); margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-card .icon-button { width: 25px; height: 25px; }
.account-card .icon-button .icon { width: 16px; height: 16px; }
.collection-pane {
  grid-column: 2; grid-row: 2; display: flex; flex-direction: column; min-height: 0;
  overflow: hidden; background: var(--surface); border-right: 1px solid var(--line);
}
.collection-header { padding: 25px 22px 17px; }
.collection-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 29px; }
.collection-header h1, .collection-header h2 { font-size: 20px; line-height: 1.4; font-weight: 600; letter-spacing: -.65px; margin: 0; }
.collection-header p, .collection-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.collection-header .icon-button { width: 28px; height: 28px; }
.collection-header .icon-button .icon { width: 17px; height: 17px; }
.search-field {
  display: flex; align-items: center; gap: 8px; position: relative;
  margin: 0 22px 17px; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line);
  background: var(--surface-soft); border-radius: 7px; color: var(--muted);
}
.search-field .icon { width: 14px; height: 14px; }
.search-field input { width: 100%; min-width: 0; border: 0; padding: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; line-height: 1.6; }
.search-field input::placeholder { color: var(--muted); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field:focus-within { border-color: #c7ceef; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 6%, transparent); }
.search-field .kbd { font-size: 9px; height: 18px; min-width: 17px; padding: 0 4px; background: var(--surface); }
.search-field .icon-button { height: 20px; width: 20px; }
.collection-tabs { display: flex; align-items: center; gap: 5px; padding: 0 22px 15px; }
.collection-tabs button { border: 0; padding: 5px 9px; background: transparent; color: var(--muted); border-radius: 5px; font-size: 10px; }
.collection-tabs button.is-active, .collection-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.collection-tabs button:hover { background: var(--surface-hover); color: var(--ink-soft); }

/* Calendar */
#mini-calendar { padding: 0 22px 19px; flex-shrink: 0; }
.calendar-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0 14px; font-size: 12px; font-weight: 600; }
.calendar-top .calendar-month, .calendar-top h3 { margin: 0; font-size: inherit; font-weight: 600; letter-spacing: -.15px; }
.calendar-controls { display: flex; align-items: center; gap: 2px; }
.calendar-top .icon-button { width: 25px; height: 25px; color: var(--muted); }
.calendar-top .icon-button .icon { width: 14px; height: 14px; }
.calendar-top .today-button { padding: 3px 5px; font-size: 9px; color: var(--accent); border: 0; background: transparent; border-radius: 4px; }
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; color: var(--muted); font-size: 9px; font-weight: 500; margin-bottom: 8px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px 1px; }
.day {
  position: relative; display: flex; align-items: center; justify-content: center;
  justify-self: center; width: 30px; height: 29px; min-width: 0; padding: 0;
  border: 0; border-radius: var(--selection-radius); color: var(--ink-soft); background: transparent;
  font-size: 10px; font-weight: 450; font-variant-numeric: tabular-nums;
}
.day.outside { color: var(--muted); }
/* Dim the complete chip: number, note fill, holiday marker and today color. */
.day.outside > .date-number { opacity: .4; }
/* Month and week share a single date-number component. These states combine. */
.date-number {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 29px; flex-shrink: 0; border: 2px solid transparent;
  border-radius: var(--selection-radius); background: transparent; color: inherit;
  font-size: inherit; font-weight: inherit; font-variant-numeric: tabular-nums;
}
.day > .date-number { width: 100%; height: 100%; }
.day.has-note > .date-number, .week-day.has-note > .date-number { background: var(--calendar-note-fill); }
.day.is-selected > .date-number, .week-day.is-selected > .date-number {
  border-color: var(--selection-border);
}
.day.is-today > .date-number, .week-day.is-today > .date-number {
  color: var(--calendar-today-ink); font-weight: 800;
}
/* Hover never introduces a fill on an empty date or hides an existing fill. */
.day:hover > .date-number, .week-day:hover > .date-number { box-shadow: inset 0 0 0 1px var(--line-strong); }
.day.has-holiday > .date-number::after, .week-day.has-holiday > .date-number::after {
  content: ""; position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--calendar-holiday-dot);
}
/* Note collection */
.list-heading { padding: 18px 22px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .075em; color: var(--muted); }
.list-heading .icon-button { width: 22px; height: 22px; }
.list-heading .icon { width: 13px; height: 13px; }
.list-count { font-size: 9px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.notes-list { padding: 6px 11px 18px; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.note-card {
  display: block; position: relative; width: 100%; text-align: left; margin: 3px 0;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  padding: 14px 12px 13px; color: var(--ink); cursor: pointer; transition: background 130ms, border-color 130ms;
}
.note-card:hover { background: var(--surface-soft); }
.note-card.is-active { background: #eef1ff; border-color: #e2e7fc; }
.note-card-title, .note-card h3 { display: block; margin: 0 0 5px; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: -.1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.note-card.is-active .note-card-title, .note-card.is-active h3 { color: var(--accent-ink); }
.note-card-meta, .note-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 9px; color: var(--muted); line-height: 1.5; }
.note-card-meta .icon, .note-meta .icon { width: 11px; height: 11px; }
.note-card-excerpt, .note-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 10px; line-height: 1.8; color: var(--muted); margin: 6px 0 0; overflow-wrap: anywhere; }
.note-card .note-date { color: var(--accent); font-weight: 500; }
.note-card .note-kind { margin-left: auto; opacity: .6; }
.note-card mark, .search-result mark { border-radius: 2px; background: var(--find); color: inherit; padding: 0 1px; }
.collection-footer { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.collection-footer .text-button { font-size: 10px; }

/* Editor */
.editor-pane { grid-column: 3; grid-row: 2; position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface); }
.editor-topbar { flex-shrink: 0; min-height: 76px; padding: 19px 29px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 10px; white-space: nowrap; }
.breadcrumbs > span:last-child { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs .icon { width: 13px; height: 13px; color: #9aa3bd; }
.breadcrumbs .icon:nth-child(2) { width: 10px; height: 10px; color: var(--line-strong); }
.editor-actions { margin-left: auto; gap: 4px; }
.editor-actions .icon-button { width: 29px; height: 29px; }
.editor-actions .icon { width: 16px; height: 16px; }
.editor-actions .separator, .tool-separator { width: 1px; height: 17px; background: var(--line); margin: 0 7px; }
.save-state, .sync-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.save-state .icon, .sync-status .icon { width: 13px; height: 13px; color: var(--success); }
.save-state.is-saving .icon { color: var(--accent); }
.save-state.is-error, .sync-status.is-error { color: var(--danger); }
.save-state.is-error .icon, .sync-status.is-error .icon { color: var(--danger); }
.editor-content { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: 940px; margin: 0 auto; padding: 39px clamp(28px, 4.3vw, 72px) 0; --dnp-note-column-max:940px; --dnp-note-column-left:clamp(28px, 4.3vw, 72px); --dnp-note-column-right:clamp(28px, 4.3vw, 72px); }
.editor-eyebrow { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 9px; font-weight: 600; letter-spacing: .105em; text-transform: uppercase; line-height: 1.6; margin-bottom: 10px; }
.editor-eyebrow .icon { width: 13px; height: 13px; }
.editor-title, input.editor-title, .editor-title input {
  display: block; width: 100%; flex-shrink: 0; min-height: 46px; border: 0; padding: 0;
  color: var(--ink); background: transparent; font-size: clamp(25px, 2.55vw, 35px);
  font-weight: 600; line-height: 1.3; letter-spacing: -1.2px; margin: 0;
}
.editor-title::placeholder, .editor-title input::placeholder { color: #b4bacc; }
input.editor-title:focus-visible, .editor-title input:focus-visible { outline: 0; }
input.editor-title:focus, .editor-title input:focus { box-shadow: 0 1px 0 #e1e5f5; }
.editor-title[readonly] { cursor: default; }
.editor-date { color: var(--muted); font-size: 11px; margin-top: 6px; }
.week-strip { display: flex; align-items: center; gap: 7px; margin: 18px 0 14px; padding: 0; }
.week-strip .week-day, .week-strip > button:not(.icon-button) {
  border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 35px; min-height: 45px; padding: 6px 7px; font-size: 9px; line-height: 1.4;
}
.week-strip .week-day > .date-number { color: var(--ink-soft); font-size: 11px; font-weight: 500; }
.week-strip .week-day { position: relative; border: 0; padding: 4px 5px; gap: 4px; border-radius: var(--selection-radius); }
.week-strip .week-day.is-today > .date-number { color: var(--calendar-today-ink); font-weight: 800; }
.week-strip .week-day > .week-label { color: var(--muted); }
.week-strip .icon-button { width: 24px; height: 30px; }
.week-strip .icon-button .icon { width: 13px; height: 13px; }
.editor-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; min-height: 39px; padding: 7px 0; margin-top: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.week-strip + .editor-tools { margin-top: 0; }
.editor-tools .icon-button { width: 27px; height: 26px; color: var(--muted); }
.editor-tools .icon-button .icon { width: 15px; height: 15px; }
.editor-tools .tool-select, .editor-tools select { border: 0; background: transparent; color: var(--ink-soft); font-size: 10px; padding: 4px 5px; max-width: 120px; cursor: pointer; }
.editor-tools .text-button { font-size: 10px; color: var(--muted); gap: 5px; }
.editor-tools .text-button .icon { width: 13px; height: 13px; }
.editor-tools .tool-label { color: var(--muted); font-size: 9px; margin-left: 4px; }
.editor-paper { position: relative; flex: 1; min-height: 120px; margin: 0; isolation: isolate; overflow: hidden; }
/* DNP3_WEB_FULL_WIDTH_NOTE_PAPER_V1: paint the side gutters without moving
   the text column. The editor pane clips the horizontal bleed at its edges. */
.editor-paper.dnp-full-width-note-paper {
  background-color: var(--dnp-note-paper);
  box-shadow: 0 0 0 100vw var(--dnp-note-paper);
  clip-path: inset(0 -100vw);
}
.editor-highlight, #note-editor {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0;
  padding: var(--editor-padding); margin: 0; border: 0; border-radius: 0;
  font-family: var(--editor-font, var(--note-font-family, var(--font-note)));
  font-size: var(--note-font-size, var(--editor-font-size));
  font-weight: 400; line-height: var(--note-line-height, var(--editor-line-height));
  letter-spacing: 0; word-spacing: 0; text-align: left; text-indent: 0;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  -webkit-text-size-adjust: none;
}
#note-editor { z-index: 2; display: block; resize: none; color: var(--editor-text-color, var(--ink-soft)); caret-color: var(--accent); background: transparent; overflow-y: auto; overflow-x: hidden; outline: none; box-shadow: none; -webkit-overflow-scrolling: touch; }
#note-editor:focus-visible { outline: none; }
#note-editor::placeholder { color: #b2b8ca; opacity: 1; }
#note-editor:disabled { opacity: 1; -webkit-text-fill-color: var(--ink-soft); }
.editor-highlight { z-index: 1; pointer-events: none; color: var(--editor-text-color, var(--ink-soft)); overflow: visible; bottom: auto; height: auto; min-height: 100%; }
.editor-highlight mark { color: inherit; background: var(--find); border-radius: 2px; padding: 0; }
.editor-highlight mark.current, .editor-highlight mark.is-current, .editor-highlight mark.active, .editor-highlight mark.current-match { background: var(--find-current); box-shadow: 0 0 0 1px #d9ab49; }
#note-editor.has-highlights { color: transparent; -webkit-text-fill-color: transparent; }
#note-editor.has-highlights::selection { color: var(--editor-text-color, var(--ink-soft)); -webkit-text-fill-color: var(--editor-text-color, var(--ink-soft)); background: #dce2ff; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; min-height: 37px; padding: 8px 29px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.editor-footer > div, .editor-footer > span { display: inline-flex; align-items: center; gap: 7px; }
.editor-footer .icon { width: 12px; height: 12px; }
.editor-footer .word-count { font-variant-numeric: tabular-nums; }
.editor-footer .save-state, .editor-footer .sync-status { font-size: 9px; }
.editor-footer .text-button { font-size: 9px; }
.editor-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.editor-pane.is-empty .editor-content { display: none; }

/* Find and search */
.find-bar { display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 41px; padding: 7px 10px; margin-top: 12px; border: 1px solid #dbe1f9; background: #f7f8ff; border-radius: 7px; }
.find-bar > .icon { color: var(--muted); width: 14px; height: 14px; }
.find-bar input { min-width: 40px; flex: 1; border: 0; padding: 2px 4px; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.find-bar input::placeholder { color: var(--muted); }
.find-count { color: var(--muted); font-size: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; margin-right: 5px; }
.find-bar .icon-button { width: 23px; height: 23px; }
.find-bar .icon-button .icon { width: 13px; height: 13px; }
.find-bar .find-options { display: flex; gap: 3px; }
.search-results { display: flex; flex-direction: column; gap: 6px; padding: 3px; max-height: 430px; overflow-y: auto; min-height: 0; }
.search-result { display: flex; align-items: flex-start; gap: 12px; padding: 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; width: 100%; }
.search-result:hover, .search-result.is-active { background: var(--surface-soft); border-color: var(--line); }
.search-result > .icon { width: 17px; height: 17px; color: var(--accent); margin-top: 3px; }
.search-result > div { min-width: 0; }
.search-result h3 { font-size: 12px; font-weight: 600; margin: 0 0 4px; }
.search-result p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.7; color: var(--ink-soft); margin: 6px 0 0; }
.search-result small { color: var(--muted); font-size: 9px; }
.search-modal .search-field { margin: 0 0 14px; min-height: 43px; padding: 10px 12px; }
.search-modal .search-field input { font-size: 13px; }
.search-scope { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.search-scope button { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; color: var(--ink-soft); background: var(--surface); font-size: 10px; }
.search-scope button.is-active { color: var(--accent); border-color: #cdd5f8; background: var(--accent-soft); }

/* Dialogs, menus and feedback */
.modal {
  position: fixed; padding: 0; margin: auto; width: min(480px, calc(100vw - 36px));
  max-height: min(88dvh, 760px); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: auto;
}
.modal::backdrop { background: rgb(27 32 64 / 32%); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in 150ms ease-out; }
.modal.wide, .modal.search-modal { width: min(630px, calc(100vw - 36px)); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 23px 25px 17px; }
.modal-header h2 { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -.4px; }
.modal-header .icon-button { width: 27px; height: 27px; }
.modal-header .icon-button .icon { width: 17px; height: 17px; }
.modal-body { padding: 0 25px 22px; font-size: 13px; }
.modal-body > p { color: var(--ink-soft); font-size: 12px; line-height: 1.8; margin-bottom: 20px; }
.modal-body h3 { font-size: 12px; font-weight: 600; margin: 22px 0 12px; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 25px 20px; border-top: 1px solid var(--line); }
.modal-footer .button { min-height: 37px; font-size: 12px; padding: 8px 15px; }
.modal-footer .footer-note { margin-right: auto; color: var(--muted); font-size: 10px; }
/* DNP3_WEB_SETTINGS_STICKY_HEADER_V1 */
.modal.dnp-settings-modal { scroll-padding-top: 100px; }
.modal.dnp-settings-modal > .modal-header {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
}
.modal.dnp-settings-modal > .modal-header::after {
  content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 14px;
  background: linear-gradient(to bottom, var(--surface), transparent);
  pointer-events: none;
}
/* END DNP3_WEB_SETTINGS_STICKY_HEADER_V1 */
.modal .notice { padding: 12px 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; margin: 15px 0; }
.modal .notice.warning { background: var(--warning-soft); border-color: #f2e3c6; color: var(--warning); }
.modal .notice .icon { width: 14px; height: 14px; margin-right: 5px; }
.dialog-lead { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.dialog-lead > .icon { color: var(--accent); width: 26px; height: 26px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row label, .setting-row .setting-label { font-size: 12px; color: var(--ink); font-weight: 500; }
.setting-row p, .setting-row small { display: block; margin: 3px 0 0; font-size: 10px; color: var(--muted); line-height: 1.6; }
.setting-row .select, .setting-row select { width: auto; min-width: 110px; min-height: 33px; padding: 6px 10px; font-size: 11px; }
.setting-row input[type="range"] { width: 120px; flex-shrink: 0; }
.setting-row .button { min-height: 32px; padding: 6px 11px; font-size: 11px; }
.settings-group + .settings-group { margin-top: 15px; }
.settings-group-title { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-top: 17px; }
.backup-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.backup-row > .icon { color: var(--accent); width: 18px; height: 18px; }
.backup-row > div { flex: 1; min-width: 0; }
.backup-row strong { display: block; font-size: 11px; font-weight: 550; }
.backup-row small { font-size: 9px; color: var(--muted); }
.backup-row .button { min-height: 29px; padding: 5px 9px; font-size: 10px; }
.backup-row .icon-button { width: 26px; height: 26px; }
.backup-list { max-height: 240px; overflow-y: auto; }
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.folder-picker { border: 1px solid var(--line); border-radius: 9px; padding: 6px; max-height: 230px; overflow-y: auto; margin: 12px 0; }
.folder-picker button { width: 100%; }
.menu, .dropdown-menu, .context-menu {
  position: fixed; z-index: 30; min-width: 180px; padding: 5px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-md); color: var(--ink);
}
.menu button, .dropdown-menu button, .context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink-soft); padding: 9px 10px; font-size: 11px; border-radius: 5px; }
.menu button:hover, .dropdown-menu button:hover, .context-menu button:hover { background: var(--surface-hover); color: var(--ink); }
.menu button .icon, .dropdown-menu button .icon, .context-menu button .icon { width: 15px; height: 15px; }
.menu button.danger, .dropdown-menu button.danger, .context-menu button.danger { color: var(--danger); }
.menu .divider, .dropdown-menu .divider, .context-menu .divider { margin: 4px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 38px 21px; max-width: 350px; margin: auto; }
.empty-state > .icon { width: 34px; height: 34px; color: #bdc5e3; margin-bottom: 14px; }
.empty-state .empty-icon { width: 57px; height: 57px; display: flex; align-items: center; justify-content: center; border-radius: 17px; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.empty-state h2, .empty-state h3 { margin: 0 0 8px; font-size: 15px; font-weight: 550; letter-spacing: -.2px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.empty-state .button { min-height: 35px; padding: 8px 13px; font-size: 11px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 30px; color: var(--muted); font-size: 12px; }
.spinner, .loading::before { content: ""; display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 700ms linear infinite; flex: 0 0 auto; }
.loading:has(.spinner)::before { display: none; }
.button .spinner { border-color: rgb(255 255 255 / 30%); border-top-color: #fff; width: 14px; height: 14px; }
.toast, .toast-container {
  position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translateX(-50%);
}
.toast {
  display: flex; align-items: center; gap: 9px; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow-md); color: var(--ink-soft);
  font-size: 12px; line-height: 1.6; animation: toast-in 170ms ease-out;
}
.toast .icon { color: var(--success); width: 16px; height: 16px; }
.toast.error { border-color: #e9c6c8; background: var(--danger-soft); color: var(--danger); }
.toast.error .icon { color: var(--danger); }
.toast-container { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.toast-container .toast { position: relative; left: auto; bottom: auto; transform: none; }
.mobile-toolbar, .mobile-back, .mobile-menu-button, .sidebar-close, .drawer-backdrop { display: none; }
.offline-banner { padding: 7px 15px; font-size: 11px; color: var(--warning); background: var(--warning-soft); text-align: center; border-bottom: 1px solid #f0e0bf; }

/* Application markup and compact preview details. */
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 1; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 150; padding: 9px 14px; background: var(--surface); border: 1px solid var(--accent); border-radius: 7px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.brand > span { font-weight: 650; font-size: 15px; letter-spacing: -.35px; line-height: 1.3; }
.brand > span > .brand-version { display: block; font-size: 10px; font-weight: 450; color: var(--muted); letter-spacing: .03em; }
.app-brand { border: 0; background: transparent; text-align: left; width: 100%; }
.app-brand > span { font-size: 13px; }
.app-brand > span > .brand-version { font-size: 9px; }
.landing-copy .slogan-prefix { display: block; font-size: 16px; line-height: 1.5; font-weight: 500; letter-spacing: -.3px; color: var(--ink-soft); margin-bottom: 13px; }
.landing-copy h1 em { font-style: normal; color: var(--accent); }
.email-input-wrap { position: relative; }
.email-input-wrap > [data-icon] { position: absolute; left: 13px; top: 14px; color: var(--muted); }
.email-input-wrap > [data-icon] .icon { width: 17px; height: 17px; }
.email-input-wrap .input { padding-left: 40px; }
.auth-submit { margin-top: 10px; justify-content: space-between; }
.auth-submit [data-icon] { margin-left: auto; }
.auth-code-icon { display: inline-flex; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.auth-code-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; }
.auth-code-actions .text-button { font-size: 11px; }
.landing-preview { min-width: 0; }
.preview-toolbar { justify-content: space-between; color: var(--ink-soft); font-size: 10px; }
.preview-toolbar > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.preview-toolbar .pill { border: 0; background: #edf0fa; color: #8a94b8; font-size: 8px; letter-spacing: .02em; padding: 3px 6px; }
.preview-dot { width: 6px; height: 6px; border-radius: 50%; background: #9ba9e1; }
.preview-sidebar .preview-calendar { background: transparent; border: 0; padding: 21px 0 0; }
.preview-nav { display: flex; align-items: center; gap: 6px; padding: 8px 7px; margin: 2px -5px; border-radius: 6px; color: var(--ink-soft); font-size: 9px; white-space: nowrap; }
.preview-nav [data-icon] { color: #929cbe; }
.preview-nav [data-icon] .icon { width: 14px; height: 14px; }
.preview-nav.active { background: #e4e9fb; color: var(--accent); font-weight: 600; }
.preview-nav.active [data-icon] { color: var(--accent); }
.preview-folder-label { color: #939ebc; font-size: 7px; font-weight: 600; letter-spacing: .1em; margin: 22px 1px 7px; }
.preview-count { margin-left: auto; color: #a3acc3; font-size: 8px; }
.preview-note .preview-note-eyebrow { color: var(--accent); font-size: 8px; font-weight: 600; line-height: 1.6; letter-spacing: .1em; margin-bottom: 10px; }
.preview-note .preview-note-intro { font-size: 10px; color: #9ba3bc; margin: -8px 0 25px; }
.preview-note .preview-section-label { color: #9aa3bb; font-size: 7px; font-weight: 600; letter-spacing: .12em; margin: 20px 0 12px; }
.preview-task { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: 9px; line-height: 1.75; margin: 12px 0; }
.preview-check { display: flex; align-items: center; justify-content: center; font-size: 8px; line-height: 1; color: #fff; }
.preview-check.done { background: #8391d7; border-color: #8391d7; }
.preview-note-line { height: 1px; background: var(--line); margin: 24px 0 20px; }
.preview-note .preview-quote { font-size: 13px; line-height: 1.85; color: #8490b5; letter-spacing: -.1px; }
.preview-caret { display: block; height: 12px; width: 1px; background: #9faada; margin-top: 16px; }
.preview-bottom { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 15px; border-top: 1px solid var(--line); color: #929dbb; font-size: 9px; }
.preview-bottom [data-icon] { color: #8e9ac3; }
.preview-launch { display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 6px; padding: 5px; background: transparent; margin: 25px auto 0; color: var(--accent); font-size: 12px; font-weight: 550; }
.preview-launch:hover { color: var(--accent-hover); background: var(--accent-soft); }
.preview-launch + .preview-caption { margin: 4px 0 0; font-size: 10px; }
.site-footer { max-width: 1256px; margin: 0 auto; padding: 23px 0 27px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 10px; }
.site-footer a { color: var(--ink-soft); }
.sidebar > .app-brand { margin-bottom: 23px; }
.sidebar-search { display: flex; align-items: center; gap: 9px; padding: 8px 10px; margin: 0 0 11px; width: 100%; min-height: 35px; border: 1px solid #dfe4f2; background: #e8ecf7; border-radius: 7px; color: #919cbd; font-size: 11px; text-align: left; }
.sidebar-search kbd { margin-left: auto; min-width: 28px; height: 17px; font-size: 8px; border-color: #d2daef; background: transparent; color: #9aa5c1; }
.sidebar-search:hover { background: var(--sidebar-hover); color: var(--ink-soft); }
.new-note-button { width: 100%; min-height: 36px; font-size: 11px; padding: 8px 13px; margin-bottom: 24px; gap: 7px; }
.nav-item > [data-icon] { color: #8993b7; }
.nav-item.is-active > [data-icon] { color: var(--accent); }
.folder-section { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.sidebar-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 10px; margin-bottom: 4px; min-height: 25px; color: #929cba; font-size: 9px; font-weight: 600; letter-spacing: .08em; }
.sidebar-section-heading .icon-button { width: 23px; height: 23px; color: #929cba; }
.folder-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sidebar-bottom { flex-shrink: 0; }
button.account-card { width: 100%; background: transparent; border: 0; border-top: 1px solid #dfe4f2; border-radius: 0; text-align: left; color: var(--ink-soft); }
.account-details { flex: 1; min-width: 0; }
.account-details strong { display: block; font-size: 10px; font-weight: 550; line-height: 1.5; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-details small { display: block; font-size: 9px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.notes-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 19px 22px 8px; font-size: 9px; font-weight: 600; color: var(--muted); letter-spacing: .08em; }
.notes-list-heading > span:last-child { font-size: 9px; letter-spacing: 0; font-weight: 400; }
.collection-add { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; flex-shrink: 0; padding: 13px 18px; min-height: 43px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11px; }
.collection-add:hover { background: var(--surface-soft); color: var(--accent); }
.editor-top-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.editor-top-actions .icon-button { width: 30px; height: 30px; }
.save-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; margin-right: 10px; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #90b9a6; }
.save-status.saving .status-dot { background: #a4aee5; }
.save-status.error { color: var(--danger); }
.save-status.error .status-dot { background: var(--danger); }
.breadcrumb-separator { color: var(--line-strong); margin: 0 1px; }
.editor-heading { flex-shrink: 0; }
.editor-title-row { display: flex; align-items: center; gap: 12px; }
.editor-title-row .editor-title { flex: 1; min-width: 0; }
.editor-today-button { flex: 0 0 auto; font-size: 11px; }
.title-edit { opacity: .3; }
.editor-title-row:hover .title-edit, .title-edit:focus-visible { opacity: 1; }
.editor-subtitle { color: var(--muted); font-size: 10px; margin-top: 5px; }
.editor-subtitle:empty { display: none; }
.editor-tools { justify-content: space-between; }
.tool-group { display: flex; align-items: center; gap: 5px; }
.tool-divider { display: inline-block; width: 1px; height: 15px; background: var(--line); margin: 0 7px; }
.font-button { margin: 0 6px; gap: 6px; }
.find-bar .search-field { flex: 1; min-width: 0; margin: 0; padding: 2px 0; min-height: 25px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.find-bar .search-field input { font-size: 11px; padding: 1px 2px; }
.find-bar .search-field .find-count { flex-shrink: 0; }
.find-bar .icon-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.conflict-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; padding: 9px 11px; margin-top: 11px; border: 1px solid #ecdbb7; background: var(--warning-soft); color: var(--warning); border-radius: 7px; font-size: 10px; }
.conflict-banner .text-button { font-size: 10px; color: var(--warning); text-decoration: underline; }
.sidebar-scrim, .mobile-menu { display: none; }
.print-note { display: none; }
.noscript { padding: 30px; text-align: center; color: var(--ink-soft); }
.app-shell.focus-mode { grid-template-columns: minmax(0, 1fr); }
.focus-mode .sidebar, .focus-mode .collection-pane { display: none; }
.focus-mode .editor-pane { grid-column: 1; }
.focus-mode .editor-content { max-width: 930px; --dnp-note-column-max:930px; }
.folder-row-wrap { display: flex; align-items: center; position: relative; border-radius: 7px; }
.folder-row-wrap .folder-row { padding-right: 38px; }
.folder-options { position: absolute; right: 5px; top: 4px; opacity: 0; }
.folder-row-wrap:hover .folder-options, .folder-row-wrap:focus-within .folder-options { opacity: 1; }
.folder-row .folder-count { margin-left: auto; font-size: 9px; color: #9ba5bf; }
.folder-row-wrap.drag-over { outline: 1px dashed var(--accent); background: var(--accent-soft); }
.sidebar-empty { color: #99a2bc; font-size: 10px; line-height: 1.7; padding: 6px 11px; }
.calendar-today { display: flex; margin: 11px auto 0; font-size: 9px; color: var(--muted); }
.calendar-today:hover { color: var(--accent); }
.moon-marker { position: absolute; right: 2px; top: 0; font-size: 12px; color: #a1aacf; line-height: 1; }
.is-dragging { opacity: .45; }
.note-card .note-card-meta { margin-bottom: 7px; }
.note-card > p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.8; margin: 3px 0 0; overflow-wrap: anywhere; }
.match-badge { margin-left: auto; font-size: 9px; color: var(--accent); background: var(--accent-soft); padding: 0 5px; border-radius: 3px; }
.status-dot.saving { background: #a4aee5; }
.status-dot.offline, .status-dot.conflict { background: #ceab70; }
.status-dot.error { background: var(--danger); }
.action-list { display: flex; flex-direction: column; gap: 3px; margin: -3px -8px; }
.action-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 450; text-align: left; }
.action-row .icon { width: 18px; height: 18px; color: var(--muted); }
.action-row small { margin-left: auto; color: var(--muted); font-size: 9px; }
.action-row:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); }
.action-row.danger-text, .action-row.danger-text .icon, .danger-text { color: var(--danger); }
.action-row.danger-text:hover:not(:disabled) { background: var(--danger-soft); }
.conflict-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.version-text { resize: vertical; min-height: 200px; line-height: 1.7; font-size: 11px; padding: 11px; color: var(--ink-soft); background: var(--surface-soft); }
.backup-local-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.backup-local-heading h3 { margin: 0; }
.backup-local-heading .text-button { font-size: 11px; }
.backup-icon { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; flex-shrink: 0; border-radius: 8px; background: var(--surface-soft); color: var(--accent); }
.backup-row .backup-row-info { flex: 1; min-width: 0; }
.backup-row .text-button { font-size: 11px; }
.backup-summary { display: flex; align-items: center; gap: 9px; margin-bottom: 21px; color: var(--muted); font-size: 10px; }
.backup-preview-text { min-height: 180px; max-height: 340px; resize: vertical; font-size: 12px; line-height: 1.75; background: var(--surface-soft); }
.upload-backup-label { cursor: pointer; }
.upload-backup-label:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent); outline-offset: 3px; }
.restore-options { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.restore-options > label { display: flex; align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.restore-options > label:has(input:checked) { background: var(--accent-soft); border-color: #ccd5f8; }
.restore-options input { margin: 3px 0 0; flex-shrink: 0; }
.restore-options strong { display: block; font-size: 11px; font-weight: 550; color: var(--ink-soft); }
.restore-options small { display: block; margin-top: 4px; font-size: 10px; line-height: 1.65; color: var(--muted); }
.settings-section + .settings-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 1px; }
.settings-section > h3 { margin-top: 18px; margin-bottom: 13px; }
.settings-section:first-child > h3 { margin-top: 0; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.settings-grid .field { margin-bottom: 0; }
.settings-grid .select { min-height: 39px; font-size: 12px; }
.settings-help { color: var(--muted) !important; font-size: 10px !important; line-height: 1.75 !important; margin: 9px 0 14px; }
.setting-row > span { font-size: 12px; color: var(--ink-soft); }
.setting-row input[type="color"] { width: 42px; height: 28px; padding: 3px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 5px; cursor: pointer; }
.setting-row input[role="switch"] { width: 16px; height: 16px; margin: 0; cursor: pointer; flex-shrink: 0; }
.shortcut-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 11px 14px; color: var(--ink-soft); font-size: 11px; }
.shortcut-list kbd { justify-self: end; font-size: 9px; }
.account-modal-email { display: flex; align-items: center; gap: 10px; padding: 15px; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.account-modal-email .icon { color: var(--accent); }
.account-modal-email strong { font-size: 12px; font-weight: 550; overflow-wrap: anywhere; min-width: 0; }

/* Dark theme preserves hierarchy without turning the paper into pure black. */
body[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #171923; --surface: #20222e; --surface-soft: #252837; --surface-hover: #2c3042;
  --calendar-note-fill: #343c53; --calendar-today-ink: #ffb568; --calendar-holiday-dot: #ff6874; --selection-border: var(--accent);
  --sidebar: #1b1e2d; --sidebar-hover: #282d43; --ink: #e7e9f4; --ink-soft: #b8bfd6;
  --muted: #7e89a8; --line: #2d3246; --line-strong: #3b425a;
  --accent: #8796fc; --accent-hover: #a0acff; --accent-soft: #2f375e; --accent-ink: #a4b1ff;
  --success: #7cbb9f; --success-soft: #253c35; --warning: #d0ae6a; --warning-soft: #382f20;
  --danger: #ee979e; --danger-soft: #422a34; --find: #655734; --find-current: #897035;
  --shadow-sm: 0 2px 7px rgb(0 0 0 / 10%); --shadow-md: 0 8px 28px rgb(0 0 0 / 20%); --shadow-lg: 0 24px 80px rgb(0 0 0 / 35%);
}
body[data-theme="dark"] .button.primary { background: #6274e5; color: #fff; }
body[data-theme="dark"] .button.primary:hover { background: #7283ed; }
body[data-theme="dark"] .demo-banner { background: #28304d; color: #9eaad4; border-color: #333d5b; }
body[data-theme="dark"] .sidebar-section-title, body[data-theme="dark"] .sidebar-section h2 { color: #7481a3; }
body[data-theme="dark"] .folder-row.is-active { background: #2d3554; }
body[data-theme="dark"] .account-card { border-color: var(--line); }
body[data-theme="dark"] .account-avatar { background: #30395e; color: #a5b1f1; }
body[data-theme="dark"] .note-card.is-active { background: #2c3453; border-color: #394363; }
body[data-theme="dark"] .day.outside { color: #7e89a8; }
body[data-theme="dark"] .find-bar { background: #282f49; border-color: #3a4568; }
body[data-theme="dark"] .preview-card { border-color: var(--line-strong); }
body[data-theme="dark"] .preview-toolbar { background: #242938; }
body[data-theme="dark"] .preview-sidebar, body[data-theme="dark"] .preview-calendar { background: #252b41; }
body[data-theme="dark"] .preview-note blockquote { background: #292f46; border-color: #6372a9; }
body[data-theme="dark"] .preview-note .note-lines span { background: #30374f; }
body[data-theme="dark"] .window-dots i, body[data-theme="dark"] .window-dots span { background: #56607b; }
body[data-theme="dark"] .preview-toolbar .pill { background: #31394f; color: #9ca7c8; }
body[data-theme="dark"] .preview-nav.active { background: #303b5b; }
body[data-theme="dark"] .sidebar-search { background: #252c42; border-color: #303953; }
body[data-theme="dark"] .sidebar-search kbd { border-color: #3c4765; }
body[data-theme="dark"] button.account-card { border-top-color: var(--line); }
body[data-theme="dark"] .folder-row .folder-count { color: var(--muted); }
body[data-theme="dark"] .preview-task { color: var(--ink-soft); }
body[data-theme="dark"] #note-editor.has-highlights::selection { color: #f1f3ff; -webkit-text-fill-color: #f1f3ff; background: #485782; }
body[data-theme="dark"] .modal::backdrop { background: rgb(6 9 18 / 60%); }
body[data-theme="dark"] .toast.error { border-color: #65414b; }
body[data-theme="dark"] ::selection { background: #485782; color: #f4f5ff; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; margin-bottom: -5px; } to { opacity: 1; margin-bottom: 0; } }

/* Laptops */
@media (min-width: 1600px) {
  .app-shell { grid-template-columns: 260px 340px minmax(0, 1fr); }
  .editor-content { padding-top: 48px; }
  .landing-wrap { padding-top: 90px; padding-bottom: 90px; }
}
@media (max-width: 1240px) {
  .site-header { padding: 0 36px; }
  .landing-wrap { padding: 42px 36px 62px; gap: 46px; }
  .landing-copy h1 { font-size: 42px; }
  .landing-footer { margin: 0 36px; }
  .site-footer { margin: 0 36px; }
  .preview-body { grid-template-columns: 150px minmax(0, 1fr); }
  .preview-sidebar, .preview-calendar { padding-left: 10px; padding-right: 10px; }
  .preview-note { padding: 24px 18px; }
  .preview-note h2 { font-size: 21px; }
}
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 220px 270px minmax(0, 1fr); }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .sidebar > .brand, .sidebar-brand { padding-left: 7px; padding-right: 4px; }
  .sidebar .brand-name { font-size: 12px; }
  .collection-header { padding-left: 18px; padding-right: 18px; }
  .search-field { margin-left: 18px; margin-right: 18px; }
  #mini-calendar { padding-left: 18px; padding-right: 18px; }
  .collection-tabs, .list-heading { padding-left: 18px; padding-right: 18px; }
  .notes-list-heading { padding-left: 18px; padding-right: 18px; }
  .editor-topbar { padding-left: 22px; padding-right: 22px; }
  .editor-content { padding-left: 30px; padding-right: 30px; padding-top: 32px; --dnp-note-column-left:30px; --dnp-note-column-right:30px; }
  .editor-actions .save-state { display: none; }
  .editor-top-actions .save-status { display: none; }
  .editor-actions { gap: 2px; }
  .editor-footer { padding-left: 22px; padding-right: 22px; }
  .week-strip { gap: 3px; }
  .week-strip .week-day, .week-strip > button:not(.icon-button) { min-width: 32px; }
}

/* Tablets: collection and editor stay visible; navigation becomes a drawer. */
@media (max-width: 900px) {
  .site-header { height: 83px; padding: 0 27px; }
  .header-links, .store-links { gap: 15px; }
  .landing-wrap { max-width: 690px; grid-template-columns: 1fr; padding: 35px 27px 46px; gap: 46px; }
  .landing-copy { max-width: 600px; }
  .landing-copy h1 { max-width: 590px; font-size: 44px; letter-spacing: -1.6px; }
  .auth-card { margin-top: 26px; max-width: 420px; }
  .preview-card { transform: none; }
  .preview-body { grid-template-columns: 175px minmax(0, 1fr); min-height: 350px; }
  .preview-sidebar, .preview-calendar { padding: 25px 16px; }
  .preview-note { padding: 29px 28px; }
  .preview-note h2 { font-size: 25px; }
  .preview-note p, .preview-note li, .preview-note blockquote { font-size: 11px; }
  .preview-caption { margin-top: 19px; }
  .landing-footer { margin: 0 27px; }
  .site-footer { margin: 0 27px; }
  .app-shell { grid-template-columns: 270px minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 25; width: 250px; height: 100dvh;
    transform: translateX(-100%); transition: transform 180ms ease; border-right: 1px solid var(--line-strong);
    padding: 25px 15px 17px; box-shadow: none;
  }
  .sidebar-open .sidebar, .app-shell.sidebar-open .sidebar { transform: translateX(0); box-shadow: 12px 0 45px rgb(25 32 62 / 15%); }
  .sidebar .brand-name { font-size: 13px; }
  .sidebar-close { display: inline-flex; position: absolute; right: 7px; top: 7px; width: 23px; height: 23px; color: var(--muted); }
  .sidebar-close .icon { width: 15px; height: 15px; }
  .drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 24; background: rgb(26 32 62 / 28%); border: 0; border-radius: 0; backdrop-filter: blur(1px); }
  .sidebar-open .drawer-backdrop { display: block; }
  .collection-pane { grid-column: 1; }
  .editor-pane { grid-column: 2; }
  .mobile-menu-button { display: inline-flex; }
  .mobile-menu { display: inline-flex; }
  .collection-title-row .mobile-menu { margin-left: -5px; margin-right: 3px; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 24; background: rgb(26 32 62 / 28%); border: 0; backdrop-filter: blur(1px); }
  .sidebar-open .sidebar-scrim { display: block; }
  .collection-header .mobile-menu-button { margin-left: -5px; margin-right: 3px; }
  .collection-title-row h1, .collection-title-row h2 { margin-right: auto; }
  .mobile-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
  .mobile-toolbar .brand img { width: 26px; height: 26px; border-radius: 7px; }
  .mobile-toolbar .brand-name { font-size: 11px; }
  .mobile-toolbar .icon-button { width: 29px; height: 29px; }
  .editor-topbar { min-height: 71px; padding: 18px; }
  .editor-content { padding-left: 28px; padding-right: 28px; padding-top: 29px; --dnp-note-column-left:28px; --dnp-note-column-right:28px; }
  .editor-title, input.editor-title, .editor-title input { font-size: 28px; letter-spacing: -.8px; }
  .editor-actions .separator { margin: 0 3px; }
  .editor-actions .icon-button { width: 26px; height: 28px; }
  .editor-footer { padding-left: 18px; padding-right: 18px; }
  .editor-footer .keyboard-hint { display: none; }
}

/* Phones: a focused editor, with its collection one tap away. */
@media (max-width: 650px) {
  .site-header { min-height: 77px; height: auto; padding: 20px; gap: 15px; }
  .site-header .brand img { width: 33px; height: 33px; border-radius: 8px; }
  .site-header .brand-name { font-size: 13px; }
  .site-header .brand-subtitle { font-size: 9px; }
  .site-header .header-links { gap: 10px; }
  .site-header .store-links { gap: 11px; }
  .site-header .store-link { font-size: 0; gap: 0; }
  .site-header .store-link .icon { width: 18px; height: 18px; }
  .site-header .store-link.mac-link { display: none; }
  .site-header .brand > span { font-size: 13px; }
  .site-header .button { min-height: 31px; padding: 6px 9px; font-size: 10px; margin: 0; }
  .landing-wrap { padding: 24px 23px 38px; gap: 39px; }
  .landing-eyebrow { font-size: 9px; margin-bottom: 16px; }
  .landing-copy h1 { font-size: clamp(33px, 8.7vw, 44px); letter-spacing: -1.3px; line-height: 1.16; margin-bottom: 20px; }
  .landing-copy .slogan-prefix { font-size: 14px; margin-bottom: 12px; }
  .landing-copy > p { font-size: 13px; }
  .auth-card { max-width: none; margin-top: 23px; padding-top: 22px; }
  .auth-card h2 { font-size: 15px; }
  .auth-card .input, .auth-card input { font-size: 16px; }
  .auth-card .field > label { font-size: 11px; }
  .auth-card .button.primary { min-height: 45px; }
  .auth-meta, .auth-footnote { font-size: 9px; }
  .preview-body { grid-template-columns: 124px minmax(0, 1fr); min-height: 355px; }
  .preview-toolbar { min-height: 35px; padding: 0 12px; }
  .preview-sidebar, .preview-calendar { padding: 20px 9px; }
  .preview-sidebar .preview-calendar { padding: 18px 0 0; }
  .preview-calendar h3, .preview-sidebar h3 { font-size: 10px; margin-bottom: 15px; }
  .preview-sidebar .calendar-top, .preview-calendar .calendar-top { font-size: 9px; gap: 3px; }
  .preview-sidebar .calendar-controls, .preview-calendar .calendar-controls { gap: 0; }
  .preview-sidebar .calendar-top .icon-button, .preview-calendar .calendar-top .icon-button { width: 13px; height: 17px; }
  .preview-sidebar .day, .preview-calendar .day { font-size: 8px; width: 15px; height: 20px; }
  .preview-sidebar .calendar-grid, .preview-calendar .calendar-grid { gap: 1px 0; }
  .preview-sidebar .weekdays, .preview-calendar .weekdays { font-size: 7px; }
  .preview-note { padding: 23px 15px; }
  .preview-note h2 { font-size: 21px; letter-spacing: -.7px; margin-bottom: 16px; }
  .preview-note h3 { font-size: 9px; margin-top: 16px; }
  .preview-note p, .preview-note li, .preview-note blockquote { font-size: 9px; line-height: 1.8; }
  .preview-note blockquote { padding: 7px 8px; }
  .preview-nav { font-size: 7px; padding: 7px 4px; gap: 4px; }
  .preview-nav [data-icon] .icon { width: 11px; height: 11px; }
  .preview-note .preview-note-intro { font-size: 8px; line-height: 1.8; margin-bottom: 19px; }
  .preview-note .preview-section-label { font-size: 6px; margin: 17px 0 10px; }
  .preview-task { font-size: 8px; margin: 10px 0; gap: 6px; }
  .preview-check { width: 10px; height: 10px; font-size: 7px; }
  .preview-note .preview-quote { font-size: 10px; line-height: 1.8; }
  .preview-note-line { margin: 20px 0 16px; }
  .preview-toolbar { font-size: 8px; }
  .preview-toolbar .pill { font-size: 7px; padding: 2px 4px; }
  .preview-bottom { font-size: 8px; padding: 9px 12px; }
  .preview-folder { font-size: 9px; padding: 6px 3px; gap: 6px; }
  .preview-folder .icon { width: 11px; height: 11px; }
  .preview-section-label { font-size: 7px; }
  .preview-caption { font-size: 10px; gap: 7px 11px; }
  .preview-caption .text-button { font-size: 10px; }
  .landing-footer { margin: 0 23px; padding-top: 20px; flex-wrap: wrap; font-size: 10px; }
  .landing-footer .footer-links { gap: 15px; }
  .site-footer { margin: 0 23px; font-size: 9px; padding-top: 18px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .demo-banner { min-height: 36px; font-size: 9px; padding: 6px 30px 6px 11px; gap: 6px; text-align: center; }
  .demo-banner .text-button { font-size: 9px; }
  .demo-banner .icon { width: 12px; height: 12px; }
  .demo-banner .icon-button { right: 5px; width: 21px; height: 21px; }
  .collection-pane { display: none; grid-column: 1; }
  .editor-pane { grid-column: 1; }
  .mobile-show-list .collection-pane, .list-open .collection-pane { display: flex; }
  .mobile-show-list .editor-pane, .list-open .editor-pane { display: none; }
  .collection-header { padding: 22px 24px 17px; }
  .collection-header h1, .collection-header h2 { font-size: 24px; }
  .collection-header .icon-button { width: 34px; height: 34px; }
  .collection-header p, .collection-subtitle { font-size: 12px; }
  .collection-pane .search-field { min-height: 40px; padding: 9px 12px; margin: 0 24px 19px; }
  .collection-pane .search-field input { font-size: 14px; }
  .collection-pane .search-field .icon { width: 16px; height: 16px; }
  .collection-tabs { padding-left: 24px; padding-right: 24px; }
  .collection-tabs button { font-size: 12px; padding: 5px 10px; }
  #mini-calendar { padding: 0 24px 18px; }
  .calendar-top { font-size: 14px; padding-bottom: 15px; }
  .calendar-top .icon-button { width: 30px; height: 30px; }
  .calendar-top .icon-button .icon { width: 16px; height: 16px; }
  .calendar-top .today-button { font-size: 11px; }
  .weekdays { font-size: 10px; }
  .calendar-grid { gap: 5px 0; }
  .day { width: 34px; height: 32px; font-size: 12px; }
  .list-heading { padding: 17px 24px 7px; font-size: 10px; }
  .notes-list-heading { padding: 17px 24px 7px; font-size: 10px; }
  .notes-list { padding: 5px 13px 14px; }
  .note-card { padding: 15px 13px; }
  .note-card-title, .note-card h3 { font-size: 14px; }
  .note-card-meta, .note-meta { font-size: 10px; }
  .note-card-excerpt, .note-excerpt { font-size: 12px; -webkit-line-clamp: 2; }
  .note-card > p { font-size: 12px; }
  .editor-topbar { min-height: 61px; padding: 12px 15px 12px 12px; gap: 7px; }
  .mobile-back { display: inline-flex; width: 31px; height: 32px; margin-right: 2px; color: var(--accent); }
  .breadcrumbs { gap: 5px; font-size: 10px; }
  .breadcrumbs > .icon:first-child { display: none; }
  .breadcrumbs > span:first-of-type { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .editor-actions { gap: 1px; }
  .editor-actions .icon-button { width: 31px; height: 31px; }
  .editor-actions .icon-button .icon { width: 17px; height: 17px; }
  .editor-actions .desktop-only { display: none; }
  .editor-top-actions { gap: 1px; }
  .editor-top-actions .icon-button { width: 29px; height: 30px; }
  .editor-content { padding: 25px 24px 0; --dnp-note-column-left:24px; --dnp-note-column-right:24px; }
  .editor-eyebrow { font-size: 9px; margin-bottom: 9px; }
  .editor-title, input.editor-title, .editor-title input { font-size: 30px; line-height: 1.3; letter-spacing: -.9px; min-height: 43px; }
  .week-strip { margin-top: 14px; margin-bottom: 12px; gap: 6px; }
  .week-strip .week-day, .week-strip > button:not(.icon-button) { min-width: 33px; flex: 1; max-width: 47px; font-size: 9px; }
  .week-strip .week-day > .date-number { font-size: 11px; }
  .editor-tools { margin-top: 12px; gap: 5px; padding: 6px 0; min-height: 42px; }
  .editor-tools .icon-button { width: 31px; height: 29px; }
  .editor-tools .icon-button .icon { width: 16px; height: 16px; }
  .editor-tools .text-button { font-size: 11px; }
  .editor-tools .tool-select, .editor-tools select { font-size: 11px; }
  .editor-tools .tool-label { display: none; }
  .editor-tools .tool-separator { margin: 0 3px; }
  .tool-group { gap: 3px; }
  .tool-divider { margin: 0 3px; }
  .font-button { margin: 0 4px; }
  .editor-paper { min-height: 80px; }
  .editor-highlight, #note-editor { font-size: max(16px, var(--note-font-size, var(--editor-font-size))); }
  .editor-footer { min-height: 35px; padding: 8px 18px calc(8px + env(safe-area-inset-bottom)); font-size: 9px; }
  .find-bar { padding: 6px 8px; gap: 4px; }
  .find-bar input { font-size: 16px; }
  .find-bar .search-field input { font-size: 16px; }
  .find-count { font-size: 9px; margin-right: 2px; }
  .find-bar .icon-button { width: 26px; height: 27px; }
  .find-bar .find-options { display: none; }
  .modal { width: min(480px, calc(100vw - 24px)); max-height: 90dvh; }
  .modal-header { padding: 20px 20px 15px; }
  .modal-body { padding-left: 20px; padding-right: 20px; }
  .modal-footer { padding: 15px 20px 19px; }
  .modal .input, .modal .field input:not([type="checkbox"]):not([type="range"]) { font-size: 16px; }
  .modal.search-modal { width: calc(100vw - 24px); }
  .conflict-comparison { grid-template-columns: minmax(0, 1fr); }
  .version-text { min-height: 150px; }
  .setting-row { gap: 14px; }
  .setting-row select { max-width: 160px; }
  .search-modal .search-field input { font-size: 16px; }
  .search-result h3 { font-size: 13px; }
  .search-result p { font-size: 12px; }
  .toast { bottom: max(20px, env(safe-area-inset-bottom)); font-size: 11px; padding: 10px 13px; }
  .sidebar { padding-bottom: calc(17px + env(safe-area-inset-bottom)); }
  .folder-row { min-height: 39px; font-size: 12px; }
  .folder-row .row-more { opacity: 1; }
  .folder-options { opacity: 1; top: 6px; }
  .nav-item { font-size: 13px; min-height: 44px; }
}

@media (max-width: 370px) {
  .site-header { padding: 17px; }
  .site-header .header-links { gap: 7px; }
  .site-header .store-links { gap: 8px; }
  .site-header .brand { gap: 7px; }
  .site-header .brand-name { font-size: 12px; }
  .landing-wrap { padding-left: 20px; padding-right: 20px; }
  .landing-copy h1 { font-size: 31px; }
  .preview-body { grid-template-columns: 107px minmax(0, 1fr); }
  .preview-sidebar, .preview-calendar { padding-left: 5px; padding-right: 5px; }
  .preview-note { padding-left: 12px; padding-right: 12px; }
  .preview-note h2 { font-size: 19px; }
  .editor-content { padding-left: 19px; padding-right: 19px; --dnp-note-column-left:19px; --dnp-note-column-right:19px; }
  .editor-actions .icon-button { width: 28px; }
  .week-strip { gap: 1px; }
  .week-strip .week-day, .week-strip > button:not(.icon-button) { min-width: 31px; }
}

@media (max-height: 730px) and (min-width: 901px) {
  .sidebar { padding-top: 20px; }
  .sidebar > .brand, .sidebar-brand { margin-bottom: 25px; }
  .sidebar-section { margin-top: 22px; }
  .collection-header { padding-top: 19px; padding-bottom: 14px; }
  #mini-calendar { padding-bottom: 14px; }
  .calendar-top { padding-bottom: 9px; }
  .calendar-grid { gap: 2px 1px; }
  .editor-topbar { min-height: 67px; padding-top: 15px; padding-bottom: 15px; }
  .editor-content { padding-top: 26px; }
  .week-strip { margin-top: 11px; margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .button, .icon-button, .nav-item, .folder-row, .note-card, .day { border: 1px solid ButtonText; }
  .note-card.is-active, .nav-item.is-active, .day.is-selected { outline: 2px solid Highlight; }
  .editor-highlight mark { forced-color-adjust: none; background: Mark; }
}

@media print {
  :root, body[data-theme="dark"] { --ink: #000; --ink-soft: #111; --surface: #fff; --muted: #555; --line: #ddd; }
  @page { size: auto; margin: 20mm 18mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > :not(#print-note) { display: none !important; }
  .print-note { display: block !important; position: static; color: #111; font-family: var(--editor-font, var(--font-note)); }
  .print-note h1 { color: #000; font-size: 25pt; font-weight: 600; line-height: 1.3; margin: 0 0 9pt; letter-spacing: -.6pt; }
  .print-note .print-meta, .print-note .print-date { font-family: var(--font-sans); font-size: 9pt; color: #666; margin: 0 0 18pt; }
  .print-note pre, .print-note .print-content { display: block; margin: 16pt 0 0; padding: 0; white-space: pre-wrap; overflow-wrap: break-word; font: 11pt/1.7 var(--editor-font, var(--font-note)); }
}

/* Final helpers for the shipped HTML. Main visual styles live in styles.css. */

/* The skip link stays available to the keyboard without appearing off-focus. */
.skip-link {
  clip-path: inset(50%);
  pointer-events: none;
  max-width: calc(100vw - 24px);
}
.skip-link:focus {
  clip-path: none;
  pointer-events: auto;
  transform: translateY(0);
}

/* Keep the opening clause readable as part of the complete headline. */
.landing-copy .slogan-prefix {
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.5;
  letter-spacing: -.15px;
}
.landing-copy, .landing-preview, .collection-pane, .editor-pane { min-width: 0; }
.editor-title { overflow-wrap: anywhere; }
.editor-top-actions { flex-shrink: 0; }
.calendar-top > div { display: flex; align-items: center; gap: 2px; }

/* Color accompanies the written save status; it does not replace the label. */
.status-dot.saved { background: var(--success); }
.status-dot.saving { background: var(--accent); }
.status-dot.unsaved, .status-dot.offline { background: var(--warning); }
.status-dot.conflict { background: var(--warning); }
.status-dot.error { background: var(--danger); }
.status-dot.loading { background: var(--muted); }

.sidebar-scrim[hidden] { display: none !important; }
.toast-container { pointer-events: none; }
.toast-container:empty { display: none; }

@media (max-width: 900px) {
  /* A translated drawer must also leave the keyboard focus order when closed. */
  .app-shell:not(.sidebar-open) > .sidebar {
    visibility: hidden;
    pointer-events: none;
  }
  .app-shell.sidebar-open > .sidebar {
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 650px) {
  /* Preserve room for the word count and actionable save state on phones. */
  .editor-footer .footer-hint { display: none; }
}
/* A compact, Mac-style folder/file browser in the collection pane. */
.folder-browser {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  flex: 1; min-height: 0; overflow: hidden; border-top: 1px solid var(--line);
}
.browser-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.browser-column + .browser-column { border-left: 1px solid var(--line); }
.browser-column-header {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  min-height: 40px; padding: 5px 8px 5px 11px; border-bottom: 1px solid var(--line);
  background: var(--surface-soft); gap: 5px;
}
.browser-column-header h3 { margin: 0; font-size: 12px; font-weight: 600; }
.browser-column-header .icon-button { width: 27px; height: 27px; }
.browser-list { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding: 3px; }
#folder-browser .browser-row-wrap { display: flex; align-items: center; position: relative; border-radius: var(--selection-radius); margin: 1px 0; }
#folder-browser .browser-row-wrap:nth-child(even) { background: var(--surface-soft); }
#folder-browser .browser-row {
  display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; min-height: 34px;
  padding: 5px 6px; border: 2px solid transparent; border-radius: var(--selection-radius);
  background: transparent; color: var(--ink-soft); text-align: left; font-size: 11px; line-height: 1.5;
}
#folder-browser .browser-row.is-active { border-color: var(--selection-border); color: var(--accent); }
#folder-browser .browser-row:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
#folder-browser .browser-row .row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#folder-browser .browser-row > .icon { width: 16px; height: 16px; color: var(--muted); }
#folder-browser .folder-row > .icon { color: #3694ce; }
#folder-browser .browser-row-options {
  position: absolute; right: 3px; top: 5px; width: 24px; height: 24px;
  opacity: 0; pointer-events: none; background: var(--surface); border-radius: var(--selection-radius);
}
#folder-browser .browser-row-wrap:hover .browser-row-options,
#folder-browser .browser-row-wrap:focus-within .browser-row-options { opacity: 1; pointer-events: auto; }
#folder-browser .browser-row-wrap:hover .browser-row,
#folder-browser .browser-row-wrap:focus-within .browser-row { padding-right: 27px; }
.browser-empty { margin: 0; padding: 13px 8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
#folder-browser .browser-row-wrap.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
#folder-browser .drop-before::before, #folder-browser .drop-after::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--accent);
  z-index: 2; pointer-events: none;
}
#folder-browser .drop-before::before { top: -1px; }
#folder-browser .drop-after::after { bottom: -1px; }
.bullet-symbol { font-size: 21px; line-height: 1; }
.preview-bullet { color: var(--accent); font-size: 13px; line-height: 1.2; flex-shrink: 0; }
@media (hover: none) {
  #folder-browser .browser-row-options { opacity: 1; pointer-events: auto; }
  #folder-browser .browser-row { padding-right: 27px; }
}
@media (max-width: 650px) {
  .browser-column-header { min-height: 44px; padding-left: 12px; }
  #folder-browser .browser-row { min-height: 40px; font-size: 12px; }
  #folder-browser .browser-row-options { top: 7px; }
}
@media (forced-colors: active) {
  .date-number, #folder-browser .browser-row { border-color: transparent; }
  .day.is-selected > .date-number, .week-day.is-selected > .date-number,
  #folder-browser .browser-row.is-active { border-color: Highlight; }
  .day.has-note > .date-number, .week-day.has-note > .date-number { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .day.has-holiday > .date-number::after, .week-day.has-holiday > .date-number::after { background: CanvasText; }
  .day.is-today > .date-number, .week-day.is-today > .date-number { text-decoration: underline; }
}

/* A concrete account limit is shown only beside a new calendar page. */
.calendar-limit-banner { margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line-strong); background: var(--surface-soft); border-radius: 9px; font-size: 12px; color: var(--ink-soft); }
.calendar-limit-banner p { margin: 0 0 9px; }
.calendar-limit-banner > div { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.calendar-limit-banner a, .calendar-limit-banner .text-button { font-size: 11px; }

/* ===== Inline: premium.css ===== */
/* Premium is intentionally isolated from calendar, folder, editor and authentication styles. */
.premium-nav { margin: 8px 0 10px; border: 1px solid var(--line-strong); background: var(--surface); }
.premium-nav > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.premium-nav small { font-size: 10px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.premium-nav .premium-symbol { font-size: 19px; color: var(--accent); }
.premium-modal { width: min(620px, calc(100vw - 24px)); }
.premium-modal .modal-header { align-items: flex-start; padding-bottom: 12px; }
.premium-eyebrow { color: var(--accent); font-size: 9px; font-weight: 650; letter-spacing: .11em; margin: 0 0 8px; }
.premium-modal h2 { font-size: 25px; letter-spacing: -.6px; }
.premium-intro { max-width: 470px; margin-bottom: 20px; }
.premium-plans { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.premium-plan { padding: 17px 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-soft); }
.premium-plan.monthly { border-color: var(--accent); background: var(--accent-soft); }
.premium-plan .premium-plan-tag { color: var(--accent); font-size: 10px; font-weight: 600; }
.premium-plan h3 { margin: 12px 0 9px; color: var(--ink); font-size: 15px; }
.premium-price { display: flex; align-items: baseline; gap: 5px; color: var(--ink); font-size: 33px; font-weight: 650; letter-spacing: -1px; }
.premium-price > span { color: var(--ink-soft); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.premium-plan p { color: var(--ink-soft); font-size: 11px; margin: 7px 0 17px; }
.premium-plan .button { width: 100%; padding: 10px 7px; min-height: 43px; font-size: 11px; }
.premium-plan small { display: block; color: var(--ink-soft); font-size: 9px; line-height: 1.65; margin-top: 10px; }
.premium-modal .premium-terms, .premium-upgrade-note { font-size: 10px; color: var(--ink-soft); line-height: 1.7; margin: 17px 0 10px; }
.premium-free { padding-top: 12px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); line-height: 1.7; }
.premium-links { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.premium-links .text-button, .premium-links a { font-size: 10px; }
.premium-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 25px 19px; border-top: 1px solid var(--line); }
.premium-bottom span { font-size: 10px; color: var(--muted); }
.premium-current { padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; background: var(--success-soft); color: var(--ink-soft); font-size: 11px; }
.premium-success-mark { margin: 10px 0 20px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: var(--success); background: var(--success-soft); font-size: 29px; }
.premium-loading { min-height: 80px; display: flex; align-items: center; color: var(--muted); }
@media (max-width: 440px) {
  .premium-plans { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .premium-plan { padding: 13px 15px; }
  .premium-plan h3 { margin-top: 4px; }
  .premium-price { font-size: 29px; }
  .premium-plan p { margin-bottom: 10px; }
  .premium-modal .modal-header, .premium-modal .modal-body { padding-left: 19px; padding-right: 19px; }
  .premium-bottom { padding-left: 19px; padding-right: 19px; }
}


/* DNP3 localized UI: no note text or note data is rewritten. */
html[dir="rtl"] .nav-item, html[dir="rtl"] .action-row, html[dir="rtl"] .note-card, html[dir="rtl"] .browser-row, html[dir="rtl"] .sidebar-search, html[dir="rtl"] .app-brand, html[dir="rtl"] .account-card { text-align: start; }
html[dir="rtl"] .editor-top-actions { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .sidebar-search kbd, html[dir="rtl"] .nav-count { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .email-input-wrap > [data-icon] { left:auto; right:13px; }
html[dir="rtl"] .email-input-wrap .input { padding-left:13px; padding-right:40px; }
html[dir="rtl"] .sidebar, html[dir="rtl"] .collection-pane { border-right:0; border-left:1px solid var(--line); }
html[dir="rtl"] #folder-browser .browser-row-options { right:auto; left:3px; }
html[dir="rtl"] #folder-browser .browser-row-wrap:hover .browser-row, html[dir="rtl"] #folder-browser .browser-row-wrap:focus-within .browser-row { padding-right:6px; padding-left:27px; }
#note-editor, .editor-highlight, .print-note pre, .version-text, .backup-preview-text { unicode-bidi:plaintext; text-align:start; }
@media (max-width:900px) { html[dir="rtl"] .sidebar { left:auto; right:0; transform:translateX(100%); } html[dir="rtl"] .app-shell.sidebar-open .sidebar { transform:translateX(0); } }
html[dir="rtl"] .button, html[dir="rtl"] .nav-item { letter-spacing:normal; }
/* Keep Korean headline words together without changing the layout. */
html[lang="ko"] .landing-copy h1 { word-break:keep-all; overflow-wrap:anywhere; }

/* DNP3_APP_CHOOSER_V1_BEGIN: public landing header only. */
#landing-view > .site-header {
  height: auto;
  padding-block: 28px 0;
  align-items: flex-start;
  gap: 28px;
}
#landing-view > .site-header > .brand { margin-block-start: 31px; flex: 0 0 auto; }
.dnp-edition-guide { width: min(880px, 100%); min-width: 0; margin-inline-start: auto; }
.dnp-edition-guide > h2 {
  margin: 0 0 11px; color: var(--ink-soft); font-size: 12px; line-height: 1.5;
  font-weight: 550; letter-spacing: 0; text-align: start;
}
.dnp-edition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dnp-edition {
  min-width: 0; display: flex; flex-direction: column; padding: 18px 19px 17px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); text-align: start;
}
.dnp-edition--sync { border-color: #d3daf4; background: #f7f9ff; }
.dnp-edition-kicker { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--accent); font-size: 11px; line-height: 1.5; }
.dnp-edition--local .dnp-edition-kicker { color: var(--ink-soft); }
.dnp-edition h3 { margin: 0 0 9px; font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -.25px; }
.dnp-edition-description { margin: 0 0 8px; font-size: 12px; line-height: 1.65; color: var(--ink-soft); overflow-wrap: anywhere; }
.dnp-edition-detail { margin: 0 0 8px; font-size: 11px; line-height: 1.65; color: var(--ink-soft); overflow-wrap: anywhere; }
.dnp-edition-detail > span { display: block; }
.dnp-edition-detail > span + span { margin-top: 5px; }
.dnp-edition-links { display: flex; align-items: stretch; flex-wrap: wrap; gap: 7px; padding-top: 8px; margin-top: auto; }
.dnp-edition-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 7px;
  color: var(--ink-soft); background: var(--surface); font-size: 11px; font-weight: 550;
  line-height: 1.4; text-decoration: none; white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.dnp-edition-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dnp-edition-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.dnp-edition-guide [data-icon] { pointer-events: none; }
@media (max-width: 1050px) {
  #landing-view > .site-header { flex-wrap: wrap; gap: 21px; }
  #landing-view > .site-header > .brand { margin-block-start: 0; }
  .dnp-edition-guide { width: 100%; }
}
@media (max-width: 650px) {
  #landing-view > .site-header { padding-block: 22px 0; gap: 20px; }
  .dnp-edition-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dnp-edition { padding: 17px; }
  .dnp-edition-guide > h2 { font-size: 12px; }
  .dnp-edition-link { min-height: 44px; font-size: 12px; }
}
@media (forced-colors: active) {
  .dnp-edition, .dnp-edition-link { border-color: ButtonText; }
}
/* DNP3_APP_CHOOSER_V1_END */

/* DNP3_ADD_NOTES_V1_CSS */
.modal:has(.dnp-import-counts) { width:min(680px,calc(100vw - 24px)); }
.modal:has(.dnp-import-counts) .modal-footer { position:sticky; bottom:0; background:var(--surface); z-index:2; flex-wrap:wrap; }
.dnp-import-actions { flex-wrap: wrap; gap: 12px 18px; }
.dnp-import-actions .text-button, .backup-actions .button { white-space: normal; text-align: start; }
.dnp-import-counts { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; }
.dnp-import-renames { margin:12px 0; font-size:11px; overflow-wrap:anywhere; }
.dnp-import-renames summary { cursor:pointer; color:var(--ink-soft); }
.dnp-import-renames p { margin:8px 0; }
#dnp-import-progress, #dnp-import-read-status { margin:12px 0 0; color:var(--ink-soft); font-size:12px; }
#dnp-add-files { height:auto; white-space:normal; font-size:12px; }
.dnp-transfer-faq h3 { line-height:1.55; margin-bottom:8px; }
.dnp-transfer-faq h3:first-child { margin-top:0; }
.dnp-transfer-faq p { color:var(--ink-soft); font-size:12px; line-height:1.8; overflow-wrap:anywhere; }
.dnp-transfer-intro { max-width:1256px; margin:0 auto 22px; padding:22px 25px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.dnp-transfer-intro h2 { font-size:16px; margin:0 0 7px; font-weight:600; }
.dnp-transfer-intro p { color:var(--ink-soft); font-size:12px; line-height:1.8; max-width:850px; margin:0 0 10px; }
.dnp-transfer-intro .text-button { font-size:12px; }
@media(max-width:1360px) { .dnp-transfer-intro { margin-inline:36px; } }
@media(max-width:650px) { .dnp-transfer-intro { margin-inline:23px; padding:20px; } .dnp-import-actions { align-items:flex-start; } }

/* DNP3_WEB_CALENDAR_MARKERS_V1_BEGIN: original dimensions/fonts; only move the numeral. */
.date-number > .dnp-date-label { display:inline-block; }
.day.has-holiday .dnp-date-label, .week-day.has-holiday .dnp-date-label { transform:translateY(-1.5px); }
.day.has-moon .dnp-date-label { transform:translateY(-4px); }
.week-day.has-moon .dnp-date-label { transform:translateY(-4.5px); }
.dnp-moon-marker {
  position:absolute; left:50%; bottom:1px; transform:translateX(-50%);
  display:inline-block; font-size:9px; line-height:1; font-weight:400;
  color:rgba(110,97,199,.78); pointer-events:none;
}
.week-day .dnp-moon-marker { font-size:10px; bottom:0; }
/* Keep the holiday dot at its original center; place the moon beside it. */
.has-holiday .dnp-moon-marker { left:calc(50% + 4px); transform:none; }
#editor-subtitle .dnp-holiday-label { color:var(--calendar-holiday-dot); }
#editor-subtitle .dnp-moon-label { color:rgba(110,97,199,.78); }
/* DNP3_WEB_CALENDAR_MARKERS_V1_END */


/* Note styling shares the existing editor tools row. */
.editor-tools { container-type:inline-size; }
.editor-tools > .tool-group { min-width:0; overflow-x:auto; scrollbar-width:thin; }
.editor-tools > .tool-group > * { flex-shrink:0; }
.editor-tools #find-button { flex:0 0 auto; min-width:26px; min-height:26px; }
.note-style-toolbar { display:flex; align-items:center; flex:0 0 auto; gap:3px; }
.note-style-toolbar[hidden] { display:none; }
.note-style-toggles { display:flex; align-items:center; gap:1px; }
.note-style-toolbar button { border:0; box-shadow:none; background:transparent; color:var(--muted); cursor:pointer; padding:0; display:grid; place-items:center; width:24px; height:26px; border-radius:4px; }
.note-style-toggles button { font-size:12px; line-height:1; }
.note-style-toolbar button:hover:not(:disabled) { background:var(--surface-hover); color:var(--ink); }
.note-style-toggles button[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent); }
.note-style-toolbar .note-style-color { width:26px; }
.note-style-color::after { content:""; width:13px; height:13px; border-radius:50%; background:var(--note-style-color,var(--editor-text-color,#292c36)); box-shadow:0 0 0 1px color-mix(in srgb,var(--ink-soft) 20%,transparent); }
.note-style-background::after { content:""; width:13px; height:13px; border-radius:2px; background:var(--note-background,#ffffff); box-shadow:0 0 0 1px color-mix(in srgb,var(--ink-soft) 30%,transparent); }
.day[data-note-background] > .date-number, .week-day[data-note-background] > .date-number { background:var(--note-background); color:#343845; box-shadow:none; }
#folder-browser .file-row-wrap[data-note-background] { background:var(--note-background); box-shadow:inset 0 0 0 1px #34384512; }
#folder-browser .file-row-wrap[data-note-background] .browser-row, #folder-browser .file-row-wrap[data-note-background] .browser-row-options { color:#343845; background:transparent; }
.note-background-palette button[aria-pressed="true"] { outline:2px solid var(--accent); outline-offset:3px; }
.note-style-toolbar button:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.note-style-toolbar button:disabled { cursor:default; opacity:.45; }
#note-horizontal-rule[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent); }
#note-horizontal-rule::after { content:""; display:block; width:15px; height:1px; background:currentColor; }
#note-editor [data-dnp-paragraph] { display:block; position:relative; margin:0; padding:0; white-space:pre-wrap; }
#note-editor [data-dnp-paragraph][data-dnp-rule] { padding-bottom:8px; }
#note-editor [data-dnp-paragraph][data-dnp-rule]::after { content:""; position:absolute; left:0; bottom:3px; width:var(--dnp-rule-width,240px); height:1px; background:#b8b8b8; pointer-events:none; }
#note-editor [data-dnp-break] { white-space:normal; }
@container (max-width:420px) {
  .editor-tools #find-button .find-label { display:none; }
}
@container (max-width:330px) {
  .editor-tools > .tool-group { gap:2px; }
  .editor-tools .icon-button { width:24px; }
  .editor-tools .font-button { margin:0 3px; }
  .editor-tools .font-button .icon { display:none; }
  .editor-tools .tool-divider { margin:0 3px; }
  .note-style-toggles { gap:0; }
  .note-style-toolbar { gap:2px; }
  .note-style-toolbar .note-style-color { width:24px; }
}
.note-color-palette { display:flex; flex-wrap:wrap; justify-content:center; gap:12px; margin:16px 0; }
.note-color-palette button { width:33px; height:33px; border-radius:9px; border:1px solid #9996; cursor:pointer; }
#note-editor[data-empty="true"]::before { content:attr(data-placeholder); color:#b2b8ca; pointer-events:none; position:absolute; }
#note-editor mark { color:inherit; background:var(--find); border-radius:2px; padding:0; }
#note-editor mark.current-match { background:var(--find-current); box-shadow:0 0 0 1px #d9ab49; }
#note-editor [style] { font-family:inherit; font-size:inherit; line-height:inherit; }
#note-editor[aria-disabled="true"] { opacity:1; }


/* DNP3_ATTACHMENT_EDGE_TO_EDGE_V1 */
.editor-pane { container-type:inline-size; }
.editor-content > #note-attachments { box-sizing:border-box; align-self:center; width:100%; max-width:none; margin-inline:0; padding-inline:0; }
@supports (width: 1cqw) {
  .editor-content > #note-attachments { width:100cqw; }
}
#note-attachments #attachment-strip { margin-inline:0; padding-inline:0; }
.editor-content { position:relative; }
/* Keep the overlay centered on the editor pane, not its padded text column. */
.editor-content > #note-attachments { position:absolute; left:50% !important; right:auto !important; bottom:0; transform:translateX(-50%); }

/* Optional cycle markers and local note export controls. */
.date-number.has-cycle-markers > .dnp-date-label { transform:translateY(-5px); }
.date-number > .dnp-cycle-markers { position:absolute; left:50%; bottom:0; transform:translateX(-50%); font-size:9px; line-height:11px; white-space:nowrap; letter-spacing:-1px; font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; pointer-events:none; }
.week-day .dnp-cycle-markers { font-size:10px; }
.dnp-cycle-predicted { opacity:.18; }
/* DNP3_WEB_HOLIDAY_EMOJI_ROW_V2: one real dot and a single centered marker row. */
/* The original centered dot remains for a holiday with no other markers. */
.day.has-holiday > .date-number.has-holiday-marker-row::after,
.week-day.has-holiday > .date-number.has-holiday-marker-row::after {
  content: none;
}
/* Disable the legacy outer-cell dot too, if that optional style is present. */
#mini-calendar .day.has-holiday:has(> .date-number.has-holiday-marker-row)::after,
#week-strip .week-day.has-holiday:has(> .date-number.has-holiday-marker-row)::after {
  content: none;
}
.date-number.has-holiday-marker-row {
  container-type: inline-size;
}
.date-number.has-holiday-marker-row > .dnp-date-label,
.week-day > .date-number.has-holiday-marker-row[data-dnp-phase] > .dnp-date-label {
  transform: translateY(-5px);
}
.date-number.has-holiday-marker-row > .dnp-cycle-markers {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  direction: ltr;
  width: max-content;
  --dnp-marker-font: 9px;
  font-size: var(--dnp-marker-font);
  /* Keep normal sizes for simple dates; make crowded rows fit narrow chips. */
  font-size: min(var(--dnp-marker-font), calc((100cqi - 6px) / var(--dnp-marker-count, 1) / 1.25));
}
.week-day > .date-number.has-holiday-marker-row > .dnp-cycle-markers {
  --dnp-marker-font: 10px;
}
.dnp-cycle-markers > .dnp-holiday-dot {
  display: block;
  flex: 0 0 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--calendar-holiday-dot);
}
.dnp-cycle-markers > .dnp-holiday-emoji-group {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}
@media (forced-colors: active) {
  .dnp-cycle-markers > .dnp-holiday-dot {
    background: CanvasText;
    forced-color-adjust: none;
  }
}
#editor-subtitle .dnp-cycle-label { color:#c54b7b; }
body[data-theme="dark"] #editor-subtitle .dnp-cycle-label { color:#f29ebf; }
.note-cycle-shortcut { font-size:17px; }
.note-cycle-shortcut[hidden] { display:none; }
.dnp-cycle-controls { display:flex; align-items:center; gap:12px; }
.dnp-cycle-emoji { width:55px; text-align:center; padding:7px; font-size:20px; }
.dnp-cycle-length { width:84px; text-align:center; }
.dnp-cycle-history .setting-row { gap:12px; flex-wrap:wrap; }
.dnp-note-bottom-tools { display:flex; align-items:center; justify-content:center; gap:18px; padding:7px 18px; border-top:1px solid var(--line); background:var(--surface); }
.dnp-note-bottom-tools .icon-button, .dnp-note-bottom-tools #find-button { width:32px; height:32px; min-width:32px; padding:0; justify-content:center; }
.dnp-note-bottom-tools .find-label { display:none; }
.dnp-export-formats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.dnp-export-formats button { justify-content:flex-start; text-align:start; }
@media(max-width:400px){.dnp-export-formats{grid-template-columns:1fr;}}
