.profile-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-note-list {
  display: grid;
  gap: 10px;
}

.profile-note-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}

.profile-note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-note-item p {
  margin: 8px 0;
  white-space: pre-wrap;
}

.profile-note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notes-fab {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 90;
  width: 62px;
  height: 62px;
  padding: 0;
  border: none;
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.14) 24%, transparent 25%),
    linear-gradient(160deg, #f97316, #fb923c 45%, #facc15 100%);
  color: #fff7ed;
  box-shadow: 0 18px 30px rgba(249, 115, 22, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.notes-fab:hover,
.notes-fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 34px rgba(249, 115, 22, 0.34);
}

.notes-fab-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notes-fab svg {
  width: 100%;
  height: 100%;
}

.notes-modal-card {
  width: min(1120px, 96vw);
}

.notes-modal-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.notes-list-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 68vh;
  overflow: auto;
}

.notes-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.notes-new-button {
  width: 100%;
}

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

.notes-list-item {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.notes-list-item.is-active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.18);
}

body.theme-dark .notes-list-item {
  background: #0b1220;
}

.notes-list-item span,
.notes-list-item small,
.notes-empty {
  color: var(--muted);
  font-size: 12px;
}

.notes-editor-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

.notes-editor-panel form {
  display: grid;
  gap: 10px;
}

.notes-editor-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.notes-context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notes-pin-group {
  display: flex;
  align-items: end;
}

.notes-draw-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.88)),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 42%);
}

.notes-draw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.notes-draw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notes-draw-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.notes-draw-control {
  display: grid;
  gap: 6px;
}

.notes-draw-control-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.notes-draw-palette,
.notes-draw-widths,
.notes-draw-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-draw-swatch,
.notes-draw-width,
.notes-draw-zoom-btn {
  border: 1px solid var(--border);
  background: var(--card-strong);
  color: var(--ink);
  border-radius: 12px;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.notes-draw-swatch {
  position: relative;
  width: 38px;
  padding: 0;
}

.notes-draw-swatch::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--notes-draw-swatch, #111827);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.notes-draw-color-picker {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-strong);
}

.notes-draw-color-picker input[type="color"] {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.notes-draw-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.notes-draw-color-picker input[type="color"]::-webkit-color-swatch {
  border: none;
}

.notes-draw-color-picker input[type="color"]::-moz-color-swatch {
  border: none;
}

.notes-draw-swatch.is-active,
.notes-draw-width.is-active,
.notes-draw-zoom-btn:focus-visible,
.notes-draw-swatch:focus-visible,
.notes-draw-width:focus-visible,
.notes-draw-color-picker:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  outline: none;
}

.notes-draw-widths input[type="range"] {
  flex: 1 1 140px;
  min-width: 120px;
}

.notes-draw-width-label,
.notes-draw-zoom-label {
  min-width: 52px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.notes-draw-control-zoom {
  justify-self: end;
}

.notes-draw-viewport {
  min-height: 320px;
  max-height: min(56vh, 520px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    #e5e7eb;
  background-size: 24px 24px;
}

.notes-draw-surface {
  width: max-content;
  min-width: 100%;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  align-content: start;
}

.notes-draw-wrap canvas {
  display: block;
  width: 1400px;
  height: 900px;
  max-width: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.14);
  touch-action: none;
  cursor: crosshair;
}

body.theme-dark .notes-draw-wrap {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78)),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 42%);
}

body.theme-dark .notes-draw-viewport {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    #0f172a;
}

.notes-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-editor-status {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.notes-editor-status.is-error {
  color: #dc2626;
}

@media (max-width: 920px) {
  .notes-modal-layout {
    grid-template-columns: 1fr;
  }

  .notes-list-panel {
    max-height: 32vh;
  }

  .notes-draw-toolbar {
    grid-template-columns: 1fr;
  }

  .notes-draw-control-zoom {
    justify-self: stretch;
  }
}

@media (max-width: 640px) {
  .notes-context-grid,
  .notes-editor-head,
  .notes-filter-row {
    grid-template-columns: 1fr;
  }

  .notes-fab {
    right: 12px;
    bottom: 74px;
  }

  .notes-draw-viewport {
    min-height: 260px;
    padding: 8px;
  }

  .notes-draw-swatch,
  .notes-draw-width,
  .notes-draw-zoom-btn,
  .notes-draw-color-picker {
    min-width: 34px;
    height: 34px;
  }
}
