:root {
  --bg: #14161a;
  --panel: #1e2127;
  --border: #2a2e36;
  --text: #eee;
  --muted: #9aa0aa;
  --accent: #4a7cff;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

.login-box {
  max-width: 360px;
  margin: 20vh auto;
  background: var(--panel);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
}

.login-box h1 { margin: 0 0 1rem; font-size: 1.2rem; }

a.primary, button.primary {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
}

.err { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; margin-bottom: 0.5rem; }

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

header h1 { font-size: 1.1rem; margin: 0; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

#tabbar {
  display: flex;
  border-bottom: 1px solid var(--border);
}

#tabbar button {
  flex: 1;
  padding: 0.8rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

#tabbar button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

main { padding: 1rem; max-width: 900px; margin: 0 auto; }

.card {
  background: var(--panel);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.card img { max-width: 100%; border-radius: 8px; margin-bottom: 0.5rem; }

.card .caption { white-space: pre-wrap; margin-bottom: 0.5rem; }

.card .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }

.card .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.card .actions button, .card .actions input[type="date"] {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}

.card .actions button.danger { border-color: var(--danger); color: var(--danger); }

.error-banner {
  background: #3a1f1f;
  color: var(--danger);
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  min-height: 100px;
}

.calendar-day .day-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; }

.calendar-day .post-chip {
  display: block;
  font-size: 0.75rem;
  background: var(--bg);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  margin-bottom: 0.2rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
