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

:root {
  --bg: #0a0e14;
  --bg-surface: #0d1117;
  --border: #21262d;
  --text: #c9d1d9;
  --text-dim: #484f58;
  --green: #3fb950;
  --blue: #58a6ff;
  --yellow: #d29922;
  --red: #f85149;
  --cyan: #39c5cf;
  --purple: #bc8cff;
  --font: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  font-size: 13px;
  line-height: 1.6;
}

#terminal {
  width: 100%;
  max-width: 720px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
}

.term-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #161b22;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.term-title {
  flex: 1;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.term-body {
  padding: 16px 20px;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt { color: var(--green); font-weight: 700; }
.cmd { color: var(--text); }
.dim { color: var(--text-dim); font-size: 12px; }

/* ── Messages ──────────────────────────────────── */
.msg {
  margin: 8px 0;
  padding: 6px 0;
  border-top: 1px solid #161b22;
}

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-name {
  color: var(--green);
  font-weight: 600;
}

.msg-name a {
  color: var(--blue);
  text-decoration: none;
}

.msg-name a:hover {
  text-decoration: underline;
}

.msg-time {
  color: var(--text-dim);
  font-size: 11px;
}

.msg-body {
  color: var(--text);
  margin-top: 2px;
  padding-left: 2ch;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-count {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 8px;
}

/* ── Form ──────────────────────────────────────── */
#msg-form {
  margin-top: 8px;
}

.form-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
}

.form-line .label {
  color: var(--cyan);
  font-weight: 600;
  min-width: 5ch;
  padding-top: 4px;
}

.form-line input,
.form-line textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-line input:focus,
.form-line textarea:focus {
  border-color: var(--green);
}

.form-line textarea {
  resize: vertical;
  min-height: 60px;
}

.form-line input::placeholder,
.form-line textarea::placeholder {
  color: var(--text-dim);
}

#f-submit {
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

#f-submit:hover { opacity: 0.85; }
#f-submit:disabled { opacity: 0.4; cursor: not-allowed; }

#f-status.error { color: var(--red); }
#f-status.success { color: var(--green); }

@media (max-width: 600px) {
  body { padding: 0; }
  #terminal { border-radius: 0; min-height: 100vh; }
  .form-line { flex-direction: column; gap: 2px; }
  .form-line .label { padding-top: 0; }
}
