* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
}
nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #111;
}
nav a { color: #ddd; text-decoration: none; }
nav a:hover { color: #fff; }
nav .brand { font-weight: 700; color: #fff; margin-right: 1rem; }
main { max-width: 640px; margin: 1.5rem auto; padding: 0 1rem; }
h1 { font-size: 1.4rem; }

.tweet {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
}
.tweet header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.tweet .user { font-weight: 600; color: #111; text-decoration: none; }
.tweet time { color: #888; }
.tweet .text { margin: 0.3rem 0; white-space: pre-wrap; word-wrap: break-word; }
.tweet footer { font-size: 0.8rem; }
.tweet footer a { color: #1d9bf0; text-decoration: none; }
.media { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.media img, .media video {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
}

.add-form { display: flex; gap: 0.5rem; margin-bottom: 1.2rem; }
.add-form input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
button {
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 6px;
  background: #1d9bf0;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}
button:hover { opacity: 0.9; }
button.danger { background: #d33; }
button.toggle { min-width: 3.2rem; }
button.toggle.on { background: #2da44e; }
button.toggle.off { background: #999; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid #eee; }
th { background: #fafafa; font-size: 0.85rem; color: #555; }
td form { margin: 0; }

.empty { color: #777; }
.login { max-width: 320px; margin: 15vh auto; text-align: center; }
.login form { text-align: left; }
.error {
  background: #fde8e8;
  color: #a00;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
}
.pager { display: flex; justify-content: space-between; margin: 1rem 0 2rem; }
.pager a { color: #1d9bf0; text-decoration: none; }
