/* DOCUMENTATION BLOCK
 * Handnotes responsive shell. All color tokens come from themes/*.css.
 * Desktop: notes library | workspace | collapsible drawing inspector.
 * <= 900 px: notes library becomes a drawer.
 * <= 640 px: inspector becomes a bottom sheet; compact touch controls.
 * Focus mode removes navigation without changing the active note.
 */
:root { font-family: "Open Sans", "Segoe UI", Arial, sans-serif; color-scheme: light; --sidebar: 224px; --inspector: 244px; --radius: 12px; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button, select, input, textarea { color: inherit; }
button { border: 0; background: none; }
button:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
a { color: var(--accent-text); text-underline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-size: 13px; }
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); grid-template-rows: 70px minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.app-header { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--header); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-family: Georgia, "Times New Roman", serif; font-size: 23px; line-height: 1; letter-spacing: -.5px; }
.brand-mark { color: var(--accent-text); display: grid; place-items: center; width: 32px; height: 38px; }
.brand-mark svg { width: 27px; height: 27px; }
.brand-sub { display: block; margin-top: 7px; color: var(--muted); font-family: "Open Sans", "Segoe UI", Arial, sans-serif; font-size: 8px; letter-spacing: 2.4px; font-weight: 600; }
.preview-badge { color: var(--muted); border-left: 1px solid var(--line); padding-left: 16px; font-size: 11px; }
.header-spacer, .toolbar-spacer { flex: 1; }
.theme-switch { display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--inset); }
.theme-switch button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 4px 10px; color: var(--muted); font-size: 12px; border-radius: 6px; }
.theme-switch svg { width: 15px; height: 15px; }
.theme-switch button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px #00000012; }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--muted); }
.icon-button:hover:not(:disabled), .tool-button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.mobile-menu { display: none; }
.popover { position: absolute; z-index: 65; padding: 10px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.main-menu { right: 18px; top: 60px; width: 300px; max-height: calc(100dvh - 85px); overflow-y: auto; }
.main-menu > button, .main-menu > a { color: var(--text); width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px; text-decoration: none; font-size: 13px; text-align: left; border-radius: 7px; }
.main-menu > button:hover, .main-menu > a:hover { background: var(--hover); }
.menu-label { font-size: 10px; letter-spacing: 1px; color: var(--muted); padding: 0 10px; }
.menu-label span { font-size: 9px; float: right; letter-spacing: 0; }
.menu-appearance { border-top: 1px solid var(--line); padding: 12px 0 4px; margin-top: 6px; }
.menu-appearance .theme-switch { margin: 8px; }
.menu-appearance .theme-switch button { flex: 1; }
.support-details { margin: 12px 8px 5px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.support-details summary { color: var(--accent-text); cursor: pointer; }

.notes-panel { display: flex; flex-direction: column; background: var(--sidebar-bg); border-right: 1px solid var(--line); padding: 19px 14px 0; min-height: 0; z-index: 45; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 35px; font-size: 13px; font-weight: 600; }
.notes-panel .panel-heading { padding: 0 4px 8px; }
.panel-close { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--line-strong); background: var(--panel); border-radius: 8px; font-size: 12px; font-weight: 600; min-height: 38px; text-decoration: none; white-space: nowrap; color: var(--text); }
.button svg { width: 17px; height: 17px; }
.button:hover:not(:disabled) { background: var(--hover); }
.button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { filter: brightness(1.06); background: var(--accent); }
.button.quiet { background: transparent; border-color: var(--line); }
.new-note { justify-content: flex-start; padding-left: 14px; margin: 8px 0 18px; }
.search-field { display: flex; align-items: center; background: var(--inset); border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; gap: 7px; }
.search-field svg { width: 16px; height: 16px; color: var(--muted); }
.search-field input { width: 100%; border: 0; min-width: 0; background: transparent; padding: 9px 0; font-size: 12px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
.library-controls { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 20px; }
.library-controls select { max-width: 100%; background: transparent; border: 0; color: var(--muted); font-size: 11px; padding: 3px 1px; }
select { color-scheme: inherit; }
.section-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; letter-spacing: 1.4px; padding: 0 8px 10px; }
.section-label > :last-child { letter-spacing: 0; background: var(--hover); padding: 0 6px; border-radius: 4px; }
.note-list { overflow-y: auto; flex: 1; min-height: 40px; }
.note-item { display: flex; flex-direction: column; width: 100%; text-align: left; padding: 13px 12px; gap: 5px; border-radius: 9px; border: 1px solid transparent; margin: 0 0 6px; }
.note-item.active { background: var(--selected); border-color: var(--selected-line); }
.note-item:hover { background: var(--hover); }
.note-item.active:hover { background: var(--selected); }
.note-item-title { color: var(--text); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; width: 100%; white-space: nowrap; }
.note-item-snippet { font-size: 11px; color: var(--muted); text-overflow: ellipsis; overflow: hidden; width: 100%; white-space: nowrap; }
.note-item-meta { display: flex; gap: 8px; font-size: 9px; color: var(--muted); margin-top: 4px; align-items: center; }
.note-item-meta span:first-child { background: var(--tag); color: var(--tag-text); padding: 1px 6px; border-radius: 3px; }
.sidebar-bottom { margin-top: auto; padding: 16px 4px 14px; }
.local-message { display: flex; align-items: center; gap: 9px; margin: 8px 0 17px; }
.local-message svg { width: 17px; color: var(--muted); }
.local-message span { font-size: 11px; }
.local-message small { display: block; font-size: 9px; color: var(--muted); }
.sidebar-settings { width: 100%; display: flex; gap: 10px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar-settings svg { width: 17px; }
.sidebar-settings .trailing { margin-left: auto; width: 13px; }
.workspace { display: grid; grid-template-rows: 71px 49px minmax(0, 1fr); min-height: 0; min-width: 0; overflow: hidden; }
.document-bar { display: flex; gap: 10px; align-items: center; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.document-heading { display: flex; align-items: center; min-width: 0; flex: 1; gap: 10px; }
.document-path { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.document-path svg { width: 15px; height: 15px; }
#note-title { width: 200px; min-width: 30px; color: var(--text); font-size: 16px; font-weight: 600; background: transparent; border: 0; padding: 6px 3px; text-overflow: ellipsis; }
.save-status { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.save-status svg { width: 13px; color: var(--success); }
.view-tabs { display: flex; align-items: stretch; padding: 0 24px; gap: 24px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; scrollbar-width: none; }
.view-tabs::-webkit-scrollbar { display: none; }
.view-tabs button { display: flex; align-items: center; gap: 7px; position: relative; flex-shrink: 0; color: var(--muted); padding: 0 0 2px; font-size: 12px; white-space: nowrap; border-bottom: 2px solid transparent; }
.view-tabs button[aria-current="page"] { color: var(--accent-text); border-bottom-color: var(--accent-text); font-weight: 600; }
.view-tabs button:hover { color: var(--text); }
.view-tabs button svg { width: 16px; height: 16px; }
.view { min-width: 0; min-height: 0; }
.draw-view { display: grid; grid-template-columns: minmax(0, 1fr) var(--inspector); overflow: hidden; }
.draw-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 22px 25px 12px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 19px; }
.eyebrow { color: var(--muted); font-size: 9px; letter-spacing: 1.6px; font-weight: 600; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; letter-spacing: -.65px; margin: 3px 0 0; line-height: 1.2; }
.workspace-heading .button { font-size: 11px; padding: 7px 10px; min-height: 34px; }
.drawing-frame { display: flex; flex-direction: column; flex: 1; min-height: 0; border: 1px solid var(--line-strong); border-radius: 11px; overflow: hidden; box-shadow: var(--paper-shadow); background: var(--panel); }
.drawing-toolbar { display: flex; align-items: center; gap: 3px; min-height: 53px; padding: 6px 11px; border-bottom: 1px solid var(--line); background: var(--panel); }
.tool-button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 34px; padding: 6px 9px; color: var(--muted); border-radius: 7px; font-size: 11px; }
.tool-button svg { width: 18px; height: 18px; }
.tool-button.selected { background: var(--selected); color: var(--accent-text); }
.toolbar-divider { height: 20px; border-left: 1px solid var(--line); margin: 0 5px; }
.current-color { width: 18px; height: 18px; border-radius: 50%; background: #111827; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line-strong); display: block; }
.paper-viewport { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--paper); position: relative; }
.paper { position: relative; min-height: 100%; width: 100%; background-color: var(--paper); --pattern-line: #1e355018; }
.paper[data-pattern="ruled"], .paper-swatch.ruled { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, var(--pattern-line) 29px, var(--pattern-line) 30px); }
.paper[data-pattern="grid"], .paper-swatch.grid { background-image: linear-gradient(var(--pattern-line) 1px, transparent 1px), linear-gradient(90deg, var(--pattern-line) 1px, transparent 1px); background-size: 24px 24px; }
.paper[data-pattern="dots"], .paper-swatch.dots { background-image: radial-gradient(var(--pattern-line) 1px, transparent 1px); background-size: 20px 20px; }
#drawing-canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.canvas-hint { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; white-space: nowrap; gap: 8px; pointer-events: none; color: #66717d; }
.canvas-hint > span:not(.hint-pen) { font-family: Georgia, "Times New Roman", serif; font-size: 24px; color: #5e6974; }
.canvas-hint small { font-size: 10px; color: #66717d; }
.hint-pen { width: 50px; height: 50px; border: 1px solid #c5c9cc; border-radius: 50%; display: grid; place-items: center; margin-bottom: 7px; color: #8b754f; }
.hint-pen svg { width: 23px; height: 23px; }
.canvas-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 13px; min-height: 37px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.canvas-footer > span:first-child { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.text-button { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); padding: 5px 0 5px 8px; }
.text-button svg { width: 13px; height: 13px; }
.workspace-footnote { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); padding: 11px 1px 0; font-size: 9px; }
kbd { font-family: inherit; font-size: 8px; border: 1px solid var(--line); padding: 1px 4px; border-radius: 3px; }
.properties-panel { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 17px; display: flex; flex-direction: column; }
.properties-panel .panel-heading { margin: 0 0 9px; }
.properties-panel .panel-heading .icon-button { width: 28px; height: 30px; flex-basis: 28px; }
.control-group { padding: 17px 0; border-top: 1px solid var(--line); }
.control-group summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; }
.control-group summary::after { content: "⌃"; font-size: 16px; color: var(--muted); margin-left: 2px; }
.control-group:not([open]) summary::after { content: "⌄"; }
.control-group summary > span { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 10px; }
.control-group summary::-webkit-details-marker { display: none; }
.color-palette { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px 11px; padding: 19px 3px 15px; }
.color-swatch { width: 100%; aspect-ratio: 1; max-width: 33px; border-radius: 50%; position: relative; background: var(--swatch); border: 1px solid #80808050; margin: auto; }
.color-swatch[aria-pressed="true"] { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.color-swatch[aria-pressed="true"]::after { content: "✓"; color: var(--check-color); font-size: 15px; }
.custom-color-label { display: flex; align-items: center; color: var(--muted); font-size: 10px; gap: 7px; }
.custom-color-label input { width: 22px; height: 24px; border: 0; background: transparent; padding: 0; margin-left: auto; }
.custom-color-label > span { font-size: 9px; font-family: Consolas, monospace; }
.stroke-preview { height: 47px; display: flex; align-items: center; justify-content: center; background: #fffefa; border: 1px solid var(--line); border-radius: 6px; margin: 16px 0 12px; }
.stroke-preview span { display: block; width: 76%; height: 3px; background: #111827; border-radius: 20px; }
input[type="range"] { width: 100%; accent-color: var(--accent-text); cursor: pointer; height: 20px; }
input[type="checkbox"] { accent-color: var(--accent-text); width: 16px; height: 16px; flex-shrink: 0; margin: 0; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 11px; margin: 17px 0 2px; }
.checkbox-row span { margin-left: auto; color: var(--muted); }
.paper-options { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 17px; }
.paper-options button { font-size: 9px; display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); padding: 0; }
.paper-swatch { display: block; width: 100%; height: 52px; border-radius: 5px; border: 1px solid var(--line-strong); background-color: #fff; --pattern-line: #a7b4c6; }
.paper-swatch.ruled { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 7px, var(--pattern-line) 7px, var(--pattern-line) 8px); }
.paper-swatch.grid { background-size: 8px 8px; }
.paper-swatch.dots { background-size: 7px 7px; }
.paper-options button[aria-pressed="true"] { color: var(--accent-text); }
.paper-options button[aria-pressed="true"] .paper-swatch { border: 2px solid var(--accent-text); }
.properties-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; }
.properties-bottom p { color: var(--muted); text-align: center; font-size: 9px; margin: 7px 0 14px; }
.properties-bottom [data-close] { display: none; }
.full-width { width: 100%; }
.app.tools-collapsed .draw-view { grid-template-columns: minmax(0,1fr); }
.app.tools-collapsed .properties-panel { display: none; }
.focus-exit { display: none; }
.app.focus { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
.app.focus .app-header, .app.focus .notes-panel, .app.focus .document-bar, .app.focus .view-tabs, .app.focus .workspace-heading, .app.focus .workspace-footnote { display: none; }
.app.focus .workspace { grid-template-rows: minmax(0,1fr); }
.app.focus .draw-main { padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.app.focus .focus-exit { display: inline-flex; }
.app.focus .drawing-frame { box-shadow: none; }

.content-view, .editor-view { overflow-y: auto; padding: 28px 32px 40px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
.page-heading h1 { font-size: 32px; }
.settings-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.settings-card h2 { margin: 0 0 11px; font-size: 14px; font-weight: 600; }
.settings-card p { font-size: 12px; max-width: 780px; }
.settings-card summary { font-weight: 600; cursor: pointer; font-size: 14px; }
.settings-card .action-row { margin: 16px 0 0; }
.action-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 18px 0; }
.file-button { cursor: pointer; }
.editor-view { display: flex; flex-direction: column; }
.editor-meta { display: grid; grid-template-columns: minmax(150px,220px) minmax(180px,1fr); gap: 16px; margin: 0 0 22px; }
.editor-meta label, .field-label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 11px; }
.editor-meta select, .editor-meta input, .field-label input, .field-label select, #ai-task, #new-project-name { border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel); padding: 10px 12px; font-size: 13px; width: 100%; }
.field-label { margin: 18px 0; }
#new-project-name { flex: 1; min-width: 120px; }
#note-body { background: var(--paper); color: #24303c; border: 1px solid var(--line-strong); border-radius: 10px; padding: 28px; width: 100%; flex: 1; min-height: 260px; resize: none; line-height: 1.8; font-size: 16px; }
.attachment-strip { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
.attachment-card { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; overflow: hidden; max-width: 160px; font-size: 10px; color: var(--muted); }
.attachment-card img { display: block; width: 160px; height: 100px; object-fit: contain; background: white; }
.attachment-card span { display: block; padding: 6px 9px; }
.notes-overview { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 16px; }
.overview-note { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; text-align: left; min-height: 160px; }
.overview-note h2 { font-family: Georgia, serif; font-size: 22px; font-weight: 400; margin: 0 0 12px; }
.overview-note p { font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.overview-note small { color: var(--tag-text); background: var(--tag); border-radius: 4px; font-size: 10px; padding: 2px 7px; }
.capture-preview { background: #14171b; aspect-ratio: 16/9; min-height: 190px; max-height: 60vh; border-radius: 12px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
#camera-empty { color: #ced2d7; display: flex; align-items: center; flex-direction: column; }
#camera-empty svg { width: 32px; height: 32px; color: #8e98a5; }
#camera-empty p { font-size: 17px; margin: 12px 0 4px; }
#camera-empty small { color: #a8b0bc; font-size: 12px; }
#camera-video { width: 100%; height: 100%; object-fit: contain; }
.audio-card { padding: 35px 24px; text-align: center; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.record-indicator { width: 48px; height: 48px; background: var(--selected); border-radius: 50%; color: var(--accent-text); display: grid; place-items: center; margin: 0 auto 15px; }
.record-timer { display: block; font-size: 42px; letter-spacing: 3px; font-variant-numeric: tabular-nums; color: var(--text); }
.waveform { display: flex; align-items: center; justify-content: center; gap: 4px; height: 60px; margin: 12px 0 22px; }
.waveform i { width: 3px; height: var(--height); background: var(--line-strong); border-radius: 2px; }
.recording .waveform i { background: var(--accent-text); animation: wave 800ms ease-in-out infinite alternate; animation-delay: var(--delay); }
.recording .record-indicator { box-shadow: 0 0 0 6px var(--selected); }
@keyframes wave { to { transform: scaleY(.3); } }
#recordings-list audio { width: 100%; margin: 6px 0 14px; }
#ai-task { width: 260px; max-width: 100%; }
#ai-result { width: 100%; min-height: 180px; border: 1px solid var(--line); background: var(--inset); border-radius: 8px; padding: 16px; resize: vertical; }
.inline-link { color: var(--accent-text); padding: 0; text-decoration: underline; font: inherit; }
.theme-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 20px; }
.theme-cards button { display: flex; flex-direction: column; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 9px; gap: 7px; text-align: left; }
.theme-cards button[aria-pressed="true"] { border: 2px solid var(--accent-text); padding: 9px; }
.theme-cards button > span:not(.theme-mini) { font-size: 12px; font-weight: 600; }
.theme-cards small { font-size: 10px; color: var(--muted); }
.theme-mini { width: 100%; height: 90px; border-radius: 5px; border: 1px solid #80808040; display: grid; grid-template-columns: 28% 1fr; gap: 6px; padding: 8px; }
.theme-mini i { display: block; border-radius: 3px; }
.mini-light { background: #f0ede6; }.mini-light i:first-child { background: #ded7ca; }.mini-light i:last-child { background: #fffefa; }
.mini-dark { background: #111722; }.mini-dark i:first-child { background: #293344; }.mini-dark i:last-child { background: #414d60; }
.mini-white { background: #fff; }.mini-white i:first-child { background: #f1f2f4; }.mini-white i:last-child { background: #fff; border: 1px solid #d5d7dc; }
.project-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.project-chips span { background: var(--tag); color: var(--tag-text); font-size: 11px; padding: 4px 9px; border-radius: 5px; }
.panel-backdrop { position: fixed; inset: 0; background: #07121e66; backdrop-filter: blur(2px); border: 0; z-index: 40; cursor: default; }
.toast { position: fixed; bottom: max(24px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 100; border: 1px solid var(--line-strong); box-shadow: var(--shadow); background: var(--text); color: var(--panel); border-radius: 10px; padding: 12px 20px; font-size: 12px; max-width: calc(100vw - 32px); width: max-content; }
dialog { color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; width: min(540px,calc(100vw - 32px)); padding: 26px; box-shadow: var(--shadow); max-height: 85dvh; overflow-y: auto; }
dialog::backdrop { background: #07121e88; backdrop-filter: blur(3px); }
dialog p { font-size: 13px; line-height: 1.8; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { font-family: Georgia, serif; font-weight: 400; font-size: 28px; margin: 0; }

@media (min-width: 1500px) { :root { --sidebar: 250px; --inspector: 270px; }.draw-main { padding-left: 40px; padding-right: 40px; } }
@media (max-width: 1150px) { :root { --sidebar: 200px; --inspector: 220px; }.document-bar { padding: 0 18px; }.save-status { display: none; }.view-tabs { padding: 0 20px; gap: 20px; }.draw-main { padding: 20px 18px 12px; }.properties-panel { padding: 14px; }.workspace-footnote > span:last-child { display: none; }.optional-label { display: none; } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0,1fr); grid-template-rows: 62px minmax(0,1fr); }
  .app-header { padding: 0 16px; gap: 12px; }
  .mobile-menu { display: inline-flex; }
  .brand { font-size: 21px; }
  .brand-sub { font-size: 7px; }
  .notes-panel { display: none; position: fixed; left: 0; top: 0; bottom: 0; width: 280px; box-shadow: var(--shadow); padding-top: 18px; }
  .app.notes-open .notes-panel { display: flex; }
  .panel-close { display: inline-flex; }
  .workspace { grid-template-rows: 64px 48px minmax(0,1fr); }
  .draw-view { grid-template-columns: minmax(0,1fr); }
  .properties-panel { position: fixed; top: 62px; right: 0; bottom: 0; width: 275px; z-index: 50; padding: 20px; box-shadow: var(--shadow); }
  .properties-bottom [data-close] { display: inline-flex; }
  .color-palette { gap: 17px; }
  .theme-switch button { padding: 4px 8px; }
  .preview-badge { display: none; }
  .app.focus .properties-panel { top: 0; }
  .app.focus .notes-panel { display: none; }
}
@media (max-width: 640px) {
  .app { grid-template-rows: 54px minmax(0,1fr); }
  .app-header { gap: 5px; padding: 0 9px; padding-top: env(safe-area-inset-top); }
  .brand { gap: 4px; font-size: 20px; }
  .brand-mark { width: 27px; }
  .brand-mark svg { width: 23px; height: 23px; }
  .brand-sub { display: none; }
  .app-header > .theme-switch { border: 0; background: transparent; padding: 0; gap: 1px; }
  .app-header > .theme-switch button { padding: 0; min-width: 33px; height: 36px; border: 1px solid transparent; }
  .app-header > .theme-switch button[aria-pressed="true"] { border-color: var(--line); box-shadow: none; background: var(--selected); }
  .app-header > .theme-switch button span { display: none; }
  .app-header > .theme-switch svg { width: 16px; height: 16px; }
  .main-menu { right: 9px; top: 49px; }
  .workspace { grid-template-rows: 51px 55px minmax(0,1fr); }
  .document-bar { padding: 0 12px; gap: 7px; }
  .document-heading { gap: 4px; }
  .document-path > svg, .document-path > span:first-of-type { display: none; }
  .document-path > span:last-child { display: none; }
  #note-title { width: 100%; font-size: 15px; padding-left: 2px; }
  .save-note { padding: 7px 10px; font-size: 11px; min-height: 34px; }
  .export-note { border: 0 !important; padding: 6px; min-height: 34px; }
  .export-note span { display: none; }
  .view-tabs { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); padding: 0 8px; gap: 0; overflow: visible; }
  .view-tabs button { flex-direction: column; justify-content: center; gap: 3px; padding: 4px 0 3px; font-size: 9px; min-width: 0; }
  .view-tabs button svg { width: 17px; height: 17px; }
  .draw-main { padding: 9px 9px 7px; }
  .workspace-heading { margin: 0 1px 9px; min-height: 30px; }
  .workspace-heading .eyebrow { display: none; }
  .workspace-heading h1 { font-size: 19px; letter-spacing: -.3px; }
  .workspace-heading .button { font-size: 10px; min-height: 30px; border: 0; padding: 3px 2px 3px 8px; }
  .workspace-heading .button svg { width: 15px; height: 15px; }
  .drawing-frame { border-radius: 9px; }
  .drawing-toolbar { padding: 4px 5px; min-height: 46px; gap: 1px; }
  .tool-button { min-height: 36px; gap: 4px; padding: 5px 7px; font-size: 10px; }
  .tool-button svg { width: 18px; }
  .toolbar-divider { margin: 0 2px; height: 20px; }
  .drawing-toolbar .icon-button { width: 34px; height: 36px; flex-basis: 34px; }
  .canvas-hint > span:not(.hint-pen) { font-size: 21px; }
  .canvas-hint small { font-size: 9px; }
  .hint-pen { width: 43px; height: 43px; }
  .canvas-footer { min-height: 32px; padding: 0 9px; font-size: 8px; }
  #page-format { display: none; }
  .workspace-footnote { display: none; }
  .properties-panel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto; max-height: 78dvh; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 11px 22px max(20px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .properties-panel::before { content: ""; display: block; width: 35px; height: 4px; background: var(--line-strong); border-radius: 3px; margin: 0 auto 10px; flex-shrink: 0; }
  .properties-panel .panel-heading { font-size: 15px; margin-bottom: 4px; }
  .control-group { padding: 15px 0; }
  .color-palette { grid-template-columns: repeat(6,1fr); gap: 14px; padding: 20px 1px; }
  .color-swatch { width: 100%; min-width: 20px; max-width: 29px; }
  .color-swatch[aria-pressed="true"] { outline-offset: 3px; }
  .custom-color-label { justify-content: flex-end; font-size: 11px; }
  .custom-color-label input { margin-left: 8px; }
  .stroke-preview { height: 30px; margin-top: 12px; }
  .paper-swatch { height: 44px; }
  .properties-bottom { padding-top: 15px; }
  .properties-bottom > .button:first-child { min-height: 34px; }
  .properties-bottom p { margin: 5px 0 10px; }
  .app.focus .draw-main { padding: 0; }
  .app.focus .drawing-frame { border: 0; border-radius: 0; }
  .app.focus .canvas-footer { min-height: calc(28px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .app.focus .drawing-toolbar { padding-top: max(4px,env(safe-area-inset-top)); }
  .app.focus .properties-panel { top: auto; }
  .content-view, .editor-view { padding: 19px 14px 25px; }
  .page-heading { gap: 10px; align-items: flex-start; margin-bottom: 20px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading > .muted { max-width: 120px; text-align: right; font-size: 10px; }
  .editor-meta { gap: 10px; grid-template-columns: 1fr 1.4fr; margin-bottom: 15px; }
  .editor-meta input, .editor-meta select { min-width: 0; padding: 9px; font-size: 12px; }
  #note-body { padding: 18px 15px; font-size: 15px; min-height: 250px; }
  .settings-card { padding: 17px; }
  .theme-cards { gap: 8px; }
  .theme-cards button { padding: 6px; }
  .theme-cards button[aria-pressed="true"] { padding: 5px; }
  .theme-cards small { font-size: 9px; min-height: 28px; }
  .theme-mini { height: 65px; gap: 4px; padding: 5px; }
  .theme-cards button > span:not(.theme-mini) { font-size: 11px; }
  .action-row { gap: 7px; }
  .action-row .button { font-size: 11px; padding: 8px 11px; }
  .record-timer { font-size: 35px; }
}
@media (max-width: 350px) { .brand { font-size: 18px; }.brand-mark { display: none; }.color-palette { grid-template-columns: repeat(5,1fr); gap: 14px; }.tool-button { padding: 5px; }.tool-button[data-tool="eraser"] span { display: none; }.view-tabs button { font-size: 8px; } }
@media (max-height: 560px) and (orientation: landscape) { .app { grid-template-rows: 48px minmax(0,1fr); }.workspace { grid-template-rows: 45px 40px minmax(0,1fr); }.draw-main { padding: 6px; }.workspace-heading, .workspace-footnote { display: none; }.drawing-toolbar { min-height: 43px; }.canvas-footer { min-height: 26px; }.properties-panel { max-height: 96dvh; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
