:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --text: #1f2933;
  --muted: #687382;
  --line: #d7dde4;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #e5f4f1;
  --danger: #b42318;
  --danger-soft: #fff1ee;
  --shadow: 0 16px 42px rgba(31, 41, 51, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.11), transparent 34%),
    linear-gradient(225deg, rgba(180, 35, 24, 0.07), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.app {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  width: min(1180px, calc(100% - 32px));
  min-height: min(760px, calc(100vh - 32px));
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid rgba(215, 221, 228, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: var(--panel-muted);
  padding: 22px;
}

.brand__eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
}

.button--primary {
  background: var(--accent);
  color: #ffffff;
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.button--danger {
  min-width: 76px;
  border-color: rgba(180, 35, 24, 0.22);
  background: var(--danger-soft);
  color: var(--danger);
}

.button--danger:hover,
.button--danger:focus-visible {
  border-color: rgba(180, 35, 24, 0.45);
  outline: none;
}

.note-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.note-list__empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.note-item {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.note-item:hover,
.note-item:focus-visible,
.note-item[data-active="true"] {
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--accent-soft);
  outline: none;
}

.note-item__title {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-item__date {
  color: var(--muted);
  font-size: 0.8rem;
}

.editor {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 26px;
}

.editor__toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.status {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 0.94rem;
  font-weight: 800;
}

.saved-at {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.field--body {
  min-height: 0;
  flex: 1;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.field input {
  height: 48px;
  padding: 0 14px;
}

.field textarea {
  min-height: 360px;
  height: 100%;
  padding: 14px;
  line-height: 1.65;
  resize: none;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(15, 118, 110, 0.7);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
    width: min(100% - 20px, 680px);
    min-height: calc(100vh - 20px);
    margin: 10px auto;
  }

  .sidebar {
    max-height: 270px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor {
    padding: 20px;
  }

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

  .button--danger {
    width: 100%;
  }

  .field textarea {
    min-height: 300px;
  }
}
