:root {
  --bg: #0e1116;
  --panel: #161b22;
  --fg: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --ok: #3fb950;
  --err: #f85149;
  --warn: #d29922;
  --accent: #58a6ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.ok { color: var(--ok); }
.err { color: var(--err); }
.small { font-size: 12px; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
code {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
pre.body, pre.small {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.small { padding: 0.4rem 0.6rem; font-size: 12px; }

/* layout */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .right { display: flex; gap: 0.75rem; align-items: center; }
.container, main.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
section + section { margin-top: 2rem; }
.card {
  max-width: 420px;
  margin: 10vh auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.card h1 { margin: 0 0 0.5rem; }

/* forms */
form.stack { display: flex; flex-direction: column; gap: 0.75rem; }
form label { display: flex; flex-direction: column; gap: 0.3rem; }
input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font: inherit;
}
textarea { resize: vertical; min-height: 6rem; }
button, .link {
  background: var(--accent);
  color: #0d1117;
  border: 0;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
button.danger { background: var(--err); color: #fff; }
button.link { background: transparent; color: var(--accent); padding: 0.25rem 0.5rem; font-weight: 400; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; }
legend { padding: 0 0.4rem; color: var(--muted); }

/* tables */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
table.tbl th, table.tbl td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl th { color: var(--muted); font-weight: 600; }

/* status badges */
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 12px;
  background: var(--border);
}
.badge.st-submitted { background: #2d4f7f; }
.badge.st-classifying, .badge.st-planning, .badge.st-executing { background: #6e3a00; }
.badge.st-ready, .badge.st-approved { background: #1f6feb; color: #fff; }
.badge.st-deploying { background: #d29922; color: #1c1c1c; }
.badge.st-resolved { background: #238636; color: #fff; }
.badge.st-rejected { background: #6e7681; color: #fff; }
.badge.st-failed { background: #da3633; color: #fff; }

/* row helper */
.row { display: flex; flex-direction: row; gap: 0.75rem; align-items: center; }

/* dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: background 80ms, border-color 80ms;
  margin-top: 0.4rem;
}
.dropzone:hover, .dropzone:focus, .dropzone.drop-active {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.05);
  color: var(--fg);
  outline: none;
}
.textarea-wrap { position: relative; }

/* attachments list */
ul.att-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
ul.att-list li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--border);
}
ul.att-list li:last-child { border-bottom: 0; }

/* language picker */
.lang-picker {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 12px;
}

/* timeline */
ul.timeline { list-style: none; padding: 0; margin: 0; }
ul.timeline li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
