:root {
  --bg: #0d1017; --panel: #151a24; --panel2: #1b2130; --line: #2a3242;
  --text: #e6e9f0; --muted: #8b93a7; --accent: #4c8dff; --green: #2fbf71; --red: #e5484d;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); }
.muted { color: var(--muted); }
button { cursor: pointer; font: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--accent); color: #fff; padding: 8px 14px; }
button.ghost { background: transparent; color: var(--muted); }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
a { color: var(--accent); }

/* Логин */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 320px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 20px; }
.login-card p { margin: 0; }
.login-card input { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text); }
.login-card .err, .err { color: var(--red); font-size: 13px; min-height: 16px; }

/* Приложение */
.tt-app { display: flex; height: 100vh; }
.tt-side { width: 260px; flex: 0 0 260px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px; gap: 10px; }
.tt-brand { font-weight: 600; font-size: 16px; }
.tt-user { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.tt-side-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 8px; }
.tt-projects { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.tt-proj { text-align: left; background: var(--panel2); border: 1px solid var(--line); color: var(--text); }
.tt-proj.active { border-color: var(--accent); background: #1d2740; }

.tt-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tt-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tt-proj-name { font-size: 18px; font-weight: 600; }
.tt-proj-url { font-size: 13px; margin-top: 2px; }
.tt-empty { color: var(--muted); }

.tt-tasks { flex: 1; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.tt-task { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tt-task.done { border-left: 3px solid var(--green); }
.tt-task.running { border-left: 3px solid var(--accent); }
.tt-task.queued { border-left: 3px solid var(--muted); }
.tt-task.error { border-left: 3px solid var(--red); }
.tt-task-prompt { white-space: pre-wrap; word-break: break-word; }
.tt-task-meta { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.tt-status.done { color: var(--green); }
.tt-status.running { color: var(--accent); }
.tt-status.error { color: var(--red); }
.tt-result { margin-top: 10px; padding: 10px; background: var(--panel2); border-radius: 8px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.tt-result.err { color: var(--red); }

.tt-compose { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.tt-compose textarea { flex: 1; resize: vertical; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 10px 12px; font: inherit; }
.tt-rate { padding: 0 20px 12px; color: var(--red); font-size: 13px; min-height: 14px; }

.blocked-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; text-align: center; }
.blocked-emoji { font-size: 64px; }
.blocked-screen h1 { color: var(--red); }

@media (max-width: 700px) {
  .tt-app { flex-direction: column; height: auto; min-height: 100vh; }
  .tt-side { width: 100%; flex: none; flex-direction: column; border-right: none; border-bottom: 1px solid var(--line); }
  .tt-projects { flex-direction: row; flex-wrap: wrap; }
}
.tt-queue { white-space: nowrap; background: var(--green, #2fbf71); }
.tt-hint { padding: 6px 20px 0; color: var(--muted, #8b93a7); font-size: 12px; }
