.notes-main {
  --notes-bg: #f4ead6;
  --notes-paper: rgba(255, 250, 240, 0.96);
  --notes-paper-strong: rgba(255, 253, 247, 0.99);
  --notes-paper-soft: rgba(245, 234, 210, 0.88);
  --notes-line: rgba(133, 108, 70, 0.18);
  --notes-line-strong: rgba(133, 108, 70, 0.3);
  --notes-text: #2d2417;
  --notes-muted: #685743;
  --notes-accent: #f6c546;
  --notes-accent-strong: #dfab1c;
  --notes-highlight: #9f6100;
  --notes-gold-glow: 0 22px 48px rgba(223, 171, 28, 0.18);
  --notes-radius-xl: 28px;
  --notes-radius-lg: 22px;
  --notes-radius-md: 16px;
  display: grid;
  gap: 18px;
  padding-bottom: 40px;
}

.notes-hero,
.notes-must-grid,
.notes-sidebar,
.notes-list-panel,
.notes-editor-panel,
.notes-sidebar-card,
.notes-preview-panel,
.notes-assistant-panel {
  border: 1px solid var(--notes-line);
  border-radius: var(--notes-radius-xl);
  background: var(--notes-paper);
  box-shadow: 0 22px 48px rgba(59, 41, 14, 0.1);
}

.notes-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(246, 197, 70, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 238, 199, 0.72), transparent 34%),
    linear-gradient(135deg, rgba(255, 249, 235, 0.98), rgba(248, 238, 215, 0.96));
}

