:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #ffffff;
  --ink: #242424;
  --muted: #76736d;
  --line: #ddd8ce;
  --accent: #276ef1;
  --accent-dark: #1657c8;
  --danger: #d33f49;
  --shadow: 0 14px 35px rgba(31, 29, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Noto Sans KR", sans-serif;
  background: linear-gradient(135deg, rgba(39, 110, 241, 0.12), transparent 34%), linear-gradient(315deg, rgba(29, 167, 126, 0.13), transparent 36%), var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

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

.title {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.status {
  min-width: 126px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.sidebar,
.editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.sidebar {
  overflow: hidden;
}

.search-wrap {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.search {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.search:focus,
.title-input:focus,
.memo-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 110, 241, 0.15);
}

.note-list {
  display: grid;
  gap: 8px;
  max-height: 590px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  list-style: none;
}

.note-item {
  width: 100%;
  min-height: 86px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.note-item:hover,
.note-item.active {
  border-color: var(--line);
  background: #fff;
}

.note-name {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-preview {
  display: -webkit-box;
  min-height: 36px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty {
  padding: 30px 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.editor {
  padding: 18px;
}

.editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.btn:hover {
  border-color: #b9b2a5;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.btn.danger {
  color: var(--danger);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.title-input {
  width: 100%;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}

.memo-input {
  width: 100%;
  min-height: 410px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ink);
  line-height: 1.6;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 22px, 1120px);
    padding: 24px 0;
  }

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

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

  .note-list {
    max-height: 280px;
  }

  .editor-actions,
  .meta {
    flex-direction: column;
  }

  .btn {
    flex: 1 1 auto;
  }

  .memo-input {
    min-height: 330px;
  }
}
