:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1b1b1f;
  --muted: #6b6b73;
  --line: #e2e0da;
  --accent: #1b1b1f;
  --accent-text: #ffffff;
  --online: #2fa84f;
  --danger: #c0392b;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1d1d21;
    --text: #f1f0ec;
    --muted: #9a9aa2;
    --line: #2e2e34;
    --accent: #f1f0ec;
    --accent-text: #121214;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.35s ease, color 0.35s ease;
}
[hidden] { display: none !important; }

/* One phone-sized column; on a computer it just sits in the middle. */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}
.screen > .bottom { margin-top: auto; display: grid; gap: 10px; padding-top: 20px; }

.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 15px; color: var(--muted); margin: 0 0 28px; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 28px; }

label.field { display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
input[type=text] {
  font: inherit;
  font-size: 18px; /* >= 16px stops iOS zooming in */
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  width: 100%;
  outline: none;
}
input[type=text]:focus { border-color: var(--text); }

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  width: 100%;
  border-radius: var(--radius);
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.btn.secondary { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.link { background: transparent; color: var(--muted); min-height: 44px; font-weight: 500; font-size: 16px; }

.linkbox {
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.error { color: var(--danger); font-size: 15px; min-height: 1.4em; margin: 10px 0 0; }
.center { margin: auto 0; text-align: center; }

.entry { display: grid; gap: 10px; }
.entry:empty { display: none; }
.entry-note { margin: 0; font-size: 14px; color: var(--muted); }
.entry-done { margin: 0; font-size: 15px; font-weight: 600; }
.entry-done .tick { color: var(--online); }
.entry-done span:last-child { color: var(--muted); font-weight: 400; }
.entry-problem { font-size: 14px; border-left: 3px solid var(--danger); padding: 2px 0 2px 12px; }
.entry-problem b { color: var(--danger); }
.entry-problem p { margin: 4px 0 0; color: var(--muted); }
