:root {
  --bg: #14171c;
  --surface: #1b1f26;
  --surface-2: #21262e;
  --border: #2a2f38;
  --text: #e8e6e1;
  --text-dim: #8b92a0;
  --text-faint: #565d6b;
  --accent: #f2a93b;
  --accent-dim: rgba(242, 169, 59, 0.14);
  --success: #6fcf97;
  --danger: #e0685a;

  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(242, 169, 59, 0.05), transparent);
}

::selection { background: var(--accent-dim); color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.console {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}

/* ---------- status bar (signature element) ---------- */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-mono);
  margin-bottom: 28px;
}

.statusbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(111, 207, 151, 0.15);
  animation: pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.dot.is-offline {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(224, 104, 90, 0.15);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
}

.statusbar-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.accent { color: var(--accent); }

.statusbar-right {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- entry form ---------- */

.entry-panel { margin-bottom: 20px; }

.entry-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.15s ease;
}

.entry-form:focus-within {
  border-color: var(--accent);
}

.prompt-glyph {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.entry-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  padding: 12px 0;
  font-family: var(--font-sans);
}

.entry-input::placeholder { color: var(--text-faint); }
.entry-input:focus { outline: none; }

.entry-date {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 8px;
  color-scheme: dark;
  flex-shrink: 0;
}

.entry-submit {
  background: var(--accent);
  color: #1b1206;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-mono);
  cursor: pointer;
  flex-shrink: 0;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.entry-submit:hover { filter: brightness(1.08); }
.entry-submit:active { transform: scale(0.97); }

/* ---------- filters ---------- */

.filters {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.filter-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.filter-tab:hover { color: var(--text); background: var(--surface); }

.filter-tab.is-active {
  color: var(--accent);
  background: var(--accent-dim);
}

.filter-clear {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 11px;
  cursor: pointer;
  padding: 6px 4px;
}

.filter-clear:hover { color: var(--danger); }

/* ---------- log / list ---------- */

.log { min-height: 80px; }

.log-empty {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 32px 0;
  margin: 0;
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 12px 12px 14px;
  animation: enter 0.18s ease;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-checkbox {
  font-family: var(--font-mono);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1.5;
  padding: 0;
  flex-shrink: 0;
  width: 24px;
  white-space: nowrap;
}

.log-checkbox:hover { color: var(--accent); }
.log-item.is-done .log-checkbox { color: var(--success); }

.log-body { flex: 1; min-width: 0; }

.log-text {
  font-size: 14.5px;
  line-height: 1.5;
  word-break: break-word;
}

.log-item.is-done .log-text {
  color: var(--text-faint);
  text-decoration: line-through;
}

.log-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

.log-meta.is-overdue { color: var(--danger); }

.log-delete {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.log-delete:hover { color: var(--danger); background: rgba(224, 104, 90, 0.1); }

/* ---------- footer ---------- */

.footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
}

.footer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.crt-noise { display: none; }

@media (max-width: 480px) {
  .console { padding: 28px 14px 48px; }
  .entry-form { flex-wrap: wrap; padding: 10px 12px; }
  .entry-date { order: 3; margin-left: 24px; }
  .entry-submit { order: 4; margin-left: auto; }
  .statusbar-right { display: none; }
}
