*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-page: #171717;
  --bg-card: #222222;
  --bg-row-hover: #292929;
  --border-subtle: #303030;
  --text-primary: #e5e5e5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger-hover: #ef4444;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 14px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.editor-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-input {
  width: 100%;
  min-height: 290px;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
}

.note-input::placeholder {
  color: var(--text-secondary);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-text {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

.status-text.is-error {
  color: #f87171;
}

.save-btn {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.save-btn:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

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

.list-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.note-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.note-row:last-child {
  border-bottom: none;
}

.note-row:hover,
.note-row.is-active {
  background-color: var(--bg-row-hover);
}

.note-row.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.note-row.is-empty {
  cursor: default;
  color: var(--text-muted);
  font-size: 13.5px;
}

.note-row.is-empty:hover {
  background-color: transparent;
}

.note-text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.12s ease;
  flex-shrink: 0;
}

.note-row:hover .row-actions,
.note-row:focus-within .row-actions {
  opacity: 1;
}

.row-btn {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
}

.row-btn:hover {
  color: var(--text-primary);
}

.row-btn.is-delete:hover {
  color: var(--danger-hover);
}

@media (hover: none) {
  .row-actions {
    opacity: 0.75;
  }
}
