:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg-soft: #0a1020;
  --panel: rgba(12, 19, 34, 0.82);
  --panel-strong: #0d1627;
  --ink: #f3f8ff;
  --muted: #8ea0b9;
  --line: rgba(132, 241, 255, 0.16);
  --accent: #23d7ff;
  --accent-2: #7b61ff;
  --accent-strong: #10bfe7;
  --danger: #ff5c89;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --glow: 0 0 28px rgba(35, 215, 255, 0.24);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(35, 215, 255, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(35, 215, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 18% 10%, rgba(35, 215, 255, 0.13), transparent 26rem),
    radial-gradient(circle at 82% 2%, rgba(110, 255, 203, 0.08), transparent 25rem),
    linear-gradient(135deg, #04060b 0%, #0b111d 52%, #05070d 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(4, 7, 13, 0.86);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 28px;
  font-weight: 800;
  font-size: 1.2rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(132, 241, 255, 0.28);
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--glow);
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #a8b6cc;
  text-align: left;
}

.nav-item svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(35, 215, 255, 0.25);
  background: linear-gradient(135deg, rgba(35, 215, 255, 0.13), rgba(123, 97, 255, 0.11));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.main {
  width: min(1180px, 100%);
  padding: 34px clamp(18px, 4vw, 54px) 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 540px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(400px, 45vw);
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 19, 34, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.actis-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border-radius: var(--radius);
  padding: 0 14px;
  white-space: nowrap;
  font-weight: 820;
}

.auth-btn svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke: none;
}

.primary-auth {
  border: 1px solid rgba(35, 215, 255, 0.34);
  background: linear-gradient(135deg, rgba(35, 215, 255, 0.2), rgba(110, 255, 203, 0.12));
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(35, 215, 255, 0.14);
}

.ghost-auth {
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.05);
  color: #a8b6cc;
}

.auth-btn:hover {
  border-color: rgba(35, 215, 255, 0.48);
  color: #ffffff;
}

.search svg {
  color: var(--accent);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search input::placeholder,
.composer input::placeholder,
.composer textarea::placeholder {
  color: #60718b;
}

.composer {
  margin-bottom: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(13, 22, 39, 0.94), rgba(8, 13, 24, 0.92));
  box-shadow: var(--shadow);
}

.composer:focus-within {
  border-color: rgba(35, 215, 255, 0.42);
  box-shadow: var(--shadow), var(--glow);
}

.composer input,
.composer textarea {
  width: 100%;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--ink);
}

.composer input {
  margin-bottom: 10px;
  font-size: 1.18rem;
  font-weight: 780;
}

.composer textarea {
  min-height: 104px;
  line-height: 1.55;
}

.composer-actions,
.section-heading,
.note-footer,
.note-card-header,
.note-actions,
.swatches {
  display: flex;
  align-items: center;
}

.composer-actions {
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.swatches {
  gap: 8px;
}

.swatch {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.swatch.active {
  border-color: #eafcff;
  box-shadow: 0 0 0 3px rgba(35, 215, 255, 0.18);
}

.swatch[data-color="butter"] {
  background: #f7cf5a;
}

.swatch[data-color="mint"] {
  background: #55dda7;
}

.swatch[data-color="sky"] {
  background: #23d7ff;
}

.swatch[data-color="rose"] {
  background: #ff6da4;
}

.swatch[data-color="paper"] {
  background: #202a3d;
}

.primary-btn {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #021018;
  font-weight: 850;
  box-shadow: 0 14px 34px rgba(35, 215, 255, 0.22);
}

.primary-btn:hover {
  filter: brightness(1.08);
}

.section-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.04rem;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.92rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  align-items: start;
}

.note-card {
  min-height: 176px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: #f4f8ff;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.note-card.butter {
  background: linear-gradient(135deg, #4a3614, #19150f);
  border-color: rgba(247, 207, 90, 0.3);
}

.note-card.mint {
  background: linear-gradient(135deg, #14392f, #0b1717);
  border-color: rgba(85, 221, 167, 0.28);
}

.note-card.sky {
  background: linear-gradient(135deg, #0e3550, #091623);
  border-color: rgba(35, 215, 255, 0.32);
}

.note-card.rose {
  background: linear-gradient(135deg, #4a1d32, #171018);
  border-color: rgba(255, 109, 164, 0.28);
}

.note-card.paper {
  background: linear-gradient(135deg, #202a3d, #0d1320);
  border-color: rgba(164, 180, 210, 0.18);
}

.note-card-header {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.note-card h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.note-body {
  margin-bottom: 18px;
  color: #c7d3e6;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-footer {
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.note-footer time {
  color: #8ea0b9;
  font-size: 0.78rem;
}

.note-actions {
  gap: 4px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #d7e5f9;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  border-color: rgba(35, 215, 255, 0.32);
  background: rgba(35, 215, 255, 0.12);
  color: var(--accent);
}

.delete-btn:hover {
  border-color: rgba(255, 92, 137, 0.38);
  background: rgba(255, 92, 137, 0.14);
  color: var(--danger);
}

.note-card.pinned .pin-btn {
  border-color: rgba(255, 109, 164, 0.42);
  background: rgba(255, 109, 164, 0.16);
  color: #ff91bd;
}

.restore-btn {
  display: none;
}

.trash-view .restore-btn {
  display: grid;
}

.trash-view .archive-btn,
.trash-view .pin-btn {
  display: none;
}

.empty-state {
  margin-top: 42px;
  padding: 34px 18px;
  border: 1px dashed rgba(132, 241, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(12, 19, 34, 0.34);
  text-align: center;
  color: var(--muted);
}

.empty-state svg {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  color: var(--accent);
}

.empty-state h2 {
  margin-bottom: 6px;
  color: var(--ink);
}

.empty-state p {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px 14px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding-bottom: 12px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

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

  .nav-item {
    justify-content: flex-start;
    padding: 10px 6px;
  }

  .nav-item span {
    display: inline;
    font-size: 0.9rem;
  }

  .main {
    padding-top: 22px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .actis-auth {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .auth-btn {
    width: 100%;
  }

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