:root {
  color-scheme: light dark;
  --page: light-dark(#f5f6f8, #101318);
  --surface: light-dark(#ffffff, #191d23);
  --surface-soft: light-dark(#f0f2f5, #22272e);
  --text: light-dark(#1e242c, #edf0f4);
  --muted: light-dark(#68717d, #9aa4b0);
  --border: light-dark(#dfe3e8, #343b44);
  --accent: light-dark(#3456d1, #8fa4ff);
  --accent-text: light-dark(#ffffff, #101318);
  --accent-soft: light-dark(#e9edff, #293253);
  --secret: light-dark(#7d3f94, #d1a1e5);
  --secret-soft: light-dark(#f5eafa, #39283f);
  --danger: light-dark(#a72f38, #ff9aa2);
  --danger-soft: light-dark(#fff0f1, #3b2226);
  --success: light-dark(#276845, #78c79a);
  --archive: light-dark(#8a4b13, #f0b86e);
  --archive-soft: light-dark(#fff1df, #3b2a1c);
  --sidebar: light-dark(#eef3fb, #151b24);
  --sidebar-hover: light-dark(#dfe9f8, #202b3a);
  --sidebar-line: light-dark(#cbd8eb, #33445c);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
}

button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
a { color: var(--accent); }

input, textarea, select {
  width: 100%;
  padding: .65rem .75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .55rem;
}

textarea { resize: vertical; line-height: 1.5; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.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;
}

.primary-button, .secondary-button, .danger-button, .icon-button, .lock-button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.25rem;
  padding: .45rem .75rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .55rem;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button { color: var(--accent-text); background: var(--accent); border-color: transparent; font-weight: 600; }
.danger-button { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
.icon-button { width: 2.25rem; padding: 0; }
.text-button { min-height: auto; padding: .15rem .25rem; color: var(--muted); background: transparent; border: 0; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(220px, 620px) auto;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: .65rem 1rem;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.app-brand { display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 650; text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: .6rem;
  font-weight: 700;
}

.global-search { position: relative; }
.global-search input { min-height: 2.5rem; padding-right: 4.2rem; background: var(--surface-soft); }
.global-search kbd { position: absolute; top: 50%; right: .6rem; transform: translateY(-50%); padding: .12rem .35rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: .3rem; font: .72rem ui-monospace, monospace; }
.search-suggestions { position: absolute; top: calc(100% + .45rem); right: 0; left: 0; max-height: min(70vh, 34rem); overflow-y: auto; padding: .35rem; background: var(--surface-soft); border: 1px solid var(--border); border-radius: .65rem; box-shadow: 0 16px 38px rgba(0,0,0,.18); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.header-actions form { margin: 0; }
.mobile-account-actions { display: none; align-items: center; gap: .3rem; }

.lock-button[aria-pressed="true"] { color: var(--accent-text); background: var(--accent); border-color: transparent; }
.edit-only { display: none !important; }
body.is-editing .edit-only { display: block !important; }
body.is-editing form.edit-only { display: inline-block !important; }
body.is-editing button.edit-only { display: inline-flex !important; }

.workspace { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); min-height: calc(100vh - 4rem); }

.item-list { position: sticky; top: 4rem; display: flex; flex-direction: column; height: calc(100vh - 4rem); background: var(--sidebar); border-right: 1px solid var(--sidebar-line); }
.item-list-header { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; padding: .55rem .75rem; background: color-mix(in srgb, var(--sidebar) 72%, var(--surface)); border-bottom: 2px solid var(--sidebar-line); }
.item-list-header span { color: var(--muted); font-size: .82rem; }
.item-list-back { color: var(--muted); font-size: .78rem; text-decoration: none; }
.item-tag-filter { padding: .5rem .6rem .35rem; }
.item-tag-filter select { min-height: 2rem; padding: .35rem .55rem; background: var(--surface); border-color: var(--sidebar-line); border-radius: .45rem; font-size: .78rem; }
.item-list-results { min-height: 0; flex: 1; overflow-y: auto; }
.empty-list { padding: .75rem; color: var(--muted); font-size: .8rem; }

.item-list-entry { display: block; margin: .08rem .35rem; padding: .4rem .55rem; color: var(--text); border: 0; border-radius: .35rem; text-decoration: none; }
.item-list-entry:hover { background: var(--sidebar-hover); }
.item-list-entry.is-selected { color: var(--text); background: var(--surface); box-shadow: none; }
.item-list-title { display: block; margin-bottom: .12rem; overflow: hidden; font-size: .86rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.item-list-parent { display: block; margin: -.15rem 0 .35rem; overflow: hidden; color: var(--archive); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.item-list-meta { display: flex; gap: .35rem; color: var(--muted); font-size: .66rem; }
.item-group > summary { display: flex; align-items: center; gap: .3rem; min-height: 2rem; margin: .08rem .35rem; padding: .2rem .3rem; list-style: none; border-radius: .35rem; }
.item-group > summary:hover { background: var(--sidebar-hover); }
.item-group > summary::-webkit-details-marker { display: none; }
.item-group > summary::before { content: "›"; flex: 0 0 auto; color: var(--muted); font-size: 1rem; transform: rotate(0); transition: transform .12s ease; }
.item-group[open] > summary::before { transform: rotate(90deg); }
.item-group-link { min-width: 0; flex: 1; overflow: hidden; padding: .15rem .2rem; color: var(--text); background: transparent; border: 0; border-radius: .3rem; font-size: .82rem; font-weight: 650; text-align: left; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.item-group-link:hover { color: var(--accent); }
.item-group-link.is-selected { color: var(--text); background: var(--surface); }
.item-group-count { color: var(--muted); font-size: .65rem; }
.item-group-edit { align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; padding: 0; color: var(--muted); border-radius: .3rem; font-size: .78rem; text-decoration: none; }
body.is-editing .item-group-edit { display: inline-flex !important; }
.item-group-edit:hover { color: var(--accent); background: var(--surface); }
.item-tree-children { margin-left: 1rem; border-left: 1px solid var(--sidebar-line); }
.item-tree-children .item-list-entry { padding-left: .8rem; }
.item-list-results > .item-group { margin-top: .45rem; }
.item-list-results > .item-group > summary { min-height: 2.35rem; margin-right: .45rem; background: transparent; }
.item-list-results > .item-group > summary .item-group-link { font-size: .9rem; font-weight: 750; letter-spacing: .025em; }
.content-search-card { display: grid; gap: .3rem; margin: .5rem; padding: .7rem .75rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: .6rem; text-decoration: none; box-shadow: 0 2px 7px color-mix(in srgb, #000 6%, transparent); }
.content-search-card:hover, .content-search-card:focus-visible { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 38%, var(--surface)); }
.search-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 0; }
.search-card-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-card-heading small { flex: 0 0 auto; padding: .1rem .35rem; color: var(--muted); background: var(--surface-soft); border-radius: .3rem; font-size: .66rem; font-weight: 650; text-transform: uppercase; }
.search-card-excerpt { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .78rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.search-card-location { overflow: hidden; color: var(--accent); font-size: .72rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.search-suggestions .content-search-card { margin: .25rem; padding: .65rem .7rem; }
.sidebar-footer { display: grid; flex: 0 0 auto; border-top: 2px solid var(--sidebar-line); }
.sidebar-footer form { margin: 0; }
.sidebar-footer-item { display: grid; grid-template-columns: 1rem 1fr auto; align-items: center; gap: .45rem; width: 100%; min-height: 2.15rem; padding: .3rem .7rem; color: var(--muted); background: var(--sidebar); border: 0; border-radius: 0; font-size: .76rem; text-align: left; text-decoration: none; }
.sidebar-footer-item:hover { color: var(--text); background: var(--sidebar-hover); }
.sidebar-footer-item svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.archive-menu-item { color: var(--archive); background: var(--archive-soft); }
.archive-menu-item:hover, .archive-menu-item.is-active { color: var(--archive); background: color-mix(in srgb, var(--archive) 16%, var(--surface)); }
.archive-count { min-width: 1.4rem; padding: .1rem .35rem; text-align: center; background: color-mix(in srgb, var(--archive) 12%, var(--surface)); border-radius: 999px; font-size: .72rem; }

.item-canvas { min-width: 0; padding: clamp(1.25rem, 4vw, 3rem); }
.item-document { width: min(100%, 840px); margin: 0 auto; }
.item-heading { margin-bottom: 1.5rem; padding: .5rem; border: 1px solid transparent; border-radius: .75rem; }
.item-heading h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; }
.home-dashboard { width: min(100%, 52rem); margin: 0 auto; padding: 2.5rem .5rem; }
.home-dashboard h1 { margin: 0 0 1.25rem; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.home-dashboard-empty { padding: 1rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; }
.recent-items { display: grid; gap: .65rem; }
.recent-item-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: .75rem; text-decoration: none; }
.recent-item-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.recent-item-card span { color: var(--muted); font-size: .78rem; }
.create-item-dialog { width: min(calc(100% - 2rem), 28rem); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: .85rem; box-shadow: 0 22px 60px rgba(0,0,0,.25); }
.create-item-dialog::backdrop { background: rgba(8, 12, 18, .42); backdrop-filter: blur(2px); }
.create-item-form { display: grid; gap: .55rem; padding: 1rem; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem; }
.dialog-heading h2 { margin: 0; font-size: 1.15rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.tag { padding: .2rem .5rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: .45rem; font-size: .78rem; }

.content-block {
  position: relative;
  scroll-margin-top: 5rem;
  margin: .75rem 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .75rem;
}
.content-block:target { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.block-drag-handle {
  position: absolute;
  z-index: 2;
  top: -.7rem;
  left: 50%;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 1.35rem;
  padding: 0;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .08);
  cursor: grab;
  transform: translateX(-50%);
  touch-action: none;
}
.block-drag-handle:hover { color: var(--accent); border-color: var(--accent); }
.block-drag-handle:active { cursor: grabbing; }
.content-block.is-dragging { opacity: .48; border-color: var(--accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.blocks.is-reordering .content-block:not(.is-dragging) { transition: transform .12s ease; }
.block-collapse-button {
  position: absolute;
  z-index: 2;
  top: -.7rem;
  right: .75rem;
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.35rem;
  padding: 0;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .4rem;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .08);
}
.block-collapse-button:hover { color: var(--accent); border-color: var(--accent); }
.block-collapse-button svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.content-block.is-collapsed .block-collapse-button svg { transform: rotate(-90deg); }
.content-block.is-collapsed .block-display > :not(.block-label) { display: none; }
.content-block.is-collapsed .block-label { margin-bottom: 0; }
.block-code.is-collapsed { padding: .8rem 1rem; }
.block-code.is-collapsed .block-label { padding: 0; }
.block-compact-setting { display: inline-flex; align-items: center; gap: .45rem; width: fit-content; margin-bottom: .3rem; font-weight: 650; cursor: pointer; }
.block-compact-setting input { width: 1rem; height: 1rem; margin: 0; }

body.is-editing [data-editable-block]:not(.is-open) { cursor: pointer; }
body.is-editing [data-editable-block]:not(.is-open):hover { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent); }
.block-label { margin-bottom: .5rem; color: var(--muted); font-size: .75rem; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.block-text .block-label { margin-bottom: .8rem; color: var(--text); font-size: .9rem; font-weight: 750; letter-spacing: .025em; }
.text-content { line-height: 1.68; overflow-wrap: anywhere; }
.text-content a { text-underline-offset: .18rem; }
.text-content ul, .text-content ol { margin: .35rem 0 .65rem; padding-left: 1.5rem; }
.text-content li { margin: .18rem 0; padding-left: .12rem; }

.block-code { padding: 0; overflow: hidden; background: light-dark(#17202a, #0c1014); }
.block-code .block-label { padding: .8rem 1rem 0; color: light-dark(#c6d0dc, #aab5c1); }
.code-header { display: flex; justify-content: space-between; padding: .2rem 1rem .65rem; color: light-dark(#c6d0dc, #aab5c1); font-size: .78rem; }
pre { margin: 0; padding: 1rem; overflow: auto; color: light-dark(#eef4fa, #dce5ef); background: transparent; font: .86rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.code-token.code-keyword { color: #ff7ab2; font-weight: 600; }
.code-token.code-type { color: #82d2ff; }
.code-token.code-string { color: #b8e986; }
.code-token.code-number { color: #f6c177; }
.code-token.code-comment { color: #8492a0; font-style: italic; }
.code-placeholder { padding: .05rem .28rem; color: #ffd166; background: rgba(255, 209, 102, .14); border: 1px solid rgba(255, 209, 102, .38); border-radius: .3rem; font-weight: 700; }
.code-placeholder-marker { display: none; }

.secret-action-button, .inline-action-button, .code-copy-button, .inline-code-copy {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: .45rem;
}
.secret-action-button:hover, .inline-action-button:hover, .code-copy-button:hover, .inline-code-copy:hover { background: color-mix(in srgb, currentColor 9%, transparent); }
.secret-action-button svg, .inline-action-button svg, .code-copy-button svg, .inline-code-copy svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-reveal-secret] [data-icon-hide] { display: none; }
[data-reveal-secret][data-visible="true"] [data-icon-show] { display: none; }
[data-reveal-secret][data-visible="true"] [data-icon-hide] { display: block; }

.value-row, .file-row { display: flex; align-items: center; gap: .6rem; }
.value-row > :first-child { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.secret-value, [data-secret-value] { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.block-secret { border-color: color-mix(in srgb, var(--secret) 25%, var(--border)); }
.block-description { margin-top: .55rem; color: var(--muted); line-height: 1.5; }
.file-row > span:nth-child(2) { min-width: 0; flex: 1; }
.file-row strong, .file-row small { display: block; overflow-wrap: anywhere; }
.file-row small { margin-top: .2rem; color: var(--muted); }
.file-lock { font-size: 1.4rem; }

.inline-chip { display: inline-flex; align-items: center; gap: .2rem; margin: 0 .1rem; padding: .12rem .4rem; border-radius: .4rem; font-size: .9em; }
.inline-chip-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .28rem; margin: .13rem 0; }
.inline-chip-line .inline-chip { margin: 0; }
.inline-bold { font-weight: 700; }
.inline-field { color: var(--accent); background: var(--accent-soft); }
.inline-secret { color: var(--secret); background: var(--secret-soft); }
.inline-action-button { width: 1.45rem; height: 1.45rem; border: 0; border-radius: .3rem; }
.inline-action-button svg { width: .9rem; height: .9rem; }
.inline-reference-missing { color: var(--danger); }

.inline-code-snippet { margin: .75rem 0; overflow: hidden; color: light-dark(#eef4fa, #dce5ef); background: light-dark(#17202a, #0c1014); border-radius: .6rem; }
.inline-code-header { display: flex; align-items: center; justify-content: space-between; min-height: 2.2rem; padding: .35rem .55rem .35rem .85rem; color: light-dark(#c6d0dc, #aab5c1); border-bottom: 1px solid light-dark(#2d3946, #252c34); font: .75rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.inline-code-snippet pre { padding: .85rem 1rem; white-space: pre; }
.inline-code-copy { width: 1.65rem; height: 1.65rem; border: 0; }

.block-editor { display: none; }
body.is-editing [data-editable-block].is-open > .block-display { display: none; }
body.is-editing [data-editable-block].is-open > .block-editor { display: block; }

.editor-form { display: grid; gap: .55rem; }
.editor-form label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.form-actions { display: flex; gap: .5rem; margin-top: .35rem; }
.create-child-form { margin-top: .7rem; }
.item-danger-actions { display: flex; align-items: flex-end; gap: .5rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.archive-action-form, .delete-item-form { margin: 0; }
.archive-action-button { min-height: 2.25rem; padding: .45rem .75rem; color: var(--archive); background: var(--archive-soft); border: 1px solid color-mix(in srgb, var(--archive) 30%, var(--border)); border-radius: .55rem; font-weight: 600; }
.delete-form { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

.add-content { margin-top: 1.2rem; padding: .75rem; border: 1px dashed var(--border); border-radius: .75rem; }
.add-content summary { color: var(--accent); font-weight: 600; }
.quick-add-panel { display: grid; gap: .65rem; margin-top: .75rem; }
.quick-text-form { display: grid; gap: .65rem; }
.quick-text-form textarea { min-height: 10rem; background: var(--surface); }
.quick-add-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.shorthand-hints { display: flex; flex-wrap: wrap; gap: .35rem; color: var(--muted); }
.shorthand-hints code { padding: .2rem .4rem; background: var(--surface-soft); border: 1px solid var(--border); border-radius: .35rem; font-size: .72rem; }
.edit-shorthand-hints { margin-top: -.15rem; }
.file-upload-panel { padding-top: .55rem; border-top: 1px solid var(--border); }
.file-upload-panel summary { display: inline-flex; align-items: center; color: var(--muted); font-size: .84rem; font-weight: 600; }
.compact-file-form { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(150px, .7fr) minmax(200px, 1.4fr) auto; align-items: center; gap: .5rem; margin-top: .65rem; }
.file-upload-panel small { display: block; margin-top: .35rem; color: var(--muted); }

.empty-canvas { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.app-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; padding: .7rem .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: .6rem; box-shadow: 0 12px 35px rgba(0,0,0,.18); }

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.auth-shell { width: min(100%, 390px); }
.auth-panel { padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 18px 50px rgba(0,0,0,.12); }
.auth-panel .brand-mark { margin-bottom: 1rem; }
.auth-panel h1 { margin: 0 0 1.25rem; }
.auth-form { display: grid; gap: .55rem; }
.auth-form label:not(.checkbox-row) { margin-top: .35rem; color: var(--muted); font-size: .82rem; font-weight: 600; }
.checkbox-row { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.checkbox-row input { width: auto; }
.validation-summary, .field-error { color: var(--danger); font-size: .82rem; }
.validation-summary:empty, .field-error:empty { display: none; }

.account-page { display: grid; place-items: start center; min-height: calc(100vh - 4rem); padding: clamp(1.25rem, 5vw, 4rem) 1rem; }
.account-panel { width: min(100%, 480px); padding: 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: .9rem; }
.account-panel h1 { margin: .6rem 0 1.25rem; }
.account-back { color: var(--muted); font-size: .82rem; text-decoration: none; }
.account-form { display: grid; gap: .5rem; }
.account-form label { margin-top: .35rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.account-form button { margin-top: .75rem; }
.success-message { margin-bottom: .9rem; padding: .65rem .75rem; color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border)); border-radius: .5rem; }

@media (max-width: 760px) {
  .app-header { grid-template-columns: auto 1fr auto; gap: .5rem; padding: .55rem .65rem; }
  .app-brand > span:last-child, .global-search kbd, .lock-button [data-lock-label] { display: none; }
  .header-actions { gap: .3rem; }
  .mobile-account-actions { display: flex; }
  .workspace { grid-template-columns: 1fr; }
  .item-list { display: none; }
  .item-canvas { padding: 1rem .75rem 2rem; }
  .quick-add-footer { align-items: flex-end; }
  .compact-file-form { grid-template-columns: 1fr; }
  .value-row { align-items: flex-start; flex-wrap: wrap; }
  .file-row { align-items: flex-start; }
  .file-row .secondary-button { margin-left: auto; }
}

@media (max-width: 460px) {
  .header-actions .primary-button { width: 2.25rem; overflow: hidden; padding: 0; font-size: 0; }
  .header-actions .primary-button::before { content: "+"; font-size: 1.25rem; }
}
