* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f4f4f5;
  --text-primary: #18181b;
  --text-secondary: #71717a;
  --text-muted: #a1a1aa;
  --border: #e4e4e7;
  --border-light: #f4f4f5;
  --accent: #18181b;
  --accent-hover: #27272a;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --transition: 0.15s ease;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  margin-bottom: 32px;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.app {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

aside.panel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

main.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

#search {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

#search:hover {
  background: var(--bg-tertiary);
}

#search:focus {
  background: var(--bg-primary);
  border-color: var(--border);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.06);
}

#search::placeholder {
  color: var(--text-muted);
}

.list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;
  padding: 0 8px;
}

.item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.item:hover {
  background: var(--bg-secondary);
}

.item.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.item.active div[style*="color"] {
  color: rgba(255, 255, 255, 0.6) !important;
}

#title {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--border-light);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  background: transparent;
  letter-spacing: -0.01em;
  transition: var(--transition);
}

#title:focus {
  border-color: var(--border);
}

#title::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

#body {
  flex: 1;
  width: 100%;
  min-height: 300px;
  padding: 16px 0;
  border: none;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  resize: none;
  outline: none;
  background: transparent;
  font-family: inherit;
}

#body::placeholder {
  color: var(--text-muted);
}

.btn {
  padding: 9px 16px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: scale(0.98);
}

.ghost {
  padding: 9px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}

.ghost:active {
  transform: scale(0.98);
}

/* Scrollbar styling */
.list::-webkit-scrollbar {
  width: 6px;
}

.list::-webkit-scrollbar-track {
  background: transparent;
}

.list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .wrap {
    padding: 20px 16px;
  }

  header h1 {
    font-size: 20px;
  }

  .app {
    flex-direction: column;
    gap: 16px;
  }

  aside.panel {
    width: 100%;
  }

  .list {
    max-height: 180px;
  }

  main.panel {
    padding: 16px;
  }
}
