* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  padding: 20px;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.container {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

h1 {
  font-size: 1.4rem;
  color: #1a1a2e;
  margin-bottom: 10px;
}

.description {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.instructions {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 0.9rem;
  color: #333;
}

.instructions ol {
  margin: 8px 0 0 20px;
}

.instructions li {
  margin-bottom: 6px;
}

.instructions.warning {
  background: #fff3cd;
  border-color: #ffc107;
}

button {
  background: #e63946;
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover:not(:disabled) {
  background: #c1121f;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button.subscribed {
  background: #2a9d8f;
}

button.subscribed:hover {
  background: #2a9d8f;
  cursor: default;
}

.status {
  margin-top: 14px;
  font-size: 0.85rem;
  color: #777;
  min-height: 1.2em;
}

.status.error { color: #e63946; }
.status.success { color: #2a9d8f; }

/* --- Logs Section --- */

.logs-container {
  text-align: left;
  padding: 24px;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.logs-header h2 {
  font-size: 1.1rem;
  color: #1a1a2e;
}

.logs-stats {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  color: #888;
}

.logs-stats strong {
  color: #2a9d8f;
}

.logs-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 6px;
  background: #457b9d;
}

.btn-small:hover:not(:disabled) {
  background: #3a6a88;
}

.auto-label {
  font-size: 0.8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.auto-label input {
  accent-color: #2a9d8f;
}

#logs {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}

.log-entry {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 0.78rem;
  line-height: 1.5;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry:hover {
  background: #f0f0f0;
}

.log-time {
  color: #999;
  white-space: nowrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
}

.log-type {
  font-weight: 700;
  font-size: 0.72rem;
  min-width: 65px;
  white-space: nowrap;
}

.log-type.ALERT { color: #e63946; }
.log-type.GATE { color: #2a9d8f; }
.log-type.PUSH { color: #e9c46a; }
.log-type.EMAIL { color: #f4a261; }
.log-type.SUBSCRIBE { color: #48bfe3; }
.log-type.SERVER { color: #457b9d; }
.log-type.CLEANUP { color: #888; }

.log-msg {
  color: #444;
  word-break: break-word;
  font-size: 0.78rem;
}

.log-empty {
  text-align: center;
  padding: 30px 20px;
  color: #aaa;
  font-size: 0.85rem;
}
