:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --ink: #1b1b1d;
  --muted: #6d6a63;
  --line: #d9d5ca;
  --panel: #ffffff;
  --accent: #235f64;
  --accent-strong: #174448;
  --warn: #9c4d1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.entry-panel,
.daily-plan,
.settings,
.entries {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.daily-plan {
  border-color: #b6c7c9;
}

.daily-plan p {
  margin-top: 8px;
  line-height: 1.4;
}

.metric {
  color: var(--muted);
  font-size: 14px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
}

textarea,
input {
  padding: 12px;
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

select {
  min-height: 44px;
  padding: 0 10px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

button:active {
  background: var(--accent-strong);
}

summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

details label,
details input,
details button {
  margin-top: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

#entryCount {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

ol {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.entry-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.entry-kind {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  text-transform: capitalize;
}

.entry-note {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.error {
  color: var(--warn);
}

@media (max-width: 420px) {
  .shell {
    padding: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
