:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f4;
  color: #172018;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f6f7f4; color: #172018; }
a { color: #14532d; font-weight: 700; }
button, input, textarea { font: inherit; }
button { border: 0; border-radius: 8px; padding: 0.8rem 1rem; font-weight: 800; cursor: pointer; }
button:disabled { opacity: 0.55; cursor: wait; }
input, textarea {
  width: 100%;
  border: 1px solid #b8c0b3;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fff;
  color: #172018;
}
textarea { resize: vertical; }

.shell { width: min(760px, 100%); margin: 0 auto; padding: 1rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1 { font-size: 1.6rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 0.8rem; }

.logger, .login-box {
  background: #fff;
  border: 1px solid #dce2d8;
  border-radius: 8px;
  padding: 1rem;
}
.logger label, .login-box label, .settings label { display: grid; gap: 0.4rem; margin-bottom: 0.8rem; font-weight: 700; }
.primary {
  width: 100%;
  min-height: 72px;
  margin-top: 0.8rem;
  background: #166534;
  color: #fff;
  font-size: 1.25rem;
}
.secondary { width: 100%; background: #dfe8d9; color: #172018; }
.status { min-height: 1.4rem; color: #14532d; font-weight: 800; }
.last { color: #516151; margin-bottom: 0; }
.error { color: #991b1b; font-weight: 800; }

.entry {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: start;
  padding: 0.9rem 0;
  border-top: 1px solid #dce2d8;
}
.entry time { font-weight: 850; }
.entry p { margin: 0.35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry summary { cursor: pointer; font-weight: 700; color: #14532d; }
.entry form { margin-top: 0.5rem; }
.entry button { background: #e7ece3; color: #172018; padding: 0.55rem 0.75rem; }
.delete-form button { background: #fee2e2; color: #7f1d1d; }
.empty { color: #596758; }
.settings { margin: 1.5rem 0; }
.settings details { border-top: 1px solid #dce2d8; padding-top: 1rem; }
.settings form { margin: 1rem 0; }

.login-page { display: grid; place-items: center; padding: 1rem; }
.login-box { width: min(420px, 100%); }
.login-box button { width: 100%; background: #166534; color: #fff; }

@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; }
  .entry details, .entry .delete-form { width: 100%; }
  .entry button { width: 100%; }
}

@media (prefers-color-scheme: dark) {
  :root, body { background: #101510; color: #eef5ea; }
  .logger, .login-box { background: #182018; border-color: #303c30; }
  input, textarea { background: #101510; color: #eef5ea; border-color: #526052; }
  a, .entry summary, .status { color: #86efac; }
  .secondary, .entry button { background: #263226; color: #eef5ea; }
}
