.notebook, .note-media-viewer { padding: 0; width: min(900px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 48px); border: 1px solid var(--border, #e0e4ee); border-radius: 16px; color: #18243e; }
.notebook::backdrop, .note-media-viewer::backdrop { background: #17244380; }
.notebook-form { display: flex; flex-direction: column; max-height: calc(100dvh - 50px); }
.notebook-header, .notebook-footer, .note-media-viewer > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; background: #fff; flex-shrink: 0; }
.notebook-header { border-bottom: 1px solid #e0e4ee; }
.notebook-header h2, .note-media-viewer h2 { margin: 3px 0 0; font-size: 21px; overflow-wrap: anywhere; }
.notebook-header small, .note-context > small { color: #7656c9; font-size: 12px; }
.notebook-body { padding: 24px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.notebook-intro, .note-upload-hint { color: #69778e; font-size: 13px; line-height: 1.7; margin: 0 0 24px; }
.note-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 30px; }
.note-summary section { padding-left: 14px; border-left: 2px solid #d4c8ee; }
.note-summary h3, .note-context h3 { font-size: 14px; margin: 0 0 10px; }
.notebook .preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: 14px; margin: 10px 0; }
.notebook .muted { color: #8b95a6; }
.note-section-heading, .note-card-heading { display: flex; align-items: center; gap: 12px; }
.note-section-heading { justify-content: space-between; margin-bottom: 14px; }
.note-section-heading h3 { margin: 0; font-size: 16px; }
.note-section-heading > span { color: #7a879d; font-size: 12px; }
.note-cards { display: grid; gap: 16px; }
.note-card { min-width: 0; border: 1px solid #e0e4ee; border-radius: 12px; padding: 20px; background: #fff; }
.note-card-heading { margin-bottom: 16px; }
.note-card-heading h3 { margin: 3px 0 0; font-size: 17px; overflow-wrap: anywhere; }
.note-card-heading small, .note-file-name { color: #6f7e95; font-size: 12px; overflow-wrap: anywhere; }
.note-step { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: #eee8f8; color: #7656c9; font-size: 13px; }
.note-card-tools { display: flex; margin-left: auto; gap: 4px; }
.note-card-tools button { min-width: 44px; min-height: 44px; border: 1px solid #e0e4ee; border-radius: 8px; background: #fff; color: #52617c; }
.notebook button:disabled { opacity: .45; cursor: default; }
.notebook button:focus-visible, .note-media-viewer button:focus-visible { outline: 2px solid #7656c9; outline-offset: 3px; }
.note-photo { display: block; width: 100%; background: #f6f7fa; border: 0; border-radius: 8px; padding: 8px; margin-bottom: 16px; text-align: center; }
.note-photo img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.photo-status { display: block; font-size: 12px; color: #62718b; margin-top: 8px; }
.note-add-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 12px; }
.note-context { padding: 20px; background: #f6f4fb; border-radius: 10px; margin-top: 28px; }
.note-context h3 { margin-top: 10px; }
.note-context textarea { width: 100%; }
.notebook-footer { border-top: 1px solid #e0e4ee; justify-content: flex-end; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.notebook .button, .note-media-viewer .button { min-height: 44px; }
.notebook input, .notebook textarea { font-size: 16px; }
.note-empty { padding: 32px 20px; background: #f7f8fc; border: 1px dashed #d5daea; border-radius: 10px; text-align: center; color: #708098; line-height: 1.8; font-size: 14px; }
.note-media-content { padding: 20px; overflow: auto; }
.note-media-viewer { width: min(1000px, calc(100% - 32px)); }
.note-media-viewer > header { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #e0e4ee; }
.photo-zoom-tools { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.photo-scroll { width: 100%; max-height: 65dvh; overflow: auto; background: #f5f6fa; }
.photo-scroll img { display: block; width: 100%; max-width: none; height: auto; }
.note-media-content > p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.open-notebook { width: 100%; justify-content: space-between; margin: 18px 0 6px; text-align: left; }
.open-notebook small { font-size: 11px; font-weight: 400; }
.notebook-preview { color: #718097; font-size: 12px; line-height: 1.7; margin: 0 0 16px; }
@media (max-width: 620px) {
  .notebook, .note-media-viewer { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .notebook-form { height: 100dvh; max-height: 100dvh; }
  .notebook-header, .notebook-footer, .note-media-viewer > header { padding: 14px 16px; }
  .notebook-header h2 { font-size: 19px; }
  .notebook-body { padding: 20px 16px; flex: 1; }
  .note-summary { grid-template-columns: 1fr; gap: 18px; }
  .note-card { padding: 14px; }
  .note-card-heading { gap: 8px; }
  .note-card-tools { gap: 2px; }
  .note-card-tools button { min-width: 44px; }
  .note-add-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .note-add-buttons .button { padding: 10px 6px; font-size: 13px; }
  .notebook-footer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .notebook-footer .button { flex: 1; }
  .note-media-content { padding: 16px; }
}
@media (max-width: 359px) {
  .top-actions > [data-action="help"] { display: inline-flex; }
}