.notes-hero-copy {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.notes-kicker {
  margin: 0;
  color: #8f5b00;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.notes-hero h1,
.notes-main h2,
.notes-main h3,
.notes-title-input {
  margin: 0;
  color: var(--notes-text);
  font-family: "Fraunces", "Georgia", serif;
}

.notes-hero h1 {
  font-size: clamp(1.4rem, 2.8vw, 2.35rem);
  line-height: 1.02;
  max-width: 18ch;
}

.notes-lead,
.notes-ai-copy,
.notes-hero-note,
.notes-preview-copy,
.notes-list-status,
.notes-folder-note,
.notes-meta-row,
.notes-list-card-copy,
.notes-ai-list,
.notes-sidebar-card,
.notes-shell-button,
.notes-body-field span,
.notes-tags-field span {
  color: var(--notes-muted);
}

.notes-lead {
  max-width: 58ch;
  font-size: 1.05rem;
  line-height: 1.7;
}

.notes-hero-badges,
.notes-ai-actions,
.notes-hero-actions,
.notes-app-chip-list,
.notes-meta-row,
.notes-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.notes-hero-badges span,
.notes-app-chip,
.notes-meta-row span,
.notes-note-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(133, 108, 70, 0.16);
  background: rgba(255, 253, 247, 0.9);
  color: #5b4523;
  font-size: 0.82rem;
  font-weight: 700;
}

.notes-hero-actions {
  margin-top: 4px;
}

.notes-shell-button,
.notes-icon-button {
  border: 1px solid rgba(133, 108, 70, 0.18);
  background: rgba(255, 253, 247, 0.96);
  color: var(--notes-text);
  border-radius: 14px;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.notes-main .btn,
.notes-main .btn.secondary,
.notes-shell-button {
  border-color: rgba(223, 171, 28, 0.26);
  background: linear-gradient(135deg, var(--notes-accent), #ffd971);
  color: #3c2b09;
  box-shadow: var(--notes-gold-glow);
}

.notes-main .btn:hover,
.notes-main .btn.secondary:hover,
.notes-shell-button:hover {
  border-color: rgba(223, 171, 28, 0.4);
}

.notes-shell-button:hover,
.notes-icon-button:hover,
.notes-folder-button:hover,
.notes-list-card:hover {
  transform: translateY(-1px);
  border-color: var(--notes-line-strong);
}

.notes-shell-button-strong {
  background: linear-gradient(135deg, var(--notes-accent), #ffd971);
  color: #3c2b09;
  box-shadow: var(--notes-gold-glow);
}

.notes-shell-button-danger {
  border-color: rgba(126, 42, 32, 0.22);
  background: rgba(126, 42, 32, 0.1);
  color: #7e2a20;
  box-shadow: none;
}

.notes-icon-button {
  min-width: 44px;
  justify-content: center;
}

.notes-ai-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.65;
}

.notes-must-grid {
  display: grid;
  gap: 14px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(246, 197, 70, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(249, 240, 219, 0.98));
}

.notes-must-head {
  display: grid;
  gap: 8px;
}

.notes-must-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.notes-must-card {
  padding: 14px;
  border-radius: var(--notes-radius-md);
  border: 1px solid rgba(133, 108, 70, 0.14);
  background: var(--notes-paper-strong);
  display: grid;
  gap: 8px;
}

.notes-must-card strong {
  color: var(--notes-text);
  font-size: 0.98rem;
}

.notes-must-card p {
  margin: 0;
  color: var(--notes-muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.notes-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 0;
  overflow: hidden;
  border-radius: var(--notes-radius-xl);
  border: 1px solid var(--notes-line);
  background: rgba(252, 247, 236, 0.98);
  box-shadow: 0 26px 58px rgba(59, 41, 14, 0.14);
}

.notes-sidebar,
.notes-list-panel,
.notes-editor-panel {
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
}

.notes-sidebar {
  order: 3;
  padding: 18px;
  border-left: 1px solid rgba(133, 108, 70, 0.12);
  background: linear-gradient(180deg, rgba(248, 237, 214, 0.98), rgba(244, 232, 207, 0.96));
}

.notes-list-panel {
  padding: 18px;
  order: 2;
  border-right: 1px solid rgba(133, 108, 70, 0.12);
  background: rgba(255, 249, 237, 0.98);
}

.notes-editor-panel {
  padding: 20px;
  order: 1;
  border-right: 1px solid rgba(133, 108, 70, 0.12);
  background: rgba(255, 253, 248, 0.99);
  display: grid;
  gap: 16px;
}

.notes-sidebar-head,
.notes-list-head,
.notes-editor-head,
.notes-preview-head,
.notes-assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notes-editor-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.notes-editor-title-group {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.notes-kicker-highlight,
.notes-field-label-highlight,
.notes-preview-heading {
  color: var(--notes-highlight);
  text-align: center;
  font-weight: 900;
}

.notes-folder-list,
.notes-list {
  display: grid;
  gap: 8px;
}

.notes-folder-button,
.notes-list-card {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.notes-folder-button {
  display: grid;
  gap: 4px;
}

.notes-folder-button strong,
.notes-list-card strong {
  color: var(--notes-text);
  font-size: 0.98rem;
}

.notes-folder-button span,
.notes-list-card p {
  margin: 0;
  color: var(--notes-muted);
  line-height: 1.45;
}

.notes-folder-button.is-active,
.notes-list-card.is-active {
  border-color: rgba(223, 171, 28, 0.36);
  background: rgba(246, 197, 70, 0.16);
}

.notes-sidebar-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--notes-radius-lg);
}

.notes-search input,
.notes-tags-field input,
.notes-title-input,
.notes-body-field textarea {
  width: 100%;
  border: 1px solid rgba(133, 108, 70, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--notes-text);
  font: inherit;
}

.notes-search input,
.notes-tags-field input {
  min-height: 44px;
  padding: 10px 12px;
}

.notes-title-input {
  min-height: 64px;
  padding: 12px 16px;
  font-size: clamp(1.4rem, 2.7vw, 2rem);
  line-height: 1.08;
}

.notes-tags-field,
.notes-body-field {
  display: grid;
  gap: 8px;
}

.notes-body-field textarea {
  min-height: 320px;
  padding: 14px;
  resize: vertical;
  line-height: 1.65;
}

.notes-field-label {
  display: block;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.notes-meta-row {
  justify-content: center;
}

.notes-editor-actions {
  justify-content: center;
}

.notes-editor-actions .notes-shell-button {
  min-width: 122px;
}

.notes-list-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.notes-list-card-copy {
  font-size: 0.94rem;
}

.notes-preview-panel {
  padding: 16px;
  border-radius: var(--notes-radius-lg);
  background: rgba(250, 244, 231, 0.96);
}

.notes-preview-head {
  justify-content: center;
  text-align: center;
}

.notes-preview-heading {
  font-size: 2rem;
}

.notes-preview-copy {
  color: var(--notes-highlight);
  font-weight: 800;
  text-align: center;
}

.notes-preview {
  display: grid;
  gap: 12px;
  color: var(--notes-text);
  line-height: 1.65;
}

.notes-preview h4 {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.08rem;
}

.notes-preview p,
.notes-preview ul,
.notes-preview ol {
  margin: 0;
}

.notes-preview > p:only-child {
  text-align: center;
}

.notes-preview ul,
.notes-preview ol {
  padding-left: 20px;
}

.notes-preview-checklist {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 8px;
}

.notes-preview-checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notes-preview-checklist input {
  margin-top: 4px;
}

.notes-assistant-shell {
  display: grid;
  gap: 14px;
}

.notes-assistant-shell[hidden] {
  display: none !important;
}

.notes-assistant-shell.is-docked {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: var(--notes-radius-lg);
  border: 1px solid var(--notes-line);
  background:
    radial-gradient(circle at top right, rgba(246, 197, 70, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 249, 236, 0.98), rgba(247, 237, 216, 0.98));
  box-shadow: 0 20px 44px rgba(59, 41, 14, 0.12);
}

.notes-assistant-shell.is-docked .notes-assistant-head {
  justify-content: center;
  text-align: center;
}

.notes-assistant-shell.is-docked .notes-assistant-head > div {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.notes-assistant-shell.is-docked #notesAssistantClose {
  margin-left: auto;
}

.notes-assistant-panel {
  display: grid;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.notes-assistant-frame {
  width: 100%;
  min-height: 360px;
  height: min(58vh, 520px);
  border: 1px solid rgba(133, 108, 70, 0.24);
  border-radius: 20px;
  background: #08131d;
}

.notes-shell button:focus-visible,
.notes-shell input:focus-visible,
.notes-shell textarea:focus-visible,
.notes-folder-button:focus-visible,
.notes-list-card:focus-visible,
.notes-icon-button:focus-visible {
  outline: 2px solid rgba(223, 171, 28, 0.72);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .notes-hero,
  .notes-shell {
    grid-template-columns: 1fr;
  }

  .notes-must-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-sidebar,
  .notes-list-panel,
  .notes-editor-panel {
    border-left: 0;
    border-right: 0;
  }

  .notes-sidebar,
  .notes-list-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(133, 108, 70, 0.12);
  }

  .notes-list-panel {
    order: 2;
  }

  .notes-editor-panel {
    order: 3;
  }
}

@media (max-width: 760px) {
  .notes-hero,
  .notes-must-grid,
  .notes-sidebar,
  .notes-list-panel,
  .notes-editor-panel {
    border-radius: 22px;
  }

  .notes-must-list {
    grid-template-columns: 1fr;
  }

  .notes-hero,
  .notes-main {
    gap: 14px;
  }

  .notes-hero,
  .notes-must-grid {
    padding: 16px;
  }

  .notes-sidebar,
  .notes-list-panel,
  .notes-editor-panel {
    padding: 16px;
  }

  .notes-list-head,
  .notes-editor-head,
  .notes-assistant-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .notes-editor-head {
    grid-template-columns: 1fr;
  }

  .notes-editor-actions {
    width: 100%;
  }

  .notes-editor-actions .notes-shell-button {
    width: 100%;
  }

  .notes-hero h1 {
    max-width: none;
  }

  .notes-shell-button,
  .notes-hero-actions .btn,
  .notes-hero-actions .btn.secondary {
    width: 100%;
  }

  .notes-assistant-frame {
    min-height: 300px;
    height: min(54vh, 460px);
  }
}
