:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-2: #0f1629;
  --panel: rgba(14, 20, 37, 0.88);
  --panel-2: rgba(18, 26, 47, 0.92);
  --ink: #ecf2ff;
  --muted: #8f9bb8;
  --line: rgba(132, 152, 196, 0.2);
  --accent: #5ab7ff;
  --accent-2: #7bf0c8;
  --danger: #ff6f83;
  --user: linear-gradient(135deg, #163b70, #204a87);
  --assistant: linear-gradient(135deg, #152238, #1a2942);
  --progress: linear-gradient(90deg, #67c6ff, #7bf0c8);
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(70, 140, 255, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(54, 206, 162, 0.18), transparent 32%),
    linear-gradient(145deg, var(--bg), #090f1d 40%, var(--bg-2));
  color: var(--ink);
}
button, input, textarea { font: inherit; }
button {
  cursor: pointer;
  border: 0;
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, var(--accent), #3f8cff);
  color: #061120;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(48, 113, 255, 0.24);
}
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.danger { color: var(--danger); border-color: rgba(255, 111, 131, 0.35); }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: rgba(9, 14, 28, 0.88);
  color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid rgba(90, 183, 255, 0.25); border-color: rgba(90, 183, 255, 0.45); }
textarea { resize: vertical; min-height: 92px; }
label { display: block; margin-bottom: 0.45rem; font-weight: 600; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 340px 1fr; }
.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(6, 10, 22, 0.78);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.hero-block { display: grid; gap: 10px; }
.panel { padding: 28px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.73rem;
  color: var(--accent-2);
  margin: 0;
}
h1 { margin: 0; font-size: 2.05rem; }
h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.card, .status-card, .progress-card, .composer, .message {
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}
.card {
  max-width: 560px;
  background: var(--panel);
  border-radius: 28px;
  padding: 24px;
}
.card form { display: grid; gap: 14px; margin-top: 20px; }
.inline-actions { display: flex; gap: 12px; justify-content: flex-end; }
.status-card, .progress-card {
  display: grid;
  gap: 12px;
  background: var(--panel-2);
  border-radius: 22px;
  padding: 18px;
}
.progress-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.progress-track {
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: rgba(125, 153, 209, 0.16);
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--progress);
  transition: width 0.5s ease;
}
.eta { color: var(--accent-2); font-size: 0.88rem; white-space: nowrap; }
.label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.sidebar-actions, .action-stack { display: grid; gap: 10px; }
.chat { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 56px); gap: 18px; }
.messages {
  overflow: auto;
  padding-right: 8px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(12, 17, 31, 0.65);
}
.message {
  max-width: 900px;
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(15, 21, 38, 0.94);
}
.message.user { background: var(--user); margin-left: auto; }
.message.assistant { background: var(--assistant); }
.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.message .text { margin: 0; white-space: pre-wrap; line-height: 1.6; }
.message-attachments, .attachment-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.attachment-tag, .attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 18, 33, 0.7);
  color: var(--ink);
  padding: 0.42rem 0.72rem;
  font-size: 0.85rem;
}
.attachment-chip { cursor: pointer; }
.composer {
  background: rgba(10, 15, 27, 0.9);
  border-radius: 24px;
  padding: 16px;
  backdrop-filter: blur(14px);
}
.composer-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.composer-tools, .composer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .panel { padding: 16px; }
  .chat { height: auto; min-height: calc(100vh - 320px); }
  .composer-footer, .progress-head, .composer-tools, .composer-right, .inline-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
