.nt-app {
  --bg: #16191e;
  --surface: #1f242c;
  --line: #323844;
  --text: #e6e8ec;
  --dim: #8d95a1;
  --accent: #3d8bfd;
  --user: #2c4d78;
  --code: #0e1218;
  --danger: #f07178;
  box-sizing: border-box;
  height: calc(100vh - 150px);
  height: calc(100dvh - 150px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  max-width: 98%;
  margin: 0 auto 16px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", Helvetica, Arial, sans-serif;
  border-radius: 8px;
  overflow: hidden;
}
.nt-app * { box-sizing: border-box; }
.nt-app [hidden] { display: none !important; }
.nt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.nt-head h1 { margin: 0; font-size: 18px; font-weight: 650; color: var(--text); }
.nt-head p { margin: 2px 0 0; color: var(--dim); font-size: 13px; }
.nt-app #log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.nt-app .welcome { color: var(--dim); max-width: 640px; }
.nt-app .welcome h2 { color: var(--text); font-size: 22px; margin: 8px 0; }
.nt-app .prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.nt-app .prompts button, .nt-app .attach-chip button { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer; font: inherit; }
.nt-app .prompts button:hover { border-color: var(--accent); }
.nt-app .msg { max-width: 92%; display: flex; flex-direction: column; gap: 6px; }
.nt-app .msg.user { align-self: flex-end; }
.nt-app .msg.assistant { align-self: flex-start; }
.nt-app .bubble { padding: 10px 14px; border-radius: 10px; white-space: normal; word-break: break-word; }
.nt-app .msg.user .bubble { background: var(--user); border-bottom-right-radius: 3px; }
.nt-app .msg.assistant .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.nt-app .bubble p { margin: 0 0 10px; }
.nt-app .bubble p:last-child { margin-bottom: 0; }
.nt-app .bubble pre { margin: 8px 0; background: var(--code); border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
.nt-app .bubble pre code { display: block; padding: 12px 14px; font: 13px/1.45 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre; }
.nt-app .bubble code.inline { font: 0.92em ui-monospace, Consolas, monospace; background: #ffffff14; padding: 1px 5px; border-radius: 4px; }
.nt-app .refs { font-size: 12px; color: var(--dim); }
.nt-app .code-actions { display: flex; gap: 8px; margin: 8px 0 0; }
.nt-app .copy, .nt-app .save { background: #2a3340; color: var(--text); border: 1px solid #6a7584; border-radius: 6px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.nt-app .copy:hover, .nt-app .save:hover { border-color: var(--accent); color: #fff; }
.nt-app .stop { height: 42px; border: none; border-radius: 8px; cursor: pointer; font: inherit; background: var(--danger); color: #fff; padding: 0 16px; font-weight: 600; }
.nt-app .status { color: var(--dim); font-size: 13px; font-style: italic; }
.nt-app form { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--surface); margin: 0; }
.nt-app .row { display: flex; gap: 8px; align-items: flex-end; }
.nt-app textarea { flex: 1; resize: none; min-height: 52px; max-height: 160px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.nt-app textarea:focus { outline: none; border-color: var(--accent); }
.nt-app .file-btn, .nt-app .send { height: 42px; border: none; border-radius: 8px; cursor: pointer; font: inherit; }
.nt-app .file-btn { width: 42px; background: var(--bg); color: var(--text); border: 1px solid var(--line); font-size: 18px; display: flex; align-items: center; justify-content: center; }
.nt-app .send { background: var(--accent); color: white; padding: 0 16px; font-weight: 600; }
.nt-app .send:disabled { opacity: 0.45; cursor: default; }
.nt-app .attach-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }
.nt-app .fine { font-size: 12px; color: var(--dim); padding: 0 2px 2px; }
.nt-app .error { color: var(--danger); }
.nt-gate { max-width: 560px; margin: 48px auto; padding: 0 20px; }
.nt-gate h1 { font-size: 22px; font-weight: 650; margin: 0 0 8px; color: var(--text); }
.nt-gate p { color: var(--dim); margin: 0 0 18px; }
.nt-gate a { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; border-radius: 8px; padding: 8px 14px; font-weight: 600; }
@media (max-width: 700px) {
  .nt-app { height: calc(100vh - 80px); height: calc(100dvh - 80px); min-height: 420px; border-radius: 0; max-width: 100%; }
  .nt-app .msg { max-width: 100%; }
  .nt-head { flex-direction: column; }
}
