:root {
  color-scheme: light dark;
  --bg: light-dark(#f5f6f2, #181b19);
  --sidebar: light-dark(#eceee8, #141715);
  --surface: light-dark(#ffffff, #202420);
  --surface-hover: light-dark(#f0f3eb, #282e27);
  --text: light-dark(#252b25, #ecefe7);
  --muted: light-dark(#60695e, #a6afa2);
  --line: light-dark(#dce1d6, #363d33);
  --accent: light-dark(#365520, #bedb9d);
  --accent-bg: light-dark(#e2ecd6, #2a3524);
  --button-bg: #bedb9d;
  --button-text: #25341b;
  --danger: light-dark(#a32f35, #f49b9d);
  --radius: 14px;
  --theme-duration: 250ms;
  --sidebar-width: 250px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
:root:has(> head > meta[name='color-scheme'][content='dark']) { color-scheme: dark; }
:root:has(> head > meta[name='color-scheme'][content='light']) { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
button { color: inherit; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--text); background: var(--accent-bg); }
input, textarea { caret-color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; font-weight: 600; letter-spacing: -.035em; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.icon { flex-shrink: 0; vertical-align: middle; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 12px; background: var(--surface); z-index: 100; }
.skip-link:focus { top: 12px; }
.app-topbar { display: flex; justify-content: flex-end; align-items: center; min-height: 64px; padding: 8px clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line); }
.app-topbar .preferences { display: flex; align-items: center; gap: 12px; }
.app-topbar .language-control { padding: 0; }
.app-topbar .theme-control { padding-left: 0; }
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100dvh - 64px); }
.sidebar { position: sticky; top: 0; height: calc(100dvh - 64px); min-height: 660px; background: var(--sidebar); border-right: 1px solid var(--line); padding: 20px 18px 16px; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 650; letter-spacing: -.035em; padding: 0 12px; width: fit-content; }
.brand-mark { display: block; width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.brand-dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; align-self: flex-end; margin: 0 0 11px -8px; }
.sidebar-caption { color: var(--muted); font-size: 12px; padding: 8px 12px 18px; }
.sidebar-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sidebar-content > nav { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sidebar-content > nav > .nav-link { flex-shrink: 0; }
.sidebar-categories { min-height: 0; display: flex; flex-direction: column; flex: 1; }
.sidebar-categories > .nav-link { flex-shrink: 0; }
.category-nav-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.category-nav-list .nav-link > span:not(.category-emoji) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-nav-list .nav-link[hidden] { display: none; }
.sidebar-categories.is-collapsible:not(.is-expanded) .category-extra { display: none; }
.categories-toggle { align-self: flex-start; flex-shrink: 0; background: none; border: 0; min-height: 36px; padding: 6px 12px; font-size: 12px; }
.categories-toggle[hidden] { display: none; }
@media (min-width: 761px) {
  body:has(> .app-shell) { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100dvh; }
  body:has(> .app-shell) > .app-topbar { grid-column: 2; grid-row: 1; }
  .app-shell { display: contents; }
  .app-shell > .sidebar { grid-column: 1; grid-row: 1 / 3; height: 100dvh; align-self: start; }
  .app-shell > .main { grid-column: 2; grid-row: 2; }
}
@media (min-width: 761px) and (max-width: 1050px) { :root { --sidebar-width: 220px; } }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; margin-bottom: 3px; }
.nav-link > span:not(.category-emoji) { min-width: 0; overflow-wrap: anywhere; }
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.nav-link small { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.category-emoji { width: 20px; text-align: center; flex-shrink: 0; font-size: 17px; }
.nav-heading { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; padding: 8px 12px 2px; color: var(--muted); font-size: 12px; }
.nav-heading a { font-size: 20px; padding: 0 6px; }
.nav-divider { height: 1px; flex-shrink: 0; background: var(--line); margin: 8px 12px; }
.sidebar-bottom { flex-shrink: 0; padding-top: 12px; margin-top: auto; }
.theme-control { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; padding: 8px 12px; }
.theme-control { position: relative; min-height: 44px; cursor: pointer; }
.theme-switch { position: absolute; opacity: 0; width: 44px; height: 26px; right: 12px; margin: 0; }
.switch-track { display: flex; align-items: center; justify-content: flex-end; padding: 5px; width: 46px; height: 26px; flex-shrink: 0; border-radius: 20px; background: var(--line); color: var(--muted); position: relative; pointer-events: none; }
.switch-track::before { content: ''; position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); }
.theme-switch:checked + .switch-track { background: var(--accent-bg); color: var(--accent); justify-content: flex-start; }
.theme-switch:checked + .switch-track::before { transform: translateX(20px); background: var(--accent); }
.theme-switch:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 4px; }
.language-control { display: flex; align-items: center; gap: 4px; padding: 0 12px; }
.language-control button { padding: 6px 12px; min-height: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.language-control button[aria-pressed='true'] { background: var(--accent-bg); color: var(--accent); }
.language-control button:hover { color: var(--text); }
.login-panel > .preferences { margin-top: 32px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.autosave-status { font-size: 12px; color: var(--muted); }
.autosave-status[data-state='saved'] { color: var(--accent); }
.autosave-status[data-state='error'] { color: var(--danger); }
.autosave-retry { border: 0; background: transparent; color: var(--accent); font: inherit; cursor: pointer; min-height: 44px; }
.autosave-retry[hidden] { display: none; }
.retention-period input[aria-invalid='true'] { border-color: var(--danger); }
@media (prefers-reduced-motion: no-preference) { .switch-track::before { transition: transform 180ms ease-out; } }
option { background: var(--surface); color: var(--text); }
.account { display: flex; gap: 11px; align-items: center; border-top: 1px solid var(--line); padding: 18px 10px 0; margin-top: 10px; }
.avatar { background: var(--surface-hover); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--accent); flex-shrink: 0; }
.username { overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.account form { margin-left: auto; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--muted); border: 0; width: 34px; height: 34px; border-radius: 7px; padding: 0; }
.icon-button:hover { color: var(--text); background: var(--surface-hover); }
.main { padding: 32px clamp(24px, 4vw, 64px); min-width: 0; max-width: 1800px; width: 100%; margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 35px; }
.page-header > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.page-header > .button { flex-shrink: 0; }
.page-header p { color: var(--muted); margin-top: 10px; font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px; white-space: nowrap; }
.primary { background: var(--button-bg); color: var(--button-text); }
.primary:hover { background: #cce8b0; }
.secondary { border-color: var(--line); background: transparent; color: var(--text); }
.secondary:hover { background: var(--surface-hover); }
.toolbar { display: flex; gap: 22px; align-items: center; margin-bottom: 30px; }
.search { display: flex; align-items: center; gap: 12px; flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 0 14px; color: var(--muted); min-width: 0; }
.search input { width: 100%; min-width: 0; padding: 12px 0; background: transparent; color: var(--text); border: 0; outline: none; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 1; }
.search-submit { border: 0; color: var(--muted); background: transparent; font-size: 12px; padding: 8px 0 8px 8px; }
.sort-form select { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 10px 4px; }
.search-caption { margin: -8px 0 24px; color: var(--muted); overflow-wrap: anywhere; }
.search-caption a { text-decoration: underline; margin-left: 12px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); gap: 20px; align-items: start; }
.note-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 21px 16px; min-width: 0; transition: border-color 150ms ease; }
.note-card:has(.card-open:hover) { border-color: var(--accent); }
.note-card.pinned { background: light-dark(#f5f8ef, #232920); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.category-label { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.card-category { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-category-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; font-size: 23px; line-height: 1; border-radius: 8px; background: var(--bg); color: var(--muted); }
.card-controls { display: flex; align-items: center; gap: 2px; margin-right: -9px; }
.pin-indicator { color: var(--accent); display: flex; }
.pin-indicator .icon { width: 15px; height: 15px; }
.note-card h2 { font-size: 18px; line-height: 1.4; margin-bottom: 12px; overflow-wrap: anywhere; }
.card-open::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.note-menu, .card-attachments a { position: relative; z-index: 2; }
.note-menu[open] { z-index: 5; }
.note-menu summary { list-style: none; }
.note-menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 36px; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.menu-panel button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 10px 12px; font-size: 13px; border-radius: 5px; }
.menu-panel button:hover { background: var(--surface-hover); }
.danger-text { color: var(--danger); }
.note-preview { color: var(--muted); font-size: 14px; line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.card-attachments { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.card-attachments:empty { margin: 0; }
.attachment { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 12px; min-width: 0; }
.attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment .icon { width: 15px; height: 15px; }
a.attachment:hover { color: var(--accent); }
.card-footer { margin-top: 22px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.empty-state { text-align: center; max-width: 520px; padding: 65px 20px; margin: 35px auto; }
.empty-symbol { margin: 0 auto 25px; width: 64px; height: 64px; color: var(--accent); background: var(--accent-bg); display: grid; place-items: center; border-radius: 18px; }
.empty-symbol .icon { width: 30px; height: 30px; }
.empty-state h2 { font-size: 25px; }
.empty-state p { margin: 12px 0 24px; color: var(--muted); font-size: 14px; }
.text-link { color: var(--accent); font-weight: 600; }
.text-link span { margin-left: 6px; }
.messages { margin-bottom: 24px; }
.toast { display: flex; justify-content: space-between; gap: 20px; padding: 12px 16px; background: var(--accent-bg); color: var(--accent); border-radius: 8px; font-size: 14px; }
.dismiss-message { background: none; border: 0; color: inherit; font-size: 20px; line-height: 1; }
.back-link { display: inline-flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.editor-header { margin-bottom: 30px; }
.editor { max-width: 840px; }
.field { margin-bottom: 24px; min-width: 0; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field label span { color: var(--muted); font-weight: 400; margin-left: 5px; }
.field input:not([type='checkbox']), .field textarea, .field select { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; color: var(--text); }
.field textarea { resize: vertical; min-height: 200px; line-height: 1.7; }
.field-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; }
.file-field input { color: var(--muted) !important; font-size: 13px; }
input::file-selector-button { background: var(--surface-hover); color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; margin-right: 12px; cursor: pointer; }
.existing-file { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; overflow-wrap: anywhere; }
.existing-file a { color: var(--accent); font-size: 13px; }
.existing-file label { color: var(--muted); font-weight: 400; margin: 0; flex-shrink: 0; }
.editor-footer { border-top: 1px solid var(--line); padding-top: 25px; display: flex; gap: 15px; justify-content: space-between; align-items: center; }
.editor-footer > div { display: flex; gap: 10px; }
.save-hint { color: var(--muted); font-size: 12px; }
.errorlist { color: var(--danger); padding: 0; list-style: none; font-size: 13px; margin: 8px 0 14px; }
.nav-heading a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 8px; }
.nav-heading a:hover { color: var(--accent); background: var(--surface-hover); }
.category-editor { max-width: 660px; }
.category-editor .field .emoji-input { width: 100px; text-align: center; }
.trash-settings { border-block: 1px solid var(--line); padding-block: 20px; margin-bottom: 28px; }
.trash-settings-row, .cleanup-toggle, .retention-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trash-settings-row { gap: 12px 20px; }
.cleanup-toggle { cursor: pointer; min-height: 44px; }
.cleanup-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.retention-period input { width: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 16px; }
.retention-period[hidden] { display: none; }
.trash-settings:has(.cleanup-toggle input:not(:checked)) .retention-period { display: none; }
.trash-settings > .muted { max-width: 78ch; font-size: 13px; margin-top: 12px; }
.stats-summary { display: flex; gap: clamp(30px, 8vw, 120px); padding: 18px 0 40px; border-bottom: 1px solid var(--line); }
.stats-summary strong { display: block; font-size: 44px; line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.stats-summary span { color: var(--muted); font-size: 14px; }
.chart-section { margin: 36px 0 48px; max-width: 800px; }
.chart-section > p { font-size: 13px; margin-top: 6px; }
.bars { margin-top: 28px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 40px; align-items: center; gap: 22px; padding: 13px 0; font-size: 14px; }
.bar-row > span { min-width: 0; overflow-wrap: anywhere; }
.bar-row:hover { color: var(--accent); }
.bar-row strong { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.bar-track { background: var(--surface-hover); height: 9px; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; display: block; background: var(--accent); border-radius: 3px; }
.uncategorized { border-top: 1px solid var(--line); margin-top: 12px; }
.export-row { border-top: 1px solid var(--line); padding-top: 28px; display: flex; gap: 24px; justify-content: space-between; align-items: center; }
.export-row p { font-size: 13px; margin-top: 6px; max-width: 65ch; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 36px; }
.pagination span { color: var(--muted); font-size: 13px; }
.mobile-menu { display: none; }
.login-layout { min-height: calc(100dvh - 64px); display: grid; grid-template-columns: 1fr 1fr; }
.login-intro { background: var(--sidebar); padding: 48px 10%; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.login-intro .brand { padding: 0; }
.login-message { margin: auto 0; padding: 70px 0; }
.login-message h1 { font-size: clamp(40px, 5vw, 76px); letter-spacing: -.04em; line-height: 1.08; font-weight: 500; }
.login-message h1 span { color: var(--accent); }
.login-message p { margin-top: 28px; color: var(--muted); font-size: 16px; }
.full-name { font-size: 14px; }
.full-name span { display: block; font-size: 12px; margin-top: 4px; color: var(--muted); }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 32px; position: relative; }
.login-form { max-width: 350px; width: 100%; }
.login-form h2 { font-size: 29px; }
.login-form > .muted { font-size: 14px; margin: 10px 0 34px; }
.login-form .button { width: 100%; margin-top: 7px; justify-content: space-between; }
.login-help { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }
.login-theme { position: absolute; bottom: 32px; }
@media (prefers-reduced-motion: no-preference) { .empty-symbol { animation: arrive 350ms ease-out; } @keyframes arrive { from { transform: translateY(5px); } to { transform: translateY(0); } } }
@media (min-width: 1600px) { .notes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .app-shell { grid-template-columns: 220px minmax(0,1fr); } .main { padding: 36px 24px; } .sidebar { padding-left: 12px; padding-right: 12px; } .page-header { align-items: flex-start; } .page-header .button { padding: 10px 13px; } .toolbar { gap: 10px; } }
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; min-height: 0; padding: 16px 20px; border-right: 0; border-bottom: 1px solid var(--line); display: block; }
  .brand { padding: 0; font-size: 24px; }
  .brand-mark { width: 32px; height: 32px; font-size: 27px; }
  .mobile-menu { display: block; position: absolute; right: 20px; top: 17px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; background: transparent; }
  .sidebar-content { display: none; }
  .sidebar.is-open .sidebar-content { display: flex; margin-top: 15px; }
  .sidebar-caption { display: none; }
  .sidebar-bottom { padding-top: 15px; }
  .category-nav-list { max-height: 225px; }
  .main { padding: 28px 20px; }
  .page-header { gap: 16px; flex-wrap: wrap; margin-bottom: 25px; }
  .page-header > div { flex-basis: 100%; }
  .page-header h1 { font-size: 29px; }
  .page-header p { font-size: 13px; }
  .toolbar { flex-wrap: wrap; margin-bottom: 22px; }
  .search { flex-basis: 100%; }
  .sort-form { margin-left: auto; }
  .notes-grid { grid-template-columns: repeat(auto-fill,minmax(min(100%,270px),1fr)); gap: 16px; }
  .empty-state { padding: 36px 0; margin: 10px auto; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .editor-footer { justify-content: flex-end; }
  .save-hint { display: none; }
  .existing-file { align-items: flex-start; flex-direction: column; gap: 8px; }
  .bar-row { grid-template-columns: 125px 1fr 24px; gap: 12px; font-size: 13px; }
  .stats-summary strong { font-size: 36px; }
  .export-row { flex-direction: column; align-items: flex-start; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { padding: 25px 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-message { padding: 35px 0 28px; }
  .login-message h1 { font-size: 42px; }
  .login-message h1 br { display: none; }
  .login-message p { display: none; }
  .full-name { font-size: 12px; }
  .full-name span { display: none; }
  .login-panel { padding: 32px 28px 85px; }
  .login-theme { bottom: 18px; }
}

.information-menu summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 12px; color: var(--muted); font-size: 13px; list-style: none; border-radius: 8px; }
.information-menu summary::-webkit-details-marker { display: none; }
.information-menu summary:hover { color: var(--text); background: var(--surface-hover); }
.information-menu[open] summary .icon { transform: rotate(180deg); }
.information-menu .legal-links { padding: 8px 12px 16px; flex-direction: column; gap: 10px; }
.sidebar .information-menu { position: relative; }
.sidebar .information-menu .legal-links { position: absolute; left: 0; bottom: 100%; z-index: 12; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 12px; }
.login-footer { width: 100%; max-width: 350px; margin-top: 32px; }
.category-actions { margin: -12px 0 28px; }
.category-actions button { background: none; border: 0; padding: 8px 0; min-height: 44px; font-size: 13px; font-weight: 400; text-decoration: underline; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.emoji-preview { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 56px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 26px; cursor: default; user-select: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.category-select { position: relative; }
.category-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.category-select-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-select-trigger:hover { border-color: var(--accent); }
.category-select-trigger[hidden], .category-picker[hidden], .category-empty[hidden] { display: none; }
.category-picker { position: absolute; inset: calc(100% + 6px) 0 auto; z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.category-picker [role='listbox'] { max-height: min(240px, 32dvh); overflow-y: auto; overscroll-behavior: contain; margin-top: 8px; }
.category-picker [role='option'] { padding: 10px; min-height: 44px; border-radius: 5px; overflow-wrap: anywhere; cursor: pointer; }
.category-picker [role='option']:hover, .category-picker .is-active { background: var(--surface-hover); }
.category-picker [aria-selected='true'] { color: var(--accent); font-weight: 600; }
.category-empty { padding: 12px 4px; font-size: 13px; }
.file-field input[type='file'] { cursor: pointer; }
.file-field input[type='file']:hover, .file-field input[type='file']:focus-visible { border-color: var(--accent); background: var(--surface-hover); }
.file-field input[type='file']:hover::file-selector-button { background: var(--accent-bg); border-color: var(--accent); }
@media (max-width: 760px) {
  .app-topbar { padding-inline: 20px; }
  .app-topbar .preferences { gap: 4px; }
}

.text-link:hover, .back-link:hover, .existing-file a:hover, .autosave-retry:hover, .search-caption a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; }
.brand:hover { color: var(--accent); }
.search-submit:hover, .sort-form select:hover, .theme-control:hover { color: var(--accent); }
.theme-control:hover .switch-track { outline: 1px solid var(--accent); }
.language-control button:hover, .mobile-menu:hover, .dismiss-message:hover { background: var(--surface-hover); }
.cleanup-toggle:hover, .existing-file label:hover { color: var(--accent); }
.recording-stop:hover { background: var(--surface-hover); color: var(--accent); }
.policy-dialog a:hover, .contact-address:hover, .decline-form .text-link:hover { color: var(--accent); text-decoration-thickness: 2px; }
.legal-checkbox:hover { color: var(--accent); }
.field input:not([type='checkbox']):hover, .field textarea:hover { border-color: var(--accent); }
.note-card:has(.card-open:focus-visible) { border-color: var(--accent); }
.field label .required-mark { color: var(--danger); font-weight: 600; margin-left: 2px; }
a:active, button:active:enabled, summary:active { opacity: .8; }
@media (min-width: 761px) and (max-height: 800px) {
  .sidebar { padding-top: 12px; padding-bottom: 12px; }
  .sidebar-caption { padding-bottom: 8px; }
  .nav-link { min-height: 38px; padding-block: 6px; margin-bottom: 1px; }
  .sidebar-bottom { padding-top: 4px; }
  .account { padding-top: 10px; margin-top: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .theme-changing body, .theme-changing body *, .theme-changing body *::before, .theme-changing body *::after {
    transition: background-color var(--theme-duration) ease-out, color var(--theme-duration) ease-out, border-color var(--theme-duration) ease-out;
  }
}
