:root {
  color-scheme: light;
  --ink: #25251f;
  --muted: #78766c;
  --faint: #aaa79d;
  --paper: #fbfaf6;
  --paper-deep: #f3f0e7;
  --white: #ffffff;
  --line: #e5e1d7;
  --accent: #daa464;
  --accent-hover: #cd9554;
  --accent-dark: #765020;
  --accent-soft: #f8efe3;
  --accent-foreground: #3f2c18;
  --accent-rgb: 218, 164, 100;
  --sage: #627862;
  --sage-soft: #e4ece1;
  --blue: #54728f;
  --blue-soft: #e1eaf2;
  --yellow: #a67724;
  --yellow-soft: #f4ead2;
  --shadow: 0 18px 50px rgba(48, 43, 31, 0.12);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(84, 114, 143, 0.09), transparent 28rem),
    var(--paper);
}
[hidden] { display: none !important; }

.auth-root { min-height: 100vh; }
.auth-loading, .auth-fatal { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; }
.auth-loading p, .auth-fatal p { color: var(--muted); font-size: 13px; }
.auth-fatal h1 { margin: 10px 0 0; font-size: 34px; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .9fr) minmax(520px, 1.1fr); }
.auth-intro { position: relative; min-height: 100vh; overflow: hidden; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; color: #fdfcf8; background: #31483e; }
.auth-intro::before, .auth-intro::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.auth-intro::before { width: 520px; height: 520px; right: -250px; top: -170px; }
.auth-intro::after { width: 330px; height: 330px; left: -170px; bottom: -150px; }
.auth-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.auth-brand strong { color: #f4efe4; font-family: inherit; font-size: 22px; font-weight: 500; line-height: 1; letter-spacing: 0; }
.auth-intro-copy { position: relative; z-index: 1; max-width: 570px; margin: auto 0; }
.auth-eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.auth-intro h1 { margin: 18px 0 22px; font-size: clamp(44px, 5vw, 70px); line-height: .98; letter-spacing: -.045em; }
.auth-intro-copy > p { max-width: 500px; color: rgba(255,255,255,.68); font-size: 15px; line-height: 1.7; }
.auth-privacy { max-width: 465px; margin-top: 34px; padding: 15px 17px; display: flex; align-items: center; gap: 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 14px; background: rgba(255,255,255,.06); backdrop-filter: blur(10px); }
.auth-privacy svg { width: 24px; height: 24px; flex: 0 0 24px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-privacy span { color: rgba(255,255,255,.6); font-size: 11px; line-height: 1.45; }
.auth-privacy strong { display: block; margin-bottom: 2px; color: #fff; font-size: 12px; font-weight: 600; }
.auth-gujarati { position: relative; z-index: 1; color: rgba(255,255,255,.4); font-size: 11px; }
.auth-panel { min-height: 100vh; padding: clamp(28px, 6vw, 84px); display: grid; place-items: center; }
.auth-card { width: min(430px, 100%); }
.auth-card-heading > span { color: var(--accent-dark); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-card-heading h2 { margin: 9px 0 8px; font: 500 36px/1.08 Georgia, serif; letter-spacing: -.03em; }
.auth-card-heading p { margin-bottom: 25px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-socials { display: grid; gap: 9px; }
.social-auth-button { min-height: 45px; padding: 0 14px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 11px; border: 1px solid #dcd7cb; border-radius: 8px; color: var(--ink); background: rgba(255,255,255,.9); cursor: pointer; font-size: 12px; font-weight: 550; box-shadow: 0 1px 2px rgba(49,44,34,.05); }
.social-auth-button svg { width: 19px; height: 19px; }
.social-auth-button:hover:not(:disabled) { border-color: #c8c0b2; background: var(--accent-soft); box-shadow: 0 2px 5px rgba(49,44,34,.07); }
.social-auth-button:disabled { cursor: not-allowed; opacity: .55; }
.social-auth-button small { color: var(--faint); font-size: 8px; font-weight: 500; }
.auth-divider { margin: 21px 0; display: flex; align-items: center; gap: 11px; color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: #504e46; font-size: 10px; font-weight: 600; }
.auth-form input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #ddd8cc; border-radius: 10px; color: var(--ink); background: #fff; font-size: 12px; transition: border-color .16s ease, box-shadow .16s ease; }
.auth-form input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.24); }
.auth-submit { width: 100%; margin-top: 3px; }
.auth-error { margin: -3px 0 0; padding: 9px 11px; border: 1px solid #ecc0ba; border-radius: 9px; color: #963b32; background: #fff2ef; font-size: 10px; line-height: 1.45; }
.auth-notice { margin: 0 0 18px; padding: 11px 13px; border: 1px solid #bdd5c2; border-radius: 10px; color: #315d3c; background: #f0f8f1; font-size: 11px; line-height: 1.5; }
.auth-notice.is-error { border-color: #ecc0ba; color: #963b32; background: #fff2ef; }
.auth-switch { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.auth-switch button { padding: 0; border: 0; color: var(--accent-dark); background: transparent; cursor: pointer; font-weight: 600; }
.auth-secondary-actions { margin-top: 13px; display: flex; justify-content: space-between; gap: 12px; }
.auth-secondary-actions button { min-height: 44px; padding: 0; border: 0; color: var(--accent-dark); background: transparent; cursor: pointer; font-size: 10px; font-weight: 600; }
.auth-legal { margin: 16px 0 0; display: flex; justify-content: center; gap: 8px; color: var(--faint); font-size: 10px; }
.auth-legal a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); text-underline-offset: 2px; }
.auth-legal span { align-self: center; }
html[lang="gu"] body { font-family: "Noto Sans Gujarati", "Gujarati Sangam MN", "Shruti", ui-sans-serif, sans-serif; }
html[lang="gu"] h1, html[lang="gu"] h2, html[lang="gu"] h3, html[lang="gu"] .brand strong, html[lang="gu"] .viewer-title, html[lang="gu"] .editor-title, html[lang="gu"] .editor-body, html[lang="gu"] .viewer-body { font-family: "Noto Sans Gujarati", "Gujarati Sangam MN", "Shruti", ui-sans-serif, sans-serif; }

button, input, textarea, select { font: inherit; }
button { color: inherit; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
button:disabled { pointer-events: none; cursor: not-allowed; opacity: .6; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), .72);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 258px 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  background: var(--paper-deep);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 24px; }
.brand-mark {
  --brand-mark-size: clamp(1.9375rem, 1.81rem + .34vw, 2.1875rem);
  width: var(--brand-mark-size); height: var(--brand-mark-size);
  flex: 0 0 var(--brand-mark-size);
  display: grid; place-items: center;
  overflow: visible; background: none;
}
.brand-mark img {
  width: 100%; height: 100%; display: block;
  object-fit: contain; background: transparent;
  filter: drop-shadow(0 1px 1px rgba(16, 39, 31, .18)) drop-shadow(0 3px 5px rgba(16, 39, 31, .12));
}
.brand strong { display: block; color: #315c4d; font-family: inherit; font-size: 19px; font-weight: 600; letter-spacing: 0; }
.brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: 0.03em; }

.nav-list { display: grid; gap: 3px; margin-top: 22px; }
.nav-item {
  width: 100%; border: 0; border-radius: 10px; padding: 10px 10px; display: grid;
  grid-template-columns: 25px 1fr auto; align-items: center; text-align: left;
  color: #5f5d54; background: transparent; cursor: pointer; font-size: 14px; font-weight: 450;
}
.nav-item:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.nav-item.is-active { color: var(--accent-dark); background: var(--white); box-shadow: 0 4px 14px rgba(56,52,41,.06); }
.nav-icon { font-size: 19px; line-height: 1; }
.nav-count { min-width: 22px; padding: 2px 6px; border-radius: 20px; color: var(--muted); background: rgba(0,0,0,.045); text-align: center; font-size: 10px; }

.sidebar-section { min-height: 0; margin-top: 28px; display: flex; flex-direction: column; }
.folders-section { flex: 0 0 auto; max-height: 34vh; min-height: 0; }
.folders-section + .sidebar-section { flex: 1 1 auto; }
.section-label { padding: 0 8px 8px; display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 10px; font-weight: 450; letter-spacing: .12em; text-transform: uppercase; }
.icon-button { border: 0; background: transparent; cursor: pointer; }
.icon-button.subtle { color: var(--faint); letter-spacing: 1px; }
.sidebar-tags { overflow-x: hidden; overflow-y: auto; display: grid; gap: 2px; }
.sidebar-tag {
  border: 0; border-radius: 9px; padding: 8px 9px; display: grid; grid-template-columns: 10px 1fr auto;
  align-items: center; gap: 8px; text-align: left; background: transparent; cursor: pointer; color: #5f5d54; font-size: 13px;
}
.sidebar-tag:hover { background: rgba(255,255,255,.6); }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tag-color, var(--accent)); }
.sidebar-tag small { color: var(--faint); }
.sidebar-deleted { padding: 10px 0 8px; }
.sidebar-deleted-link { width: 100%; padding: 8px 9px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 12px; }
.sidebar-deleted-link:hover, .sidebar-deleted-link.is-active { color: var(--accent-dark); background: rgba(255,255,255,.72); }
.sidebar-deleted-link .folder-icon { color: currentColor; }
.sidebar-deleted-link small { color: var(--faint); font-size: 9px; }
.empty-tags { padding: 10px 8px; color: var(--faint); font-size: 12px; line-height: 1.45; }
.add-folder-icon { font-size: 16px; }
.sidebar-folders { max-height: calc(34vh - 27px); overflow-x: hidden; overflow-y: auto; display: grid; gap: 2px; }
.folder-tree-group { min-width: 0; display: grid; gap: 2px; }
.folder-row { position: relative; width: 100%; min-width: 0; overflow: hidden; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 2px; padding-left: calc(var(--depth, 0) * 13px); }
.folder-row.is-nested::before { content: ""; position: absolute; left: calc((var(--depth) * 13px) - 7px); top: -4px; width: 9px; height: 20px; border-left: 1px solid #d7d1c5; border-bottom: 1px solid #d7d1c5; border-radius: 0 0 0 6px; pointer-events: none; }
.folder-toggle, .folder-toggle-spacer { width: 18px; height: 26px; display: grid; place-items: center; }
.folder-toggle { padding: 0; border: 0; border-radius: 6px; color: var(--faint); background: transparent; cursor: pointer; }
.folder-toggle:hover { color: var(--ink); background: rgba(255,255,255,.75); }
.folder-toggle svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.folder-toggle.is-expanded svg { transform: rotate(90deg); }
.folder-select { width: 100%; min-width: 0; overflow: hidden; padding: 7px 5px; display: flex; align-items: center; gap: 7px; border: 0; border-radius: 8px; color: #5f5d54; background: transparent; cursor: pointer; text-align: left; font-size: 12px; }
.folder-select:hover, .folder-row.is-active .folder-select { color: var(--accent-dark); background: rgba(255,255,255,.72); }
.folder-select span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-icon { width: 16px; height: 16px; flex: 0 0 16px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; color: #a37a35; }
.folder-row.is-active .folder-icon { color: var(--accent-dark); }
.folder-count { margin-left: auto; color: var(--faint); font-size: 9px; }
.folder-more { width: 25px; height: 25px; border: 0; border-radius: 7px; color: var(--faint); background: transparent; cursor: pointer; opacity: 0; }
.folder-row:hover .folder-more, .folder-more:focus-visible { opacity: 1; }
.folder-more:hover { color: var(--ink); background: #fff; }

.sidebar-footer { margin-top: auto; padding-top: 14px; }
.settings-button { width: 100%; margin-top: 3px; padding: 9px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 11px; font-weight: 500; transition: color .16s ease, background-color .16s ease; }
.settings-button span, .settings-button small, .mobile-drawer-settings span, .mobile-drawer-settings small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-button small, .mobile-drawer-settings small { margin-top: 3px; color: var(--faint); font-size: 8px; font-weight: 400; }
.settings-button:hover { color: var(--ink); background: rgba(255,255,255,.68); }

.main-area { min-width: 0; }
.mobile-header, .mobile-nav { display: none; }
.mobile-drawer, .mobile-drawer-scrim { display: none; }
.app-content { max-width: 1260px; margin: 0 auto; padding: 42px clamp(28px, 5vw, 72px) 80px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-family: Georgia, serif; font-size: clamp(33px, 4vw, 52px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.primary-button, .secondary-button, .text-button {
  min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer; white-space: nowrap;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px; font-weight: 550; line-height: 1;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.primary-button {
  color: var(--accent-foreground); border-color: rgba(134,83,38,.12);
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(79,50,27,.08);
}
.primary-button:hover { background: var(--accent-hover); box-shadow: 0 2px 5px rgba(79,50,27,.11); }
.primary-button:active { background: #c28848; box-shadow: inset 0 1px 2px rgba(79,50,27,.14); }
.secondary-button { color: #34332d; border-color: #ddd8cc; background: rgba(255,255,255,.86); box-shadow: 0 1px 2px rgba(49,44,34,.05); }
.secondary-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.secondary-button:hover { color: var(--ink); border-color: #c9c2b4; background: var(--accent-soft); box-shadow: 0 2px 5px rgba(49,44,34,.07); }
.secondary-button:active { background: #f8e7d5; box-shadow: inset 0 1px 2px rgba(49,44,34,.06); }
.text-button { min-height: 36px; padding-inline: 10px; color: var(--accent-dark); background: transparent; }
.text-button:hover { background: var(--accent-soft); }
.primary-button:disabled, .secondary-button:disabled, .text-button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; transform: none; }
.new-note-button {
  color: #34332d; border-color: #ddd8cc; background: var(--paper-deep); box-shadow: 0 1px 2px rgba(49,44,34,.05);
}
.new-note-button:hover { color: var(--ink); border-color: #c9c2b4; background: #ebe6da; box-shadow: 0 2px 5px rgba(49,44,34,.07); }
.new-note-button:active { background: #e3ddcf; box-shadow: inset 0 1px 2px rgba(49,44,34,.07); }

.today-hero {
  position: relative; overflow: hidden; min-height: 215px; margin-bottom: 28px; padding: clamp(25px, 4vw, 42px);
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  color: #fff; border-radius: var(--radius-lg); background: #35483b;
  box-shadow: 0 20px 55px rgba(44,63,50,.17);
}
.today-hero::before, .today-hero::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.today-hero::before { width: 340px; height: 340px; right: -130px; top: -180px; }
.today-hero::after { width: 190px; height: 190px; right: -52px; bottom: -115px; }
.today-hero h2 { max-width: 650px; margin-bottom: 13px; font-family: Georgia, serif; font-size: clamp(28px, 3.4vw, 44px); font-weight: 400; line-height: 1.05; letter-spacing: -.025em; }
.today-hero p { max-width: 580px; margin-bottom: 0; color: rgba(255,255,255,.72); line-height: 1.6; font-size: 13px; }
.date-medallion { position: relative; z-index: 1; width: 105px; height: 118px; display: grid; align-content: center; justify-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 50px 50px 17px 17px; background: rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.date-medallion span { color: rgba(255,255,255,.65); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.date-medallion strong { margin-top: 2px; font-family: Georgia, serif; font-size: 50px; font-weight: 400; line-height: 1; }

.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.section-heading span { color: var(--muted); font-size: 11px; }

.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.note-card {
  min-height: 170px; padding: 19px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(255,255,255,.8); cursor: pointer; transition: transform .16s, border-color .16s, box-shadow .16s;
}
.note-card:hover { transform: translateY(-2px); border-color: #d6cdbf; box-shadow: 0 13px 28px rgba(59,52,38,.08); }
.note-card-top { min-height: 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.context-date { color: var(--accent-dark); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.note-card-controls { min-width: 28px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.pin { width: 16px; height: 16px; color: var(--yellow); }
.pin svg { width: 100%; height: 100%; fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.note-menu-trigger { width: 28px; height: 28px; margin: -5px -7px -5px 0; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--faint); background: transparent; cursor: pointer; }
.note-menu-trigger:hover, .note-menu-trigger[aria-expanded="true"] { color: var(--ink); background: var(--paper-deep); }
.note-menu-trigger svg { width: 17px; height: 17px; fill: currentColor; }
.note-action-menu { position: fixed; z-index: 80; inset: auto; width: 154px; max-width: calc(100vw - 16px); height: auto; max-height: calc(100dvh - 16px); margin: 0; padding: 5px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 14px 34px rgba(40,35,27,.18); }
/* A content-sized block avoids Safari's fixed grid popover height expansion. */
.note-action-menu:popover-open { display: block; }
.note-action-menu button + button { margin-top: 2px; }
.note-action-menu button { width: 100%; min-height: 36px; padding: 0 10px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; font: 450 11px/1 Inter, ui-sans-serif, sans-serif; text-align: left; }
.note-action-menu button:hover { background: var(--paper-deep); }
.note-action-menu button.is-danger { color: #ad382f; }
.note-action-menu button.is-danger:hover { background: #fff1ef; }
.note-action-menu svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.note-card h3 { margin: 15px 0 8px; font-family: Georgia, serif; font-size: 19px; font-weight: 500; line-height: 1.2; }
.note-excerpt { display: -webkit-box; overflow: hidden; margin-bottom: 18px; color: var(--muted); font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.note-card-footer { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-pill { min-height: 27px; padding: 5px 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 30px; color: var(--tag-ink, var(--accent-dark)); background: var(--tag-bg, var(--accent-soft)); font-size: 11px; font-weight: 400; line-height: 1; }
.updated-time { white-space: nowrap; color: var(--faint); font-size: 9px; }

.empty-state { padding: 58px 25px; display: grid; justify-items: center; text-align: center; border: 1px dashed #d8d2c5; border-radius: var(--radius-lg); background: rgba(255,255,255,.45); }
.empty-state-mark { width: 50px; height: 50px; margin-bottom: 16px; display: grid; place-items: center; border-radius: 16px 16px 16px 4px; color: var(--accent-dark); background: var(--accent-soft); font-size: 24px; }
.empty-state h3 { margin-bottom: 7px; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.empty-state p { max-width: 380px; margin-bottom: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.search-filter-panel { position: relative; margin-bottom: 22px; overflow: visible; border: 0; border-radius: 18px; background: var(--paper-deep); box-shadow: 0 12px 30px rgba(54,48,37,.06); }
.filter-main-row { padding: 12px 13px; display: grid; grid-template-columns: minmax(250px, 1fr) auto auto auto; align-items: center; gap: 9px; }
.search-box { min-width: 0; height: 44px; position: relative; display: flex; align-items: center; border: 0; border-radius: 11px; background: rgba(255,255,255,.92); box-shadow: 0 4px 12px rgba(49,44,34,.055); transition: background-color .16s ease, box-shadow .16s ease; }
.search-box:focus-within { background: var(--white); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.26), 0 7px 18px rgba(49,44,34,.07); }
.search-box > svg { width: 17px; height: 17px; margin-left: 13px; flex: 0 0 17px; fill: none; stroke: #8e897e; stroke-width: 1.75; stroke-linecap: round; }
.search-box input { min-width: 0; width: 100%; height: 100%; padding: 0 37px 0 10px; border: 0; outline: 0; border-radius: inherit; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.clear-search { position: absolute; right: 8px; top: 8px; width: 27px; height: 27px; border: 0; border-radius: 50%; color: var(--muted); background: var(--paper-deep); cursor: pointer; }
.filter-dropdown { position: relative; }
.filter-trigger { min-width: 112px; height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 11px; color: #4c4a43; background: rgba(255,255,255,.88); cursor: pointer; font-size: 11px; font-weight: 550; box-shadow: 0 4px 12px rgba(49,44,34,.05); transition: box-shadow .16s ease, background-color .16s ease, transform .16s ease; }
.filter-trigger:hover, .filter-trigger[aria-expanded="true"] { background: var(--white); box-shadow: 0 7px 18px rgba(49,44,34,.08); transform: translateY(-1px); }
.filter-trigger.is-active { color: var(--accent-dark); background: #f8e8d5; }
.filter-trigger > svg:not(.filter-chevron) { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.filter-trigger small { min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 9px; color: var(--accent-foreground); background: var(--accent); font-size: 8px; }
.filter-chevron { width: 11px; height: 11px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.filter-trigger[aria-expanded="true"] .filter-chevron { transform: rotate(180deg); }
.filter-reset { height: 44px; padding: 0 10px; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 500; }
.filter-reset svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.filter-reset:hover:not(:disabled) { color: var(--accent-dark); background: var(--accent-soft); }
.filter-reset:disabled { cursor: default; opacity: .38; }
.filter-menu { position: absolute; z-index: 35; top: calc(100% + 7px); right: 0; min-width: 250px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); box-shadow: 0 16px 38px rgba(43,38,29,.15); }
.filter-menu[hidden] { display: none; }
.filter-menu-heading { padding: 3px 4px 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-menu-heading strong { font-size: 11px; font-weight: 600; }
.filter-menu-heading span { color: var(--faint); font-size: 8px; }
.tag-filter-options { max-height: 230px; overflow-y: auto; display: grid; gap: 2px; }
.tag-filter-options > p { margin: 8px; color: var(--faint); font-size: 10px; line-height: 1.45; }
.tag-filter-option { width: 100%; padding: 9px 8px; display: grid; grid-template-columns: 9px 1fr 15px; align-items: center; gap: 8px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 10px; }
.tag-filter-option:hover { color: var(--ink); background: var(--paper-deep); }
.tag-filter-option i { width: 8px; height: 8px; border-radius: 50%; background: var(--tag-color); }
.tag-filter-option b { visibility: hidden; color: var(--accent-dark); font-size: 10px; }
.tag-filter-option.is-selected { color: var(--ink); background: var(--accent-soft); }
.tag-filter-option.is-selected b { visibility: visible; }
.tag-match-control { margin-top: 8px; padding: 9px 7px 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.tag-match-control select { height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--white); font-size: 9px; }
.date-filter-menu { width: 350px; }
.range-calendar-status { min-height: 29px; margin-bottom: 7px; padding: 7px 9px; border-radius: 8px; color: var(--accent-dark); background: var(--accent-soft); text-align: center; font-size: 9px; font-weight: 550; }
.range-calendar-head { height: 36px; padding: 0 5px 0 9px; display: flex; align-items: center; justify-content: space-between; }
.range-calendar-head strong { font-size: 12px; font-weight: 600; }
.range-calendar-head > div { display: flex; gap: 2px; }
.range-calendar-head button { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 20px; line-height: 1; }
.range-calendar-head button:hover { color: var(--ink); background: var(--paper-deep); }
.range-calendar-weekdays, .range-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.range-calendar-weekdays { padding: 3px 0 5px; }
.range-calendar-weekdays span { color: var(--faint); text-align: center; font-size: 8px; font-weight: 600; text-transform: uppercase; }
.range-calendar-grid { overflow: hidden; border: 1px solid #ebe6dc; border-radius: 10px; background: #fff; }
.range-calendar-day { position: relative; height: 36px; padding: 0; border: 0; border-radius: 0; color: var(--ink); background: transparent; cursor: pointer; font-size: 10px; font-variant-numeric: tabular-nums; }
.range-calendar-day:hover { z-index: 1; color: var(--accent-dark); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.range-calendar-day.is-outside { color: #c1bdb3; }
.range-calendar-day.is-in-range { color: #3f3d37; background: #eeeae3; }
.range-calendar-day.is-start, .range-calendar-day.is-end { z-index: 2; color: #fff; border-radius: 7px; background: var(--ink); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.range-calendar-day.is-start:not(.is-end) { border-radius: 7px 0 0 7px; }
.range-calendar-day.is-end:not(.is-start) { border-radius: 0 7px 7px 0; }
.range-calendar-day.is-today:not(.is-start):not(.is-end) { color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent); }
.filter-menu-actions { padding-top: 9px; display: flex; justify-content: flex-end; gap: 6px; }
.filter-menu-actions .primary-button, .filter-menu-actions .text-button { min-height: 34px; font-size: 10px; }
.active-filters { padding: 0 15px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; border-top: 0; }
.filter-chip { min-height: 29px; padding: 0 10px; border: 1px solid #e3ded4; border-radius: 9px; color: #4e4b43; background: var(--paper-deep); cursor: pointer; font-size: 9px; font-weight: 550; }
.filter-chip::after { content: " ×"; margin-left: 4px; color: var(--faint); }
.filter-chip:hover { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.filter-chip-divider { width: 1px; height: 17px; margin: 0 3px; background: var(--line); }
.clear-all-filters { min-height: 29px; padding: 0 7px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; }
.clear-all-filters:hover { color: var(--accent-dark); background: var(--accent-soft); }
.results-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 0; color: var(--muted); font-size: 11px; }
.segmented { padding: 3px; display: flex; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-deep); }
.segmented button { min-height: 28px; padding: 6px 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 500; }
.segmented button.is-active { color: var(--ink); background: var(--white); box-shadow: 0 2px 7px rgba(0,0,0,.06); }

.calendar-layout { display: grid; grid-template-columns: 1fr; gap: 0; align-items: start; overflow: hidden; border-radius: 24px; background: var(--paper-deep); box-shadow: 0 18px 45px rgba(62,53,39,.09); }
.calendar-panel, .day-panel { min-width: 0; border: 0; border-radius: 0; }
.calendar-panel { width: 100%; padding: 24px; overflow: hidden; background: transparent; box-shadow: none; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.calendar-head h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; font-size: 24px; }
.calendar-controls { padding: 3px; display: flex; gap: 2px; border-radius: 11px; background: rgba(255,255,255,.55); }
.calendar-controls button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.calendar-controls button:hover { color: var(--accent-dark); background: var(--white); box-shadow: 0 4px 12px rgba(49,44,34,.07); }
.weekdays, .calendar-grid { width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekdays div { min-width: 0; overflow: hidden; padding: 7px 2px 10px; color: #9b968c; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.calendar-grid { --calendar-corner-radius: 15px; overflow: hidden; border-radius: var(--calendar-corner-radius); background: var(--paper); box-shadow: inset 0 0 0 1px rgba(91,80,61,.055); }
.calendar-day {
  position: relative; min-width: 0; min-height: 87px; padding: 0; border: 0; border-right: 1px solid rgba(91,80,61,.075); border-top: 1px solid rgba(91,80,61,.075);
  background: transparent; cursor: pointer; text-align: left;
}
.calendar-day:nth-child(7n) { border-right: 0; }
/* Match the grid corners so inset selection/focus rings follow the clipped curve. */
.calendar-day:first-child { border-top-left-radius: var(--calendar-corner-radius); }
.calendar-day:nth-child(7) { border-top-right-radius: var(--calendar-corner-radius); }
.calendar-day:nth-last-child(7) { border-bottom-left-radius: var(--calendar-corner-radius); }
.calendar-day:last-child { border-bottom-right-radius: var(--calendar-corner-radius); }
.calendar-day:hover { z-index: 1; background: rgba(255,255,255,.68); box-shadow: 0 7px 18px rgba(61,52,38,.06); }
.calendar-day.is-outside { color: #c5c1b7; }
.calendar-day.is-today .day-number { color: var(--accent-foreground); background: var(--accent); }
.calendar-day.is-selected { background: #f7e6d1; box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb),.8); }
.day-number { position: absolute; top: 10px; left: 12px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 600; }
.day-dots { position: absolute; left: 10px; right: 10px; bottom: 9px; display: flex; align-items: center; gap: 3px; }
.day-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--sage)); }
.day-dots small { margin-left: auto; color: var(--muted); font-size: 8px; }
.day-panel { position: static; padding: 19px 24px 23px; border: 0; outline: 0; background: transparent; box-shadow: none; }
.day-panel-date { color: var(--accent-dark); font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.day-panel h2 { margin: 7px 0 18px; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.day-note-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.mini-note { width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; border-radius: 11px; color: var(--ink); background: #f5f3ee; background: color-mix(in srgb, var(--mini-accent) 9%, white); box-shadow: none; cursor: pointer; text-align: left; transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
.mini-note:hover { background: #fff; background: color-mix(in srgb, var(--mini-accent) 14%, white); box-shadow: 0 8px 20px rgba(43,67,57,.08); transform: translateY(-1px); }
.mini-note-dot { width: 6px; height: 6px; display: block; border-radius: 50%; background: var(--mini-accent); }
.mini-note strong { min-width: 0; overflow: hidden; color: var(--ink); font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.mini-note time { color: var(--mini-accent); font-size: 9px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-panel-empty { margin: 0; padding: 18px; border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.55); font-size: 11px; line-height: 1.5; text-align: center; }
.day-panel .primary-button { width: 100%; margin-top: 14px; border-color: transparent; box-shadow: 0 8px 18px rgba(118,80,32,.14); }

.library-tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; }
.library-tab { padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--white); cursor: pointer; white-space: nowrap; font-size: 11px; font-weight: 600; }
.library-tab.is-active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.library-results { min-width: 0; }
.library-context { min-height: 37px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.library-context h2 { margin: 0; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.library-context p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.delete-all-button { min-height: 36px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 1px solid #edc2bd; border-radius: 8px; color: #ad382f; background: #fff9f8; cursor: pointer; font: 550 11px/1 Inter, ui-sans-serif, sans-serif; }
.delete-all-button:hover { border-color: #dfa49d; background: #fff1ef; }
.delete-all-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mobile-folder-trigger { display: none; }

.search-calendar-results { margin-top: 10px; }
.search-calendar-results .calendar-layout { grid-template-columns: 1fr; }
.search-calendar-results .day-panel { display: none; }

.editor-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(30,29,25,.25); backdrop-filter: blur(2px); }
.note-editor {
  position: fixed; z-index: 40; top: 0; right: 0; width: calc(100vw - 258px); height: 100vh; overflow-y: auto;
  padding: 22px clamp(20px, 3vw, 38px) 32px; background: var(--paper); box-shadow: -20px 0 55px rgba(36,31,22,.16);
  transform: translateX(105%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.note-editor.is-open { transform: translateX(0); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 27px; }
.editor-status { color: var(--faint); font-size: 10px; }
.editor-status.is-recording { color: #b8443b; font-weight: 700; font-variant-numeric: tabular-nums; }
.recording-hint { padding: .75rem; border-radius: .6rem; color: #823b32; background: #fff0e9; font-size: .875rem; line-height: 1.5; }
.recording-notice { position: fixed; z-index: 110; right: 1rem; bottom: calc(5.5rem + env(safe-area-inset-bottom)); width: min(28rem, calc(100% - 2rem)); max-height: 40dvh; overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--paper); box-shadow: var(--shadow); font-size: .875rem; }
.recording-notice p { margin: 0 0 .5rem; }
.recording-notice button, .recording-notice a { display: inline-flex; align-items: center; min-height: 2.75rem; margin: .25rem .5rem 0 0; padding: .5rem; border: 1px solid var(--line); border-radius: .5rem; color: var(--accent-dark); background: var(--white); cursor: pointer; }
.editor-actions { display: flex; align-items: center; gap: 7px; }
.editor-action { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--white); cursor: pointer; }
.editor-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.editor-action.is-active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.editor-action.is-active svg { fill: currentColor; }
.editor-action:hover { color: var(--ink); border-color: #cbc5ba; }
.editor-action.danger:hover { color: #ad382f; border-color: #edc2bd; background: #fff4f2; }
.editor-action.record-audio-action.is-recording { color: #b8443b; border-color: #e7aaa3; background: #fff1ef; animation: recording-pulse 1.35s ease-in-out infinite; }
.editor-action.record-audio-action.is-recording svg { fill: currentColor; }
.note-action-bar { width: max-content; max-width: 100%; gap: 3px; padding: 4px; border: 1px solid rgba(73,67,56,.12); border-radius: 15px; background: rgba(255,255,253,.96); box-shadow: 0 8px 24px rgba(43,39,32,.09), 0 1px 2px rgba(43,39,32,.04); backdrop-filter: blur(14px); }
.note-action-bar .editor-action { width: 35px; height: 35px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--action-color, #6d6960); background: transparent; transition: background .16s ease, transform .16s ease; }
.note-action-bar .editor-action-icon { width: 19px; height: 19px; overflow: visible; fill: none; stroke: none; shape-rendering: geometricPrecision; }
.note-action-bar .editor-action-icon .icon-fill { fill: currentColor; stroke: none; }
.note-action-bar .editor-action-icon .icon-stroke { fill: none; stroke: currentColor; stroke-width: 2.05; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.note-action-bar .editor-action:hover { color: var(--action-color, #6d6960); border: 0; background: rgba(var(--accent-rgb),.22); }
.note-action-bar .editor-action:active { transform: scale(.93); }
.note-action-bar .editor-action:focus-visible { outline: 2px solid rgba(var(--accent-rgb),.72); outline-offset: 1px; }
.note-action-bar .editor-action.is-active { border: 0; background: transparent; }
.note-action-bar .editor-action.attachment-action { --action-color: #28748b; }
.note-action-bar .editor-action.record-audio-action { --action-color: #66579a; }
.note-action-bar .editor-action.pin-action { --action-color: #a86b24; }
.note-action-bar .editor-action.pin-action.is-active { --action-color: var(--accent-dark); }
.note-action-bar .editor-action.edit-action { --action-color: #4e8068; }
.note-action-bar .editor-action.share-action { --action-color: #28748b; }
.note-action-bar .editor-action.delete-action { --action-color: #bd4f49; }
.note-action-bar .editor-action.close-action { --action-color: #536170; }
.note-action-bar .editor-action.danger:hover,
.note-action-bar .editor-action.close-action:hover { color: var(--action-color); border: 0; background: rgba(var(--accent-rgb),.22); }
.note-action-bar .editor-action.record-audio-action.is-recording { --action-color: #b8443b; color: var(--action-color); border: 0; background: transparent; }
@keyframes recording-pulse { 50% { box-shadow: 0 0 0 4px rgba(184,68,59,.12); } }
.editor-title-row { width: max-content; max-width: 100%; display: flex; align-items: flex-start; gap: 14px; }
.editor-title { min-width: 0; min-height: 40px; height: 40px; flex: 0 0 auto; overflow: hidden; padding: 0; border: 0; border-radius: 9px; color: var(--ink); background: transparent; font-family: Georgia, serif; font-size: 34px; line-height: 1.15; resize: none; }
.editor-title::placeholder { color: #c4c0b6; }
.editor-title:focus-visible { outline: 1px solid rgba(78,70,55,.14); outline-offset: 4px; background: rgba(255,255,255,.12); }
.title-color-picker { position: relative; width: 32px; flex: 0 0 32px; margin: 3px 0 0; }
.title-color-trigger { position: relative; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(78,70,55,.14); border-radius: 8px; color: #6e6a60; background: rgba(255,255,253,.94); box-shadow: 0 3px 10px rgba(48,43,34,.06); cursor: pointer; transition: color .16s ease, background .16s ease, transform .16s ease; }
.title-color-trigger:hover, .title-color-trigger[aria-expanded="true"] { color: var(--ink); background: rgba(var(--accent-rgb),.2); }
.title-color-trigger:active { transform: scale(.94); }
.title-color-trigger:focus-visible { outline: 2px solid rgba(var(--accent-rgb),.72); outline-offset: 2px; }
.title-color-trigger .format-icon { position: relative; z-index: 1; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.title-color-trigger::after { content: ""; position: absolute; right: 8px; bottom: 4px; left: 8px; height: 2px; border-radius: 3px; background: var(--selected-title-color); }
.format-color-popover .title-color-option.is-active { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--format-swatch); }
.editor-meta { width: 100%; margin: 20px 0 10px; padding: 10px 0 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.meta-control { min-height: 34px; padding: 6px 9px; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; color: var(--muted); background: var(--paper-deep); font-size: 10px; }
.meta-control input { max-width: 120px; border: 0; color: var(--ink); background: transparent; font-size: 10px; }
.tag-input-wrap { position: relative; width: 180px; min-width: 120px; flex: 0 1 180px; }
.tag-input-wrap input { width: 100%; min-height: 34px; padding: 6px 9px; border: 0; border-radius: 8px; background: var(--paper-deep); font-size: 10px; }
.tag-suggestions { position: absolute; z-index: 2; top: 39px; left: 0; right: 0; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); box-shadow: var(--shadow); }
.tag-suggestions button { width: 100%; padding: 7px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; font-size: 11px; }
.tag-suggestions button:hover { background: var(--paper-deep); }
.editor-tags { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 5px; }
.editor-tag { border: 0; cursor: pointer; }
.editor-tag::after { content: " ×"; opacity: .65; }
.editor-body { width: 100%; min-height: calc(100vh - 280px); padding: 0 0 80px; border: 0; color: #3d3c35; background: transparent; font-family: Georgia, serif; font-size: 16px; line-height: 1.75; resize: none; }
.editor-body::placeholder { color: #bbb7ad; }
.rich-editor { outline: 0; white-space: normal; overflow-wrap: anywhere; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #bbb7ad; pointer-events: none; }
.rich-editor ul, .rich-editor ol, .rich-note-content ul, .rich-note-content ol { margin: .6em 0; padding-left: 1.6em; }
.rich-editor li, .rich-note-content li { margin: .2em 0; padding-left: .15em; }
.rich-editor ul.dashed-list, .rich-note-content ul.dashed-list { padding-left: 1.25em; list-style: none; }
.rich-editor ul.dashed-list > li, .rich-note-content ul.dashed-list > li { position: relative; }
.rich-editor ul.dashed-list > li::before, .rich-note-content ul.dashed-list > li::before { content: "—"; position: absolute; right: calc(100% + .45em); color: currentColor; }
.rich-editor .list-exit-line, .rich-note-content .list-exit-line { padding-left: 1.6em; }
.rich-editor > p, .rich-editor > div, .rich-note-content > p, .rich-note-content > div { margin: 0; }
.rich-editor h2, .rich-note-content h2 { margin: .9em 0 .45em; color: var(--ink); font-family: Georgia, serif; font-size: 1.45em; font-weight: 600; line-height: 1.25; }
.rich-editor blockquote, .rich-note-content blockquote { margin: .8em 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.rich-editor a, .rich-note-content a { color: var(--accent-dark); text-decoration: underline; text-decoration-color: rgba(134,83,38,.42); text-underline-offset: 3px; }
.format-toolbar-shell { position: sticky; z-index: 12; top: 12px; width: max-content; max-width: 100%; margin: 0 0 18px; padding: 4px; display: grid; justify-items: start; gap: 8px; border-radius: 14px; background: var(--paper); isolation: isolate; }
.format-toolbar-toggle { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(78,70,55,.12); border-radius: 9px; color: #666259; background: var(--white); box-shadow: 0 3px 10px rgba(48,43,34,.07); cursor: pointer; font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; font-weight: 500; }
.format-toolbar-toggle:hover, .format-toolbar-toggle[aria-expanded="true"] { color: var(--ink); background: rgba(var(--accent-rgb),.18); }
.format-toolbar-toggle > span { color: var(--accent-dark); font-family: Georgia, serif; font-size: 14px; line-height: 1; }
.format-toolbar-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.format-toolbar-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.format-toolbar { width: max-content; max-width: 100%; margin: 0; padding: 6px; display: flex; align-items: center; gap: 3px; overflow-x: auto; border: 1px solid rgba(78,70,55,.14); border-radius: 13px; background: var(--white); box-shadow: 0 7px 22px rgba(48,43,34,.09), 0 1px 2px rgba(48,43,34,.05); scrollbar-width: none; }
.format-toolbar::-webkit-scrollbar { display: none; }
.format-toolbar button { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #6e6a60; background: transparent; cursor: pointer; font-family: Inter, ui-sans-serif, sans-serif; font-size: 13px; transition: color .16s ease, background .16s ease, transform .16s ease; }
.format-toolbar button:hover { color: var(--ink); background: rgba(var(--accent-rgb),.2); }
.format-toolbar .toolbar-button:active { transform: scale(.94); }
.format-toolbar .toolbar-button.is-active, .format-toolbar .toolbar-button[aria-expanded="true"] { color: var(--accent-dark); background: rgba(var(--accent-rgb),.28); }
.format-toolbar button:disabled { color: #c9c5bb; background: transparent; cursor: default; }
.format-toolbar .format-icon, .format-toolbar .undo-format-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.format-font-menu { flex: 0 0 116px; }
.format-toolbar .font-menu-trigger { width: 116px; height: 32px; padding: 0 8px 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid rgba(78,70,55,.1); border-radius: 8px; color: #625f56; background: var(--paper-deep); font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; font-weight: 500; }
.format-toolbar .font-menu-trigger:hover, .format-toolbar .font-menu-trigger[aria-expanded="true"] { color: var(--ink); border-color: rgba(78,70,55,.18); background: #f1eee5; }
.font-menu-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-menu-trigger svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.font-menu-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.font-format-popover { position: fixed; inset: unset; width: 218px; max-height: min(360px, calc(100vh - 24px)); margin: 0; padding: 6px; overflow-y: auto; border: 1px solid rgba(78,70,55,.14); border-radius: 12px; color: var(--ink); background: var(--white); box-shadow: 0 14px 34px rgba(45,40,30,.16), 0 2px 5px rgba(45,40,30,.06); }
.font-format-popover:popover-open { display: block; animation: font-menu-in .16s ease both; }
.font-menu-group-label { padding: 7px 9px 4px; display: block; color: var(--faint); font-family: Inter, ui-sans-serif, sans-serif; font-size: 8px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.font-menu-group { display: grid; gap: 1px; }
.format-toolbar .font-menu-option { width: 100%; height: 36px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 7px; color: var(--ink); font-family: var(--font-preview); font-size: 12px; text-align: left; }
.format-toolbar .font-menu-option:hover, .format-toolbar .font-menu-option:focus-visible { color: var(--ink); background: rgba(var(--accent-rgb),.2); outline: 0; }
.font-menu-option i { visibility: hidden; color: var(--accent-dark); font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; font-style: normal; }
.font-menu-option[aria-checked="true"] { color: var(--accent-dark); background: rgba(var(--accent-rgb),.24); }
.font-menu-option[aria-checked="true"] i { visibility: visible; }
.font-menu-separator { height: 1px; margin: 5px -6px 2px; display: block; background: var(--line); }
@keyframes font-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.format-divider { width: 1px; height: 20px; flex: 0 0 1px; margin: 0 4px; background: rgba(78,70,55,.14); }
.format-color-menu { flex: 0 0 32px; }
.format-toolbar .color-menu-trigger { position: relative; }
.text-color-trigger::after { content: ""; position: absolute; right: 8px; bottom: 4px; left: 8px; height: 2px; border-radius: 3px; background: #224248; }
.highlight-color-trigger::after { content: ""; position: absolute; inset: 8px 7px; border-radius: 4px; background: #eef8cd; }
.format-toolbar .color-menu-trigger .format-icon { position: relative; z-index: 1; }
.format-tooltip { position: fixed; z-index: 100; padding: 5px 8px; border-radius: 6px; color: #fff; background: #2e2d29; box-shadow: 0 5px 14px rgba(25,23,20,.18); font-family: Inter, ui-sans-serif, sans-serif; font-size: 9px; font-weight: 500; line-height: 1; white-space: nowrap; pointer-events: none; transform: translateX(-50%); animation: toolbar-tooltip-in .16s ease both; }
.format-tooltip[hidden] { display: none; }
@keyframes toolbar-tooltip-in { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
.format-color-popover { position: fixed; inset: unset; width: max-content; max-width: calc(100vw - 16px); margin: 0; padding: 9px; grid-template-columns: repeat(var(--palette-columns, 8), 26px); gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 12px 30px rgba(45,40,30,.18); }
.format-color-popover:popover-open { display: grid; }
.format-color-popover .format-color-swatch { width: 26px; height: 26px; padding: 0; border: 3px solid var(--white); border-radius: 50%; background: var(--format-swatch); box-shadow: 0 0 0 1px rgba(72,67,57,.22); cursor: pointer; }
.format-color-popover .format-color-swatch:hover { background: var(--format-swatch); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--format-swatch); transform: scale(1.08); }
.format-list-menu { flex: 0 0 32px; }
.format-toolbar .list-menu-trigger[aria-expanded="true"] { color: var(--ink); background: var(--paper-deep); }
.format-list-popover { position: fixed; inset: unset; width: 178px; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 12px 30px rgba(45,40,30,.18); }
.format-list-popover:popover-open { display: grid; gap: 2px; }
.format-toolbar .format-list-popover .list-format-option { width: 100%; height: 34px; padding: 0 10px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; border-radius: 7px; font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; text-align: left; }
.format-list-popover .list-format-option span { width: 26px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; text-align: center; }
.list-menu-section-label { margin: 4px 4px 1px; padding: 6px 6px 3px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.list-format-icon { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 700; line-height: .62; text-align: left; }
.word-count { position: fixed; right: 25px; bottom: 18px; color: var(--faint); font-size: 9px; }
.viewer-title { margin: 5px 0 17px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; line-height: 1.13; letter-spacing: -.025em; }
.viewer-meta { margin-bottom: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.viewer-body { min-height: 180px; color: #3d3c35; font-family: Georgia, serif; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.viewer-empty { color: var(--faint); font-style: italic; }
.viewer-action-bar { flex: 0 0 auto; }
.folder-select-control { max-width: 155px; }
.folder-select-control select { max-width: 120px; border: 0; color: var(--ink); background: transparent; font-size: 10px; }
.meta-control .folder-icon { width: 14px; height: 14px; flex-basis: 14px; color: var(--yellow); }
.attachments-section { margin: 0 0 16px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.55); }
.attachments-section[hidden] { display: none; }
.attachments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.attachments-head h3 { margin: 0; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.attachment-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.attachment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.attachment-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--white); cursor: pointer; }
.attachment-card.audio-attachment-card { min-height: 62px; display: flex; align-items: center; grid-column: 1 / -1; }
.attachment-card.is-selected, .attachment-card:focus-visible, .inline-attachment.is-selected, .inline-attachment:focus-visible { border-color: var(--accent); outline: 2px solid rgba(var(--accent-rgb),.3); outline-offset: 1px; }
.attachment-preview { min-height: 105px; display: grid; place-items: center; background: var(--paper-deep); }
.attachment-preview img, .attachment-preview video { width: 100%; height: 140px; display: block; object-fit: cover; }
.attachment-preview.is-audio { width: 100%; min-height: 0; padding: 8px 10px 2px; background: transparent; }
.attachment-preview.is-pdf, .inline-attachment-preview.is-pdf { min-height: 105px; padding: 12px; background: #f7f5f0; }
.pdf-preview-button { width: 100%; min-height: 78px; display: grid; place-items: center; align-content: center; gap: 7px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font: 550 10px/1 Inter, ui-sans-serif, sans-serif; }
.pdf-preview-button:hover { color: var(--accent-dark); background: var(--white); }
.pdf-preview-button > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px 11px 11px 4px; color: #fff; background: #d75d4b; box-shadow: 0 5px 12px rgba(177,62,46,.16); }
.pdf-preview-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.file-symbol { color: var(--blue); font-size: 34px; }
.attachment-info { padding: 9px 38px 9px 10px; }
.attachment-info strong { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.attachment-card.is-selected .attachment-info strong { display: block; }
.attachment-info span { display: block; margin-top: 3px; color: var(--faint); font-size: 8px; }
.attachment-download, .attachment-remove { position: absolute; z-index: 1; right: 7px; width: 25px; height: 25px; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.9); cursor: pointer; text-decoration: none; font-size: 11px; }
.attachment-download { bottom: 7px; }
.attachment-remove { top: 7px; color: #a64338; }
.upload-progress { padding: 14px; color: var(--muted); text-align: center; font-size: 10px; }
.inline-attachment { width: min(100%, 470px); margin: 16px 0 !important; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 7px 18px rgba(45,40,30,.06); font-family: Inter, ui-sans-serif, sans-serif; }
.inline-attachment-preview { grid-column: 1 / -1; min-width: 0; display: grid; place-items: center; border-radius: 8px; background: var(--paper-deep); }
.inline-attachment-preview img, .inline-attachment-preview video { width: 100%; max-height: 330px; display: block; border-radius: 8px; object-fit: contain; }
.inline-attachment-preview.is-audio { width: 100%; min-height: 60px; align-content: center; background: transparent; }
.swadhyay-audio { width: 100%; min-width: 0; height: 52px; padding: 7px 2px; display: grid; grid-template-columns: 34px 68px minmax(40px, 1fr) 32px 32px; align-items: center; gap: 8px; color: var(--ink); background: transparent; font-family: Inter, ui-sans-serif, sans-serif; }
.swadhyay-audio.has-remove { grid-template-columns: 34px 68px minmax(40px, 1fr) 32px 32px 32px; }
.swadhyay-audio audio { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.audio-play-button, .audio-volume-button, .audio-download-button, .audio-remove-button { padding: 0; display: grid; place-items: center; border: 0; color: var(--ink); background: transparent; cursor: pointer; text-decoration: none; }
.audio-play-button { width: 34px; height: 34px; border-radius: 50%; color: var(--accent-foreground); background: var(--accent); box-shadow: 0 1px 3px rgba(79,50,27,.12); }
.audio-play-button:hover { background: var(--accent-hover); }
.audio-volume-button { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.audio-download-button, .audio-remove-button { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.audio-remove-button { color: #ad4b41; }
.audio-volume-button:hover, .audio-download-button:hover { color: var(--ink); background: #ece8df; }
.audio-remove-button:hover { background: #fff1ef; }
.audio-play-button svg, .audio-volume-button svg, .audio-download-button svg, .audio-remove-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.audio-play-button .audio-play-shape { fill: currentColor; stroke: none; }
.audio-time { display: flex; align-items: baseline; justify-content: center; gap: 3px; white-space: nowrap; color: var(--faint); font-size: 9px; font-variant-numeric: tabular-nums; }
.audio-time b { color: var(--ink); font-weight: 600; }
.audio-time i { font-style: normal; opacity: .55; }
.audio-progress { --audio-progress: 0%; width: 100%; min-width: 0; height: 18px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: transparent; cursor: pointer; }
.audio-progress::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(to right, var(--accent) 0 var(--audio-progress), #d7d2c8 var(--audio-progress) 100%); }
.audio-progress::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; appearance: none; -webkit-appearance: none; border: 2px solid var(--white); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 4px rgba(48,42,32,.25); }
.audio-progress::-moz-range-track { height: 3px; border-radius: 5px; background: #d7d2c8; }
.audio-progress::-moz-range-progress { height: 3px; border-radius: 5px; background: var(--accent); }
.audio-progress::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid var(--white); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 4px rgba(48,42,32,.25); }
.audio-progress:focus-visible { border-radius: 6px; box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.46); }
.inline-file-symbol { padding: 18px; color: var(--blue); font-size: 30px; }
.inline-attachment-meta { min-width: 0; }
.inline-attachment-meta strong, .inline-attachment-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-attachment-meta strong { display: none; }
.inline-attachment.is-selected .inline-attachment-meta strong { display: block; }
.inline-attachment-meta strong { font-size: 11px; }
.inline-attachment-meta span { margin-top: 2px; color: var(--faint); font-size: 8px; }
.inline-attachment > a, .inline-attachment > button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: var(--paper-deep); cursor: pointer; text-decoration: none; font: 12px/1 Inter, sans-serif; }
.inline-attachment > button { color: #a64338; }
.inline-attachment-missing { grid-column: 1 / -1; padding: 10px; color: var(--faint); font-size: 10px; }
.folder-form { margin-top: 18px; display: grid; gap: 13px; }
.folder-form label, .folder-form-field { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.form-label { color: var(--muted); font-size: 10px; font-weight: 700; }
.folder-form input, .folder-form select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--white); }
.parent-picker { position: relative; }
.parent-picker-toggle { width: 100%; min-height: 41px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--white); cursor: pointer; text-align: left; }
.parent-picker-toggle[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.24); }
.parent-picker-current { min-width: 0; display: flex; align-items: center; gap: 8px; }
.parent-picker-current span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.picker-chevron { width: 12px; height: 12px; flex: 0 0 12px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s; }
.parent-picker-toggle[aria-expanded="true"] .picker-chevron { transform: rotate(180deg); }
.parent-picker-panel { margin-top: 6px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 13px 30px rgba(46,41,31,.12); }
.parent-picker-panel[hidden] { display: none; }
.parent-picker-search { margin: 7px; padding: 0 9px; display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: center; gap: 7px !important; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-deep); color: var(--muted) !important; }
.parent-picker-search input { min-width: 0; height: 34px; padding: 0 !important; border: 0 !important; background: transparent !important; outline: 0; font-size: 11px; }
.parent-picker-options { max-height: 230px; overflow-x: hidden; overflow-y: auto; padding: 2px 6px 7px; }
.parent-picker-option { width: 100%; min-width: 0; padding: 8px 8px 8px calc(8px + (var(--picker-depth, 0) * 14px)); display: grid; grid-template-columns: 17px minmax(0, 1fr) 16px; align-items: center; gap: 8px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.parent-picker-option[hidden] { display: none; }
.parent-picker-option:hover { background: var(--paper-deep); }
.parent-picker-option.is-selected { color: var(--accent-dark); background: var(--accent-soft); }
.parent-picker-option > span { min-width: 0; }
.parent-picker-option strong, .parent-picker-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parent-picker-option strong { font-size: 11px; }
.parent-picker-option small { margin-top: 2px; color: var(--faint); font-size: 8px; font-weight: 500; }
.parent-picker-option i { display: none; font-style: normal; font-size: 10px; }
.parent-picker-option.is-selected i { display: block; }
.parent-picker-empty { padding: 18px; color: var(--faint); text-align: center; font-size: 10px; }
.move-note-picker { margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.move-note-search { margin: 7px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--paper-deep); }
.move-note-search input { min-width: 0; width: 100%; height: 35px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.move-note-options { max-height: 275px; overflow-x: hidden; overflow-y: auto; padding: 2px 6px 7px; }
.move-note-option { width: 100%; min-width: 0; padding: 9px 8px 9px calc(8px + (var(--picker-depth, 0) * 14px)); display: grid; grid-template-columns: 17px minmax(0, 1fr) 16px; align-items: center; gap: 8px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.move-note-option[hidden] { display: none; }
.move-note-option:hover { background: var(--paper-deep); }
.move-note-option.is-selected { color: var(--accent-dark); background: var(--accent-soft); }
.move-note-option > span { min-width: 0; }
.move-note-option strong, .move-note-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-note-option strong { font-size: 11px; font-weight: 600; }
.move-note-option small { margin-top: 2px; color: var(--faint); font-size: 8px; font-weight: 500; }
.move-note-option i { display: none; font-style: normal; font-size: 10px; }
.move-note-option.is-selected i { display: block; }
.move-note-option .folder-icon { width: 16px; height: 16px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(30,29,25,.3); backdrop-filter: blur(3px); }
.modal { width: min(500px, 100%); max-height: 82vh; overflow: auto; padding: 25px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.modal h2 { margin-bottom: 8px; font-family: Georgia, serif; font-weight: 500; }
.modal > p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.modal.pdf-modal { width: min(1100px, 100%); height: min(90vh, 920px); max-height: 90vh; overflow: hidden; padding: 0; border-radius: 18px; background: #ece9e2; }
.pdf-reader-loading { min-height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.pdf-reader { height: 100%; display: grid; grid-template-rows: 58px minmax(0, 1fr); }
.pdf-reader header { padding: 9px 11px 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #d8d3c9; background: var(--paper); }
.pdf-reader header > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.pdf-reader header svg { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: #c85140; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pdf-reader header span { min-width: 0; }
.pdf-reader header small, .pdf-reader header strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-reader header small { margin-bottom: 2px; color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pdf-reader header strong { max-width: min(70vw, 780px); color: var(--ink); font-size: 11px; font-weight: 600; }
.pdf-reader header button { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--white); box-shadow: 0 1px 2px rgba(49,44,34,.05); cursor: pointer; font-size: 19px; }
.pdf-reader header button:hover { color: var(--ink); border-color: #c9c2b4; background: var(--accent-soft); }
.pdf-pages { min-height: 0; overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 20px; background: #e5e2dc; }
.pdf-page-shell { width: max-content; max-width: 100%; flex: 0 0 auto; overflow: hidden; background: #fff; box-shadow: 0 2px 12px rgba(39,35,28,.13); line-height: 0; }
.pdf-page-shell canvas { width: auto; height: auto; max-width: 100%; display: block; background: #fff; }
.tag-manager-row { padding: 9px 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.tag-manager-row input { padding: 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; }
.tag-manager-row input:focus { border-color: var(--line); background: #fff; }
.tag-manager-row button { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.tag-manager-row .tag-color-trigger { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 1px 2px rgba(49,44,34,.05); }
.tag-manager-row .tag-color-trigger:hover, .tag-manager-row .tag-color-trigger[aria-expanded="true"] { border-color: #c9c2b4; background: var(--paper-deep); }
.tag-color-trigger span { width: 17px; height: 17px; display: block; border-radius: 50%; background: var(--tag-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tag-color-palette { grid-column: 1 / -1; padding: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(26px, 1fr)); gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper-deep); }
.tag-color-palette[hidden] { display: none; }
.tag-manager-row .tag-color-swatch { position: relative; width: 27px; height: 27px; justify-self: center; padding: 0; border: 2px solid var(--paper-deep); border-radius: 50%; background: var(--tag-color); box-shadow: 0 0 0 1px rgba(70,64,52,.13); transition: transform .14s ease, box-shadow .14s ease; }
.tag-manager-row .tag-color-swatch:hover { transform: scale(1.1); box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--tag-color); }
.tag-manager-row .tag-color-swatch.is-active { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--tag-color); }
.tag-manager-row .tag-color-swatch.is-active::after { content: ""; position: absolute; left: 7px; top: 6px; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.tag-creator { margin: 18px 0 14px; padding: 7px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper-deep); }
.tag-creator label { min-width: 0; height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; color: var(--accent-dark); background: var(--white); transition: border-color .16s ease, box-shadow .16s ease; }
.tag-creator label:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.2); }
.tag-creator label span { font-size: 14px; font-weight: 500; }
.tag-creator input { min-width: 0; width: 100%; height: 100%; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.tag-creator .primary-button { min-height: 40px; }
.tag-manager-list { max-height: min(44vh, 390px); overflow-y: auto; padding-right: 2px; }
.tag-manager-empty { padding: 30px 14px; border: 1px dashed #d8d2c5; border-radius: 12px; color: var(--muted); text-align: center; font-size: 11px; }
.settings-list { display: grid; gap: 10px; margin-top: 18px; }
.settings-item { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.settings-item strong { display: block; font-size: 12px; }
.settings-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.settings-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  min-width: 0;
  min-height: 2.125rem;
  padding: 0 2rem 0 .75rem;
  border: 1px solid var(--line);
  border-radius: .625rem;
  color: var(--ink);
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='m1.5 1.5 4.5 4.5 4.5-4.5' stroke='%23635f55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right .7rem center;
  background-repeat: no-repeat;
  background-size: .7rem .5rem;
  cursor: pointer;
  font-size: .75rem;
  line-height: 1;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.settings-select:hover { border-color: #c9c2b4; background-color: #fffefb; }
.settings-select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.2); }
.settings-modal { width: min(470px, 100%); padding: 24px; border-radius: 18px; }
.settings-modal h2 { margin-bottom: 7px; font: 500 26px/1.1 Georgia, serif; letter-spacing: -.02em; }
.settings-modal > p { max-width: 390px; margin-bottom: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; line-height: 1.5; }
.settings-modal .settings-list { gap: 0; overflow: hidden; margin-top: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.72); box-shadow: 0 5px 18px rgba(49,44,34,.035); }
.settings-modal .settings-item { min-height: 60px; padding: 11px 14px; border: 0; border-radius: 0; background: transparent; transition: background-color .16s ease; }
.settings-modal .settings-item + .settings-item { border-top: 1px solid var(--line); }
.settings-modal .settings-item:hover { background: rgba(243,240,231,.46); }
.settings-modal .account-settings-item { background: rgba(243,240,231,.28); }
.settings-modal .settings-item > div { min-width: 0; }
.settings-modal .settings-item > :last-child { flex: 0 0 auto; }
.settings-modal .settings-item strong { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; font-weight: 600; line-height: 1.3; }
.settings-modal .settings-item span { margin-top: 2px; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 10.5px; line-height: 1.4; }
.settings-modal .account-settings-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-modal .settings-item .secondary-button,
.settings-modal .settings-item .danger-button { width: 84px; min-width: 84px; min-height: 34px; height: 34px; padding: 0 10px; border-radius: 9px; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; font-weight: 500; }
.settings-modal .settings-item .settings-select { width: auto; min-width: 0; height: 2.125rem; padding: 0 2rem 0 .75rem; border-radius: .625rem; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .75rem; font-weight: 400; }
.settings-modal .modal-actions { margin-top: 16px; }
.settings-modal .modal-actions .primary-button { width: 84px; min-width: 84px; min-height: 34px; height: 34px; padding: 0 10px; border-radius: 9px; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; font-weight: 500; }
.danger-button { min-height: 40px; padding: 0 16px; border: 1px solid #ad443e; border-radius: 8px; color: #fff; background: #bd4f49; cursor: pointer; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; font-weight: 550; line-height: 1; box-shadow: 0 1px 2px rgba(89,35,29,.1); }
.danger-button:hover { border-color: #9f3b36; background: #ad443e; box-shadow: 0 2px 5px rgba(89,35,29,.13); }
.danger-button:active { background: #9f3b36; box-shadow: inset 0 1px 2px rgba(62,21,17,.16); }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; padding: 10px 14px; border-radius: 9px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .2s; font-size: 11px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-note-list { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 760px) {
  .auth-page { display: block; }
  .auth-intro { min-height: 255px; padding: 24px 22px 30px; }
  .auth-intro-copy { margin: 44px 0 0; }
  .auth-intro h1 { margin: 10px 0 12px; font-size: 38px; }
  .auth-intro-copy > p { margin-bottom: 0; font-size: 12px; line-height: 1.55; }
  .auth-privacy, .auth-gujarati { display: none; }
  .auth-panel { min-height: 0; padding: 32px 22px 48px; place-items: start center; }
  .auth-card-heading h2 { font-size: 30px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-header { position: sticky; top: 0; z-index: 20; height: calc(58px + env(safe-area-inset-top)); padding: calc(9px + env(safe-area-inset-top)) 16px 9px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(251,250,246,.96); backdrop-filter: blur(16px); }
  .brand.compact { padding: 0; }
  .brand.compact .brand-mark { --brand-mark-size: 1.9375rem; }
  .brand.compact strong { font-size: 18px; }
  .mobile-header-actions { display: flex; align-items: center; gap: 7px; }
  .mobile-add, .mobile-folders-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; cursor: pointer; }
  .mobile-add { color: #34332d; border: 1px solid #ddd8cc; background: var(--paper-deep); box-shadow: 0 1px 2px rgba(49,44,34,.05); font-size: 20px; }
  .mobile-folders-button { color: var(--accent-dark); background: var(--accent-soft); }
  .mobile-folders-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(66px + env(safe-area-inset-bottom)); padding: 6px 8px max(6px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); background: rgba(251,250,246,.96); backdrop-filter: blur(18px); }
  .mobile-nav button { border: 0; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); background: transparent; font-size: 9px; }
  .mobile-nav button > span:first-child { font-size: 19px; line-height: 1; }
  .mobile-nav button > span:last-child { font-size: 9px; }
  .mobile-nav .profile-nav-icon { width: 20px; height: 20px; display: grid; place-items: center; }
  .mobile-nav .profile-nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-nav button.is-active { color: var(--accent-dark); }
  .mobile-drawer-scrim { position: fixed; inset: 0; z-index: 69; background: rgba(30,29,25,.32); backdrop-filter: blur(2px); }
  .mobile-drawer-scrim:not([hidden]) { display: block; }
  .mobile-drawer { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; background: var(--paper-deep); box-shadow: 22px 0 55px rgba(34,31,24,.2); transform: translateX(-105%); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
  .mobile-drawer.is-open { transform: translateX(0); }
  .mobile-drawer-head { padding: 0 4px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
  .mobile-drawer-head span, .mobile-drawer-head strong { display: block; }
  .mobile-drawer-head span { margin-bottom: 3px; color: var(--accent-dark); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .mobile-drawer-head strong { font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
  .mobile-drawer-head button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--white); cursor: pointer; font-size: 20px; }
  .mobile-new-folder { min-height: 40px; margin: 14px 0 9px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-dark); background: var(--white); cursor: pointer; font-size: 12px; font-weight: 550; }
  .mobile-new-folder > span:first-child { font-size: 17px; }
  .mobile-drawer-folders { min-height: 80px; max-height: 45vh; overflow-x: hidden; overflow-y: auto; padding: 2px 0 10px; }
  .mobile-drawer-section { margin-top: 8px; padding: 13px 5px 7px; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-shrink: 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  /* Keep a generous tap target without making the secondary action look like a large button. */
  .mobile-drawer-section .mobile-new-tag { appearance: none; -webkit-appearance: none; width: 2.75rem; height: 2.75rem; min-width: 2.75rem; padding: 0; display: grid; place-items: center; flex-shrink: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; box-shadow: none; line-height: 1; }
  .mobile-new-tag svg { width: 1rem; height: 1rem; fill: currentColor; pointer-events: none; }
  .mobile-drawer-section .mobile-new-tag:active { color: var(--accent-dark); background: var(--accent-soft); }
  .mobile-drawer-section .mobile-new-tag:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: -4px; }
  .mobile-drawer-tags { min-height: 0; overflow-x: hidden; overflow-y: auto; display: grid; gap: 2px; }
  .mobile-drawer-deleted { padding-top: 8px; }
  .mobile-drawer-settings { margin-top: auto; padding: 12px 8px 4px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 11px; }
  .app-content { padding: 25px 16px 100px; }
  .page-header { align-items: flex-start; }
  .page-header h1 { font-size: 36px; }
  .page-header .primary-button { display: none; }
  .library-context { align-items: flex-start; }
  .delete-all-button { min-width: 2.75rem; min-height: 2.75rem; padding-inline: .75rem; }
  .today-hero { min-height: 0; grid-template-columns: 1fr; }
  .today-hero h2 { font-size: 29px; }
  .date-medallion { display: none; }
  .notes-grid { grid-template-columns: 1fr; }
  .note-card { min-height: 150px; }
  .note-menu-trigger { width: 2.75rem; height: 2.75rem; margin: -13px -8px -13px 0; }
  .note-action-menu { width: 10rem; }
  .note-action-menu button { min-height: 2.75rem; font-size: .875rem; }
  .filter-main-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .search-box { grid-column: 1 / -1; min-width: 100%; }
  .filter-dropdown { min-width: 0; }
  .filter-trigger { width: 100%; min-width: 0; }
  .filter-reset { grid-column: 1 / -1; width: max-content; height: 30px; margin-left: auto; }
  .filter-reset:disabled { display: none; }
  .filter-menu { min-width: 0; width: calc(100vw - 58px); }
  .tag-filter-menu { left: 0; right: auto; }
  .date-filter-menu { left: auto; right: 0; }
  .active-filters { padding-inline: 12px; }
  .filter-chip-divider { display: none; }
  .clear-all-filters { margin-left: auto; }
  .tag-creator { grid-template-columns: 1fr; }
  .tag-creator .primary-button { width: 100%; }
  .calendar-layout { border-radius: 18px; }
  .calendar-panel { padding: 13px; border-radius: 0; }
  .day-panel { padding: 17px; border-radius: 0; }
  .day-note-list { grid-template-columns: 1fr; }
  .calendar-day { min-height: 58px; padding: 5px; }
  .day-number { top: 6px; left: 7px; width: 22px; height: 22px; font-size: 10px; }
  .day-dots { left: 5px; right: 5px; bottom: 6px; }
  .day-dots i { width: 4px; height: 4px; }
  .day-dots small { display: none; }
  .calendar-head h2 { font-size: 20px; }
  .note-editor { width: 100%; top: var(--editor-viewport-top, 0px); height: var(--editor-viewport-height, 100dvh); padding-top: max(1rem, env(safe-area-inset-top)); padding-bottom: calc(6rem + env(safe-area-inset-bottom)); overscroll-behavior-y: contain; scroll-padding-block: 10rem 4rem; }
  .note-editor.is-open { transform: none; }
  .note-editor .viewer-body { padding-bottom: 3rem; }
  .note-editor .word-count { position: static; display: block; margin-top: 1rem; text-align: right; }
  .editor-meta { width: 100%; flex-wrap: wrap; }
  .tag-input-wrap { width: 100%; flex-basis: 100%; }
  .modal-backdrop:has(.pdf-modal) { padding: 0; }
  .modal.pdf-modal { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .pdf-reader { grid-template-rows: 56px minmax(0, 1fr); }
  .pdf-reader header strong { max-width: calc(100vw - 100px); }
  .pdf-pages { padding: 8px; gap: 8px; }
  .editor-title { font-size: 29px; }
  .format-toolbar-shell { top: max(8px, env(safe-area-inset-top)); width: 100%; }
  .format-toolbar { width: 100%; max-width: 100%; flex-wrap: wrap; overflow-x: visible; }
  .format-toolbar .format-divider { display: none; }
  .format-toolbar-toggle { min-height: 2.75rem; }
  .format-toolbar button, .format-toolbar .font-menu-trigger { min-height: 2.75rem; }
  .format-toolbar > button, .format-color-menu, .format-list-menu { min-width: 2.75rem; flex-basis: 2.75rem; }
  .format-color-menu > button, .format-list-menu > button { width: 2.75rem; }
  .note-editor.keyboard-open { padding-top: .5rem; scroll-padding-top: 8rem; }
  .keyboard-open .format-toolbar-shell { top: 0; }
  .keyboard-open .format-toolbar { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; }
  .rich-editor { min-height: 45dvh; padding-bottom: 4rem; scroll-margin-bottom: 4rem; }
  .attachment-grid { grid-template-columns: 1fr; }
  .mobile-folder-trigger { width: 100%; min-height: 40px; margin: -2px 0 15px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-dark); background: var(--white); cursor: pointer; font-size: 12px; font-weight: 550; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .editor-action.record-audio-action.is-recording { animation: none; }
}
