* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.notes-app { margin: 0; background: var(--rdk-case); color: var(--rdk-text); font: 400 16px/1.5 var(--rdk-font-ui); }
button, input { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.app-header { background: var(--rdk-structure); color: var(--rdk-surface); padding-top: env(safe-area-inset-top); }
.header-inner { max-width: 760px; margin: auto; padding: 20px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-icon { border: 1px solid var(--rdk-border-dark); width: 40px; height: 44px; border-radius: var(--rdk-radius); display: grid; place-items: center; font-size: 24px; font-weight: 650; }
.brand-caption { font-size: 11px; letter-spacing: .13em; }
.brand h1 { margin: 0; font-size: 25px; line-height: 1.1; font-weight: 650; }
.header-count { font-size: 13px; }
.notes-shell { max-width: 760px; padding: 24px 16px 110px; margin: auto; }
.search-bar { position: relative; }
.search-bar svg { position: absolute; width: 19px; height: 19px; top: 15px; left: 15px; color: var(--rdk-text-muted); pointer-events: none; }
.search-bar .rdk-input { width: 100%; min-height: 48px; padding: 10px 14px 10px 44px; font-size: 16px; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 2px 12px; }
.list-heading h2 { font-size: 14px; font-weight: 600; margin: 0; color: var(--rdk-text-muted); }
#search-count { font-size: 13px; color: var(--rdk-text-muted); }
#notes-container { display: grid; gap: 12px; }
.note { min-width: 0; overflow: hidden; }
.note-summary { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 17px 18px; cursor: pointer; list-style: none; }
.note-summary::-webkit-details-marker { display: none; }
.note-summary:focus-visible { outline: 2px solid var(--rdk-focus); outline-offset: -3px; }
.note-copy { min-width: 0; }
.note-copy h3 { font-size: 18px; line-height: 1.35; margin: 0 0 6px; font-weight: 650; overflow-wrap: anywhere; }
.note-preview { margin: 0; color: var(--rdk-text-muted); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.note-chevron { color: var(--rdk-text-muted); font-size: 21px; line-height: 1; }
details[open] .note-chevron { transform: rotate(180deg); }
details[open] .note-preview { display: none; }
.note-full { font: inherit; padding: 0 18px 20px; min-height: 0; height: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-full img { max-width: 100%; height: auto; }
.note-full pre { white-space: pre-wrap; }
.note-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--rdk-border); }
.secondary-actions { display: none; gap: 8px; }
.note:has(details[open]) .secondary-actions { display: flex; }
.notes-app .rdk-btn { min-height: 44px; font-size: 15px; padding: 10px 14px; cursor: pointer; }
.icon-button { min-width: 44px; }
.edit-button { display: flex; justify-content: space-between; gap: 30px; }
.add-dock { position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--rdk-case); border-top: 1px solid var(--rdk-border); z-index: 3; }
.add-dock .rdk-btn { width: 100%; max-width: 728px; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: auto; font-size: 16px; }
.add-dock span { font-size: 23px; line-height: 1; }
.empty-state { text-align: center; padding: 46px 16px; }
.empty-state h3 { font-size: 22px; font-weight: 600; margin: 12px 0 8px; }
.empty-state p { margin: 0 0 22px; color: var(--rdk-text-muted); }
.empty-mark { display: block; font-size: 36px; color: var(--rdk-text-muted); }
.compose-dialog { width: min(640px, calc(100% - 24px)); padding: 0; }
.compose-dialog form { padding: 20px; }
.composer-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.composer-heading h2 { font-size: 23px; margin: 0; }
.notes-app .title-input { width: 100%; min-height: 48px; padding: 10px 12px; font-size: 18px; margin-bottom: 12px; }
.notes-app .note-textarea { display: block; width: 100%; min-height: 190px; padding: 14px; font: inherit; font-size: 16px; line-height: 1.6; resize: vertical; }
.composer-footer, .edit-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.draft-status, .edit-status { color: var(--rdk-text-muted); font-size: 12px; }
.note-editing { padding: 18px; }
.edit-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.edit-heading .rdk-label { font-size: 11px; }
.edit-footer .rdk-btn { flex: 1; }
.form-error { color: var(--rdk-accent-red); font-size: 14px; }
.htmx-request { cursor: progress; }
.htmx-request .note-actions, .htmx-request .edit-footer { opacity: .65; }
#feedback { position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 12px 20px; max-width: calc(100% - 32px); width: max-content; z-index: 6; font-size: 14px; }
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-panel { padding: 28px; width: min(100%, 400px); }
.login-panel h1 { font-size: 28px; margin: 16px 0 8px; }
.login-panel p { color: var(--rdk-text-muted); }
.login-panel form { display: grid; gap: 10px; margin-top: 24px; }
.login-panel input { width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px; }
.login-panel label:not(:first-child) { margin-top: 10px; }
.login-panel button { margin-top: 12px; }
.login-panel .rdk-notice { padding: 12px; }
@media (max-width: 480px) {
  .compose-dialog { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 100dvh; border-radius: 16px 16px 0 0; }
  .compose-dialog form { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .draft-status { max-width: 115px; }
  .notes-app .note-textarea { min-height: 180px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
