:root {
  --bg: #f3f2ec;
  --paper: #fffef8;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --accent: #0f766e;
  --accent-ink: #ecfeff;
  --danger: #b42318;
  --shadow: 0 10px 26px rgba(26, 39, 54, 0.08);

  --note-default: #fffef8;
  --note-red: #fce8e6;
  --note-orange: #fef3dc;
  --note-yellow: #fff8cc;
  --note-green: #e6f4ea;
  --note-teal: #def5f1;
  --note-blue: #e8f0fe;
  --note-purple: #f3e8fd;
  --note-gray: #f1f3f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, #dae8ff 0%, transparent 24%),
    radial-gradient(circle at 95% 100%, #ffe0c7 0%, transparent 28%),
    linear-gradient(160deg, #f6f5ef 0%, #ebe9df 100%);
  min-height: 100vh;
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.hero {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
}

.hero p {
  margin: 4px 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
}

.surface {
  background: color-mix(in oklab, var(--paper) 95%, white 5%);
  border: 1px solid color-mix(in oklab, var(--line) 90%, #fff 10%);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-card {
  max-width: 460px;
  padding: 20px;
}

.stack {
  display: grid;
  gap: 10px;
}

.split {
  display: flex;
  gap: 10px;
}

.split.two > * {
  flex: 1;
}

.hidden {
  display: none;
}

label {
  font-size: 0.9rem;
  color: #3f4652;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.note-color-row {
  --current-note-color: var(--note-default);
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-color-row select {
  flex: 1;
  background: #fff;
  background: color-mix(in oklab, var(--current-note-color) 35%, white 65%);
}

.note-color-row.color-default {
  --current-note-color: var(--note-default);
}

.note-color-row.color-red {
  --current-note-color: var(--note-red);
}

.note-color-row.color-orange {
  --current-note-color: var(--note-orange);
}

.note-color-row.color-yellow {
  --current-note-color: var(--note-yellow);
}

.note-color-row.color-green {
  --current-note-color: var(--note-green);
}

.note-color-row.color-teal {
  --current-note-color: var(--note-teal);
}

.note-color-row.color-blue {
  --current-note-color: var(--note-blue);
}

.note-color-row.color-purple {
  --current-note-color: var(--note-purple);
}

.note-color-row.color-gray {
  --current-note-color: var(--note-gray);
}

.note-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--current-note-color);
  border: 1px solid color-mix(in oklab, var(--line) 70%, var(--ink) 30%);
  box-shadow: 0 1px 0 rgba(22, 41, 72, 0.12);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
}

button.secondary {
  background: #eef2f4;
  color: #27303d;
}

button.danger {
  background: #fff2f0;
  color: var(--danger);
  border: 1px solid #f3c8c2;
}

button.small {
  padding: 5px 9px;
  font-size: 0.75rem;
}

button.tiny {
  padding: 4px 8px;
  font-size: 0.72rem;
}

.helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  padding: 10px;
  align-items: center;
  position: sticky;
  top: 14px;
  z-index: 20;
}

.label-filters {
  margin-top: 12px;
  padding: 12px;
}

.label-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.label-filter-header h3 {
  margin: 0;
  font-size: 1rem;
}

.label-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.label-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.label-filter-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.label-delete-button {
  border-radius: 999px;
  min-width: 34px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.label-filter-chip {
  background: #f2f4f8;
  color: #2c3848;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid #dde3eb;
}

.label-filter-chip.active {
  background: #dff4ef;
  border-color: #8ed4c7;
  color: #0b665e;
}

.composer {
  margin-top: 14px;
  padding: 16px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
}

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

.composer.is-collapsed {
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(26, 39, 54, 0.06);
}

.composer.is-collapsed .composer-head {
  display: none;
}

.composer.is-collapsed #composer-options,
.composer.is-collapsed #title-group,
.composer.is-collapsed #labels-group,
.composer.is-collapsed .actions-row,
.composer.is-collapsed label {
  display: none;
}

.composer.is-collapsed #note-body {
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 1rem;
  resize: none;
  overflow: hidden;
  height: 44px;
}

.composer.is-collapsed #note-body:focus {
  outline: 2px solid color-mix(in oklab, var(--accent) 30%, white 70%);
  outline-offset: 2px;
}

.composer.is-expanded {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(26, 39, 54, 0.12);
}

.composer-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.badge {
  font-size: 0.72rem;
  border-radius: 999px;
  background: #ecf5ff;
  color: #115f95;
  border: 1px solid #c7def3;
  padding: 4px 9px;
  font-weight: 600;
}

.actions-row {
  justify-content: flex-start;
}

.composer-checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.composer-checklist-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.add-checklist-row {
  align-items: center;
}

.empty {
  margin: 22px 4px 0;
  color: var(--muted);
}

.board-section {
  margin-top: 20px;
}

.board-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #4d5766;
}

.notes-board {
  column-count: 3;
  column-gap: 12px;
}

.note-placeholder {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 2px dashed color-mix(in oklab, var(--line) 70%, var(--accent) 30%);
  background: rgba(255, 255, 255, 0.35);
}

.note-card {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid #d7dde7;
  box-shadow: 0 8px 18px rgba(22, 41, 72, 0.08);
  padding: 12px;
}

.note-card.is-dragging {
  opacity: 0.92;
  box-shadow: 0 20px 46px rgba(22, 41, 72, 0.22);
}

.note-card.color-default {
  background: var(--note-default);
}

.note-card.color-red {
  background: var(--note-red);
}

.note-card.color-orange {
  background: var(--note-orange);
}

.note-card.color-yellow {
  background: var(--note-yellow);
}

.note-card.color-green {
  background: var(--note-green);
}

.note-card.color-teal {
  background: var(--note-teal);
}

.note-card.color-blue {
  background: var(--note-blue);
}

.note-card.color-purple {
  background: var(--note-purple);
}

.note-card.color-gray {
  background: var(--note-gray);
}

.note-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.note-header h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.note-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.drag-handle {
  cursor: grab;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.note-content {
  margin-top: 8px;
}

.note-body {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.checklist-item span.done {
  text-decoration: line-through;
  color: #68707d;
}

.completed-toggle {
  margin-top: 8px;
}

.done-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #c4cad4;
}

.label-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.label-chip {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(64, 81, 112, 0.2);
  color: #304056;
  border-radius: 999px;
  padding: 3px 9px;
}

.note-meta {
  margin: 10px 0 0;
  color: #6a7380;
  font-size: 0.74rem;
}

@media (max-width: 960px) {
  .notes-board {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-top: 18px;
  }

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

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

  .split,
  .split.two {
    flex-direction: column;
  }

  .notes-board {
    column-count: 1;
  }

  .note-actions {
    justify-content: flex-start;
  }
}

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
  max-width: min(520px, calc(100vw - 24px));
  width: max-content;
}

.toast {
  pointer-events: auto;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(22, 27, 34, 0.92);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  line-height: 1.35;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.success {
  background: rgba(15, 118, 110, 0.92);
}

.toast.error {
  background: rgba(180, 35, 24, 0.92);
}
