/* ORBITCODE LAB — Notes editor edge + responsive layout fix (V10) */
.notes-page-v10 {
  width: min(100%, 1680px);
  max-width: 1680px;
}

.notes-page-heading-v10 {
  gap: 1rem;
}

.notes-workspace-v10 {
  width: 100%;
  min-width: 0;
  min-height: min(72vh, 860px);
  height: min(72vh, 860px) !important;
  align-items: stretch;
}

.notes-sidebar-v10 {
  flex: 0 0 clamp(260px, 26vw, 360px);
  width: auto !important;
  min-width: 0;
  min-height: 0;
}

.notes-list-v10 {
  min-height: 0;
  scrollbar-gutter: stable;
  padding-bottom: .25rem;
}

.notes-editor-column-v10 {
  min-width: 0;
  min-height: 0;
  display: flex;
}

.notes-editor-card-v10 {
  --notes-edge: hsl(var(--primary) / .72);
  --notes-border: hsl(var(--border) / .95);
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--notes-border) !important;
  border-radius: 1.15rem !important;
  background:
    linear-gradient(180deg, hsl(var(--card) / .98), hsl(var(--background) / .97)) padding-box,
    linear-gradient(135deg, var(--notes-edge), hsl(var(--border) / .72) 48%, hsl(var(--primary) / .28)) border-box !important;
  box-shadow:
    inset 0 0 0 1px hsl(var(--foreground) / .035),
    inset 0 -1px 0 hsl(var(--primary) / .14),
    0 18px 60px hsl(220 70% 2% / .34),
    0 0 0 1px hsl(var(--primary) / .06) !important;
}

.notes-editor-card-v10::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px hsl(var(--primary) / .22);
}

.notes-editor-card-v10::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 1.25rem;
  right: 1.25rem;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, hsl(var(--primary) / .85), transparent);
  filter: drop-shadow(0 0 8px hsl(var(--primary) / .45));
  pointer-events: none;
}

.notes-editor-header-v10 {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  gap: .75rem;
  min-width: 0;
  padding: 1rem 1.15rem !important;
  border-bottom: 1px solid hsl(var(--border) / .82);
  background: linear-gradient(180deg, hsl(var(--card) / .98), hsl(var(--muted) / .36));
}

.notes-title-input-v10 {
  min-width: 0;
  width: 100%;
  height: 2.75rem !important;
  padding-inline: .75rem !important;
  border: 1px solid hsl(var(--border) / .55) !important;
  border-radius: .75rem !important;
  background: hsl(var(--background) / .54) !important;
  color: hsl(var(--foreground)) !important;
  box-shadow: inset 0 1px 0 hsl(var(--foreground) / .035);
}

.notes-title-input-v10:focus {
  border-color: hsl(var(--primary) / .82) !important;
  box-shadow: 0 0 0 3px hsl(var(--primary) / .12) !important;
}

.notes-editor-actions-v10 {
  flex: 0 0 auto;
  align-items: center;
  padding: .2rem;
  border: 1px solid hsl(var(--border) / .5);
  border-radius: .8rem;
  background: hsl(var(--background) / .42);
}

.notes-editor-actions-v10 > button {
  border-radius: .6rem !important;
}

.notes-editor-content-v10 {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow: hidden;
  padding: 1px !important;
  background: linear-gradient(180deg, hsl(var(--primary) / .14), transparent 18%) !important;
}

.notes-editor-textarea-v10 {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  margin: 0;
  padding: clamp(1rem, 2.1vw, 2rem) !important;
  border: 0 !important;
  border-radius: 0 0 calc(1.15rem - 2px) calc(1.15rem - 2px) !important;
  outline: 0 !important;
  background:
    radial-gradient(circle at 96% 2%, hsl(var(--primary) / .055), transparent 22rem),
    hsl(var(--background) / .95) !important;
  color: hsl(var(--foreground)) !important;
  line-height: 1.72;
  caret-color: hsl(var(--primary));
  box-shadow:
    inset 0 0 0 1px hsl(var(--border) / .18),
    inset 0 -1px 0 hsl(var(--border) / .5) !important;
}

.notes-editor-textarea-v10::placeholder {
  color: hsl(var(--muted-foreground) / .74);
}

.notes-empty-v10 {
  width: 100%;
  min-height: 320px;
  border-radius: 1.15rem !important;
  border-color: hsl(var(--primary) / .36) !important;
  background: linear-gradient(145deg, hsl(var(--card) / .7), hsl(var(--primary) / .035));
}

/* Light and system-light retain a clear edge without becoming harsh. */
html.light .notes-editor-card-v10,
html.system[data-resolved-theme="light"] .notes-editor-card-v10 {
  --notes-border: hsl(210 32% 68% / .92);
  box-shadow:
    inset 0 0 0 1px hsl(210 45% 20% / .04),
    0 18px 48px hsl(210 45% 25% / .14),
    0 0 0 1px hsl(var(--primary) / .08) !important;
}

html.light .notes-editor-textarea-v10,
html.system[data-resolved-theme="light"] .notes-editor-textarea-v10 {
  background:
    radial-gradient(circle at 96% 2%, hsl(var(--primary) / .07), transparent 22rem),
    hsl(0 0% 100% / .94) !important;
}

@media (max-width: 900px) {
  .notes-page-v10 {
    padding-inline: max(.85rem, env(safe-area-inset-left)) max(.85rem, env(safe-area-inset-right)) !important;
  }

  .notes-page-heading-v10 {
    align-items: stretch !important;
    flex-direction: column;
  }

  .notes-page-heading-v10 > button {
    width: 100%;
  }

  .notes-workspace-v10 {
    height: auto !important;
    min-height: 0;
    flex-direction: column;
    gap: 1rem !important;
  }

  .notes-sidebar-v10 {
    flex-basis: auto;
    width: 100% !important;
  }

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

  .notes-editor-column-v10 {
    width: 100%;
    min-height: min(64vh, 680px);
  }

  .notes-editor-card-v10 {
    min-height: min(64vh, 680px);
  }

  .notes-editor-header-v10 {
    align-items: stretch !important;
    flex-wrap: wrap;
  }

  .notes-title-input-v10 {
    flex: 1 1 100%;
  }

  .notes-editor-actions-v10 {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .notes-page-v10 {
    padding-top: 5.5rem !important;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important;
  }

  .notes-page-heading-v10 h1 {
    font-size: 1.8rem !important;
  }

  .notes-editor-column-v10,
  .notes-editor-card-v10 {
    min-height: 62vh;
  }

  .notes-editor-header-v10 {
    padding: .8rem !important;
  }

  .notes-editor-textarea-v10 {
    min-height: 48vh;
    padding: 1rem !important;
    font-size: 1rem !important;
  }
}
