:root {
  color-scheme: light;
  --ink: #18201c;
  --muted: #66706a;
  --paper: #fffdf7;
  --surface: #f7efe1;
  --line: #ded2bf;
  --accent: #2f6f5e;
  --accent-dark: #214f43;
  --rose: #c46b5c;
  --shadow: 0 22px 70px rgba(56, 42, 24, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 111, 94, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(196, 107, 92, 0.18), transparent 38%),
    var(--paper);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.25fr);
  gap: 24px;
  align-items: stretch;
  padding: 40px 0;
}

.composer-panel,
.notes-panel {
  border: 1px solid rgba(222, 210, 191, 0.85);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.composer-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 32px;
}

.notes-panel {
  padding: 28px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 9vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.subtitle {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.note-form {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 210px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #fffaf0;
  line-height: 1.5;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 111, 94, 0.13);
}

.form-actions,
.notes-header,
.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#char-count {
  color: var(--muted);
  font-size: 0.9rem;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary,
.icon-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
}

.secondary:hover,
.icon-button:hover {
  color: white;
  border-color: var(--rose);
  background: var(--rose);
}

.notes-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.notes-list {
  display: grid;
  max-height: calc(100vh - 168px);
  margin: 0;
  padding: 0 4px 0 0;
  gap: 14px;
  overflow: auto;
  list-style: none;
}

.note-card {
  border: 1px solid rgba(222, 210, 191, 0.9);
  border-radius: 8px;
  padding: 18px;
  background: #fffaf0;
}

.note-meta {
  margin-bottom: 14px;
}

time {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.icon-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.note-card p {
  margin-bottom: 0;
  color: #29332e;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.72);
}

.empty-state strong {
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .composer-panel,
  .notes-panel {
    padding: 22px;
  }

  h1 {
    max-width: none;
    font-size: 3.4rem;
  }

  .notes-list {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .form-actions,
  .notes-header {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }

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

  .icon-button {
    width: auto;
  }
}
