:root {
  --ink: #1c1b19;
  --paper: #faf8f4;
  --line: #ddd7cc;
  --accent: #3a5a40;
  --danger: #b3443f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

main {
  width: 100%;
  max-width: 560px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.header-row h1 {
  margin: 0;
}

#newBtn {
  flex: none;
  padding: 8px 14px;
}

p.sub {
  color: #6b6558;
  margin: 8px 0 28px;
  font-size: 0.9rem;
}

input,
textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.filter-input {
  margin-bottom: 16px;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

li .name {
  font-weight: 600;
}

li .time {
  color: #928c7e;
  font-size: 0.8rem;
  margin-inline-start: 8px;
}

li .msg {
  margin-top: 4px;
  white-space: pre-wrap;
  clear: both;
}

.status {
  font-size: 0.85rem;
  color: #928c7e;
  min-height: 1.2em;
}

.empty {
  color: #928c7e;
  padding: 20px 0;
}

.edit,
.del {
  float: right;
  margin-inline-start: 8px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}

.del {
  color: var(--danger);
  border-color: #e4c9c6;
}

/* Edit modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 25, 0.5);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
  display: none; /* hidden by default */
}

.overlay:not([hidden]) {
  display: flex; /* shown only when the hidden attribute is absent */
}

.modal {
  background: white;
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.modal textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-status {
  font-size: 0.85rem;
  color: var(--danger);
  min-height: 1.2em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.modal-actions button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
