:root {
  --life-notes-bg: #f3f4f6;
  --life-notes-surface: rgba(255,255,255,0.94);
  --life-notes-surface-strong: #ffffff;
  --life-notes-border: rgba(15, 23, 42, 0.08);
  --life-notes-text: #101218;
  --life-notes-muted: #6b7280;
  --life-notes-accent: #ef4444;
  --life-notes-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  --life-notes-paper: #fbfbfb;
}
html[data-theme="dark"] {
  --life-notes-bg: #070707;
  --life-notes-surface: rgba(18,18,18,0.96);
  --life-notes-surface-strong: #131313;
  --life-notes-border: rgba(255,255,255,0.08);
  --life-notes-text: #f6f6f6;
  --life-notes-muted: #a3a3a3;
  --life-notes-accent: #ff5d5d;
  --life-notes-shadow: 0 22px 48px rgba(0,0,0,0.55);
  --life-notes-paper: #151515;
}
.notes-route-page .modal-content,
.notes-page-content {
  background: transparent;
  padding: 0;
}
.life-notes-shell {
  position: relative;
  min-height: calc(100vh - 120px);
  padding: 28px 18px 110px;
  color: var(--life-notes-text);
  background: var(--life-notes-bg);
}
.life-notes-shell.embedded {
  border-radius: 28px;
}
.life-notes-shell.standalone {
  min-height: 100vh;
}
.life-notes-page-head {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}
.life-notes-app-badge {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(239,68,68,0.12);
  color: var(--life-notes-accent);
  font-size: 0.88rem;
  font-weight: 700;
}
.life-notes-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.life-notes-title-row h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}
.life-notes-title-row p {
  margin: 8px 0 0;
  color: var(--life-notes-muted);
  font-size: 1rem;
  font-weight: 600;
}
.life-notes-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.life-notes-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid var(--life-notes-border);
  background: var(--life-notes-surface-strong);
  color: var(--life-notes-text);
  box-shadow: 0 6px 16px rgba(15,23,42,0.08);
}
.life-notes-icon-button.primary {
  background: rgba(239,68,68,0.13);
  color: var(--life-notes-accent);
}
.life-notes-page-tabs {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  width: fit-content;
  border: 1px solid var(--life-notes-border);
  border-radius: 999px;
  background: var(--life-notes-surface-strong);
}
.life-notes-page-tabs button,
.life-notes-editor-toolbar button {
  border: 0;
  background: transparent;
  color: var(--life-notes-muted);
}
.life-notes-page-tabs button {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
}
.life-notes-page-tabs button.active {
  background: var(--life-notes-accent);
  color: #fff;
}
.life-notes-toolbar-message {
  min-height: 1.1rem;
  color: var(--life-notes-muted);
  font-size: 0.92rem;
}
.life-notes-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.life-notes-crumb,
.life-notes-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--life-notes-border);
  background: var(--life-notes-surface-strong);
  color: var(--life-notes-text);
  font-weight: 600;
}
.life-notes-crumb.active {
  background: rgba(239,68,68,0.12);
  color: var(--life-notes-accent);
  border-color: rgba(239,68,68,0.2);
}
.life-notes-crumb-divider { color: var(--life-notes-muted); }
.life-notes-folder-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.life-notes-folder-card {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid transparent;
  text-align: left;
  color: #0f172a;
  box-shadow: var(--life-notes-shadow);
}
.life-notes-folder-card .life-notes-folder-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
}
.life-notes-folder-copy strong,
.life-notes-note-meta strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
}
.life-notes-folder-copy small,
.life-notes-note-meta span,
.life-notes-clipboard-copy small {
  display: block;
  margin-top: 6px;
  color: rgba(15,23,42,0.68);
  font-size: 0.88rem;
}
html[data-theme="dark"] .life-notes-folder-card { color: #101218; }
.tone-sage { background: linear-gradient(180deg, #d8eba4 0%, #cfe59d 100%); }
.tone-rose { background: linear-gradient(180deg, #ff8e98 0%, #f37482 100%); }
.tone-silver { background: linear-gradient(180deg, #efefef 0%, #d8d8dd 100%); }
.tone-sky { background: linear-gradient(180deg, #b9e7ff 0%, #9bd6ff 100%); }
.tone-amber { background: linear-gradient(180deg, #ffd89a 0%, #ffca63 100%); }
.tone-violet { background: linear-gradient(180deg, #d4c1ff 0%, #bea1ff 100%); }
.life-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.life-notes-note-card,
.life-notes-clipboard-card,
.life-notes-empty-card,
.life-notes-clipboard-hero {
  background: var(--life-notes-surface-strong);
  border: 1px solid var(--life-notes-border);
  border-radius: 28px;
  box-shadow: var(--life-notes-shadow);
}
.life-notes-note-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}
.life-notes-note-open {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}
.life-notes-note-preview {
  position: relative;
  min-height: 230px;
  padding: 18px;
  background: var(--life-notes-paper);
}
.life-notes-note-preview pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--life-notes-text);
}
.life-notes-note-preview-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.life-notes-note-meta,
.life-notes-card-actions,
.life-notes-clipboard-copy,
.life-notes-clipboard-actions-row,
.life-notes-empty-card,
.life-notes-clipboard-hero {
  padding: 18px;
}
.life-notes-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 0;
}
.life-notes-inline-action {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--life-notes-border);
  background: transparent;
  color: var(--life-notes-text);
}
.life-notes-inline-action.danger,
.btn-secondary.danger {
  color: #dc2626;
}
.life-notes-empty-card {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  color: var(--life-notes-muted);
}
.life-notes-empty-card .material-symbols-rounded { font-size: 2rem; }
.notes-wide-empty { grid-column: 1 / -1; }
.life-notes-clipboard-section {
  display: grid;
  gap: 18px;
}
.life-notes-clipboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.life-notes-current-clip-preview,
.life-notes-clipboard-copy pre {
  margin: 8px 0 0;
  font-family: inherit;
  white-space: pre-wrap;
  color: var(--life-notes-muted);
}
.life-notes-clipboard-actions,
.life-notes-clipboard-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.life-notes-clipboard-list {
  display: grid;
  gap: 16px;
}
.life-notes-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  border: 0;
  background: rgba(239,68,68,0.96);
  color: #fff;
  box-shadow: 0 18px 30px rgba(239,68,68,0.33);
  z-index: 4;
}
.life-notes-editor-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.38);
  z-index: 25;
}
.life-notes-editor-card {
  width: min(1180px, 100vw);
  height: 100vh;
  background: var(--life-notes-bg);
  display: grid;
  grid-template-rows: auto auto 1fr;
}
.life-notes-editor-head,
.life-notes-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 0;
}
.life-notes-editor-head {
  justify-content: space-between;
}
.life-notes-editor-head-copy {
  flex: 1;
}
.life-notes-editor-head-copy strong {
  display: block;
  font-size: 1.05rem;
}
.life-notes-editor-head-copy small,
.life-notes-editor-footnote {
  color: var(--life-notes-muted);
}
.life-notes-editor-toolbar {
  flex-wrap: wrap;
  padding-bottom: 12px;
}
.life-notes-editor-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--life-notes-border);
  background: var(--life-notes-surface-strong);
  color: var(--life-notes-text);
  font-weight: 600;
}
.life-notes-editor-toolbar button.active {
  background: rgba(239,68,68,0.12);
  color: var(--life-notes-accent);
  border-color: rgba(239,68,68,0.24);
}
.life-notes-editor-body {
  padding: 0 18px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 0;
}
.life-notes-editor-title {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: clamp(1.55rem, 2vw, 2rem);
  font-weight: 800;
  color: var(--life-notes-text);
  outline: 0;
  padding: 10px 4px;
}
.life-notes-editor-stage-scroll {
  min-height: 0;
  overflow: auto;
  border-radius: 28px;
  border: 1px solid var(--life-notes-border);
  background: var(--life-notes-surface-strong);
}
.life-notes-editor-stage {
  position: relative;
  min-height: 680px;
  background: var(--life-notes-paper);
}
.life-notes-editor-stage.inking-active {
  box-shadow: inset 0 0 0 1px rgba(239,68,68,0.18);
}
.life-notes-editor-textarea {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 680px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 24px 24px 80px;
  font: 500 1.02rem/1.75 Inter, system-ui, -apple-system, sans-serif;
  color: var(--life-notes-text);
  background: transparent;
}
.life-notes-editor-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.life-notes-editor-footnote {
  font-size: 0.9rem;
}
@media (max-width: 768px) {
  .life-notes-shell { padding: 22px 14px 98px; }
  .life-notes-title-row,
  .life-notes-clipboard-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .life-notes-head-actions { justify-content: flex-end; }
  .life-notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .life-notes-folder-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-x: auto; }
  .life-notes-folder-card { min-width: 0; padding: 14px; border-radius: 20px; }
  .life-notes-folder-copy strong { font-size: 0.95rem; }
  .life-notes-folder-copy small { font-size: 0.8rem; }
  .life-notes-note-preview { min-height: 180px; }
  .life-notes-fab { width: 62px; height: 62px; right: 20px; bottom: 20px; }
  .life-notes-editor-card { height: 100vh; }
}
@media (max-width: 540px) {
  .life-notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .life-notes-note-meta strong { font-size: 0.96rem; }
  .life-notes-note-meta span { font-size: 0.78rem; }
  .life-notes-page-tabs { width: 100%; justify-content: space-between; }
  .life-notes-page-tabs button { flex: 1; }
  .life-notes-editor-toolbar { gap: 8px; }
  .life-notes-editor-toolbar button { padding: 9px 12px; font-size: 0.84rem; }
}
