/*
 * SamGo.
 *
 * A dark console rather than a light document. The work happens in a chat and a
 * set of panels, and the thing being built is elsewhere — a live website the
 * person is watching in another tab. A dark surface keeps attention on the two
 * places that matter: the conversation, and the step list, which is the only
 * evidence of what is being done to their site.
 *
 * Colour carries meaning rather than decoration. Cyan is the system talking,
 * green is done, red is refused, and the violet-to-pink range belongs to the
 * brand mark alone so the logo reads as the one thing that is not interface.
 *
 * Every animation is suppressed under `prefers-reduced-motion`. The working bar
 * still says what is happening; it simply stops pulsing.
 */

:root {
  --bg-deep: #05080f;
  --bg: #0a101c;
  --bg-soft: #0f1725;
  --bg-raise: #131d2e;
  --line: #1c2940;
  --line-hot: #2b3f5e;

  --text: #dbe6f5;
  --text-dim: #7d8da6;
  --text-faint: #4c5c74;

  --cyan: #22d3ee;
  --violet: #a78bfa;
  --pink: #f472b6;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #f87171;

  --head: 'Archivo', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --left: 250px;
  --right: 310px;
  --radius: 4px;
}

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

html, body { height: 100%; }

body {
  font-family: var(--body);
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--cyan); }
[hidden] { display: none !important; }

::selection { background: rgba(34, 211, 238, 0.28); }

/* ---------------------------------------------------------------- backdrop */

/*
 * Three inert layers: a grid that drifts, two colour fields that breathe, and a
 * scan line crossing every few seconds. They sit behind everything and never
 * take a click.
 */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.backdrop-grid {
  position: absolute;
  /* Oversized so the drift never exposes an edge. */
  inset: -80px;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: gridDrift 24s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}

@keyframes gridDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(46px, 46px, 0); }
}

.backdrop-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }

.backdrop-glow.g1 {
  width: 640px; height: 640px; top: -280px; left: -140px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 68%);
  animation: breathe 13s ease-in-out infinite;
}

.backdrop-glow.g2 {
  width: 560px; height: 560px; bottom: -260px; right: -120px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.34), transparent 68%);
  animation: breathe 17s ease-in-out infinite reverse;
}

@keyframes breathe {
  0%, 100% { opacity: 0.34; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.12); }
}

.backdrop-scan {
  position: absolute;
  left: 0; right: 0; height: 220px;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.05), transparent);
  animation: scan 9s linear infinite;
}

@keyframes scan {
  from { transform: translateY(-240px); }
  to { transform: translateY(calc(100vh + 240px)); }
}

/* ------------------------------------------------------------------ topbar */

.top {
  position: relative;
  z-index: 5;
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(10, 16, 28, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

/* --- the mark --- */

.brand { position: relative; display: flex; align-items: center; gap: 11px; }

.brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: none;
}

.brand-mark i {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--pink), var(--amber), var(--cyan));
  animation: spin 4.5s linear infinite;
}

.brand-mark b {
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  background: var(--bg-deep);
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 12px;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--pink), var(--amber), var(--cyan));
  filter: blur(11px);
  opacity: 0.5;
  animation: spin 4.5s linear infinite;
  z-index: -1;
}

@keyframes spin { to { transform: rotate(360deg); } }

.brand-sheen {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  pointer-events: none;
}

.brand-sheen::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: sheen 5s ease-in-out infinite;
}

@keyframes sheen {
  0%, 62% { left: -50%; }
  100% { left: 130%; }
}

.brand-name {
  font-family: var(--head);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.6px;
  background: linear-gradient(92deg, var(--cyan), var(--violet) 34%, var(--pink) 56%, var(--amber) 78%, var(--cyan));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: neonShift 7s linear infinite;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.4)) drop-shadow(0 0 26px rgba(167, 139, 250, 0.28));
}

@keyframes neonShift {
  from { background-position: 0% 50%; }
  to { background-position: 300% 50%; }
}

/* --- model chip --- */

.model-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid var(--line-hot);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  transition: 0.2s var(--ease);
}

.model-chip:hover {
  border-color: var(--cyan);
  color: var(--text);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.22);
}

.m-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.m-dot.on { background: var(--green); box-shadow: 0 0 9px var(--green); animation: pulseDot 2.4s ease-in-out infinite; }
.m-dot.off { background: var(--red); box-shadow: 0 0 9px var(--red); }

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.top-right { margin-left: auto; }

.ghost {
  background: none;
  border: 1px solid var(--line-hot);
  color: var(--text-dim);
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 13px;
  transition: 0.2s var(--ease);
}

.ghost:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 16px rgba(34, 211, 238, 0.2); }

/* ------------------------------------------------------------------- shell */

.shell {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr) var(--right);
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--left) minmax(0, 1fr); }
  .col-right { display: none; }
}

@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .col-left { display: none; }
}

/* --------------------------------------------------------------- left col */

.col-left {
  border-right: 1px solid var(--line);
  background: rgba(10, 16, 28, 0.7);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.picker { padding: 13px 12px 9px; position: relative; }

.project-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(34, 211, 238, 0.05);
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: 0.2s var(--ease);
}

.project-btn:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(34, 211, 238, 0.16); }
.project-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 56px;
  z-index: 40;
  background: var(--bg-soft);
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(34, 211, 238, 0.08);
  overflow: hidden;
}

.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  transition: 0.14s var(--ease);
}

.menu button:last-child { border-bottom: none; }
.menu button:hover { background: rgba(34, 211, 238, 0.07); color: var(--text); }
.menu button.on { color: var(--cyan); font-weight: 600; }
.menu .sep { border-top: 1px solid var(--line-hot); }
.menu .danger { color: var(--red); }

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 7px;
}

.col-head h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.icon-btn {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  color: var(--text-dim);
  transition: 0.2s var(--ease);
}

.icon-btn:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.24); }

.list { flex: 1; overflow-y: auto; padding: 0 9px 16px; }

.conv {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 11px;
  margin-bottom: 3px;
  transition: 0.16s var(--ease);
  position: relative;
}

.conv:hover { background: rgba(34, 211, 238, 0.05); border-color: var(--line); }
.conv.on {
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.13), rgba(167, 139, 250, 0.09));
  border-color: rgba(34, 211, 238, 0.34);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.conv .t { font-size: 13.5px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.conv.on .t { color: var(--text); }
.conv .m { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 3px; }

.conv .x {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  padding: 2px 5px;
  transition: 0.14s var(--ease);
}

.conv:hover .x { opacity: 1; }
.conv .x:hover { color: var(--red); }

.empty-note { padding: 11px; font-size: 12.5px; color: var(--text-faint); line-height: 1.65; }

/* --------------------------------------------------------------- main col */

.col-main { display: flex; flex-direction: column; min-height: 0; position: relative; }

.task-bar {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 32px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 28, 0.55);
}

.task-title {
  font-family: var(--head);
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); margin-left: auto; white-space: nowrap; }

.messages { flex: 1; overflow-y: auto; padding: 26px 32px 8px; scroll-behavior: smooth; }

/* --- welcome --- */

.welcome { max-width: 660px; }

.welcome h2 {
  font-family: var(--head);
  font-size: 25px;
  margin-bottom: 11px;
  letter-spacing: -0.3px;
  background: linear-gradient(92deg, var(--text), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome > p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 17px; line-height: 1.7; }

.examples { display: grid; gap: 8px; margin-bottom: 20px; }

.example {
  position: relative;
  text-align: left;
  background: rgba(19, 29, 46, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-dim);
  transition: 0.2s var(--ease);
  overflow: hidden;
}

.example::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.24s var(--ease);
}

.example:hover {
  border-color: var(--line-hot);
  color: var(--text);
  transform: translateX(3px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}

.example:hover::before { transform: scaleY(1); }

.fine { font-size: 12.5px; color: var(--text-faint); line-height: 1.75; }

/* --- messages --- */

.msg { margin-bottom: 24px; max-width: 800px; animation: msgIn 0.32s var(--ease); }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(7px); }
}

.msg.user {
  margin-left: auto;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.14), rgba(167, 139, 250, 0.12));
  border: 1px solid rgba(34, 211, 238, 0.26);
  color: var(--text);
  padding: 13px 17px;
  border-radius: 12px 12px 3px 12px;
  font-size: 14.5px;
  line-height: 1.6;
  width: fit-content;
  max-width: 640px;
  white-space: pre-wrap;
  box-shadow: 0 4px 24px rgba(34, 211, 238, 0.1);
}

.msg.user .files {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(34, 211, 238, 0.2);
}

.msg.user .files span {
  font-family: var(--mono);
  font-size: 10.5px;
  background: rgba(34, 211, 238, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.24);
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--cyan);
}

.msg.agent { font-size: 14.8px; line-height: 1.8; color: #c8d6e8; }
.msg.agent p { margin-bottom: 12px; }
.msg.agent p:last-child { margin-bottom: 0; }
.msg.agent strong { font-weight: 600; color: var(--text); }

.msg.agent code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.18);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--cyan);
}

.msg.agent ul, .msg.agent ol { margin: 0 0 12px 20px; }
.msg.agent li { margin-bottom: 6px; }
.msg.agent a { color: var(--cyan); text-decoration-color: rgba(34, 211, 238, 0.4); }

.msg.error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.34);
  color: #fca5a5;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.65;
}

.msg.warn {
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: #6ee7b7;
  padding: 12px 15px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.65;
}

/* --- step list --- */

.steps {
  border-left: 2px solid transparent;
  border-image: linear-gradient(180deg, var(--cyan), var(--violet)) 1;
  padding-left: 17px;
  margin: 6px 0 20px;
  display: grid;
  gap: 9px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-faint);
  animation: stepIn 0.3s var(--ease);
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(-4px); }
}

.step .mark {
  width: 15px;
  height: 15px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-hot);
  border-top-color: var(--cyan);
  animation: spin 0.75s linear infinite;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

.step.ok .mark {
  border: none;
  animation: none;
  background: var(--green);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.55);
  position: relative;
}

.step.ok .mark::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #04120c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.step.bad .mark {
  border: none;
  animation: none;
  background: var(--red);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.5);
}

.step .path { font-family: var(--mono); font-size: 11.5px; color: var(--cyan); }
.step .note { color: var(--text-faint); font-size: 12px; }
.step.ok .label, .step.bad .label { color: var(--text-dim); }
.step.bad .label { color: #fca5a5; }

/* --- aftercare --- */

.aftercare {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-faint);
  flex-wrap: wrap;
}

.mini {
  font-size: 12.5px;
  padding: 6px 13px;
  border: 1px solid var(--line-hot);
  background: rgba(34, 211, 238, 0.06);
  border-radius: var(--radius);
  color: var(--cyan);
  transition: 0.2s var(--ease);
}

.mini:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(34, 211, 238, 0.26); }
.mini.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 0 16px rgba(248, 113, 113, 0.24); }

/* ------------------------------------------------------------ working bar */

/*
 * The step list says what has happened; this says something is still happening.
 * It sits directly above the composer so it stays in the field of view of
 * anyone watching the conversation, rather than being pinned to a corner.
 */
.working {
  flex: none;
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0 32px 12px;
  padding: 12px 16px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.09), rgba(167, 139, 250, 0.07));
  position: relative;
  overflow: hidden;
  animation: workingIn 0.3s var(--ease);
}

@keyframes workingIn {
  from { opacity: 0; transform: translateY(8px); }
}

/* A light sweeping the bar, so it reads as running rather than paused. */
.working::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; width: 34%;
  background: linear-gradient(100deg, transparent, rgba(34, 211, 238, 0.14), transparent);
  animation: sweep 2.1s linear infinite;
}

@keyframes sweep {
  from { left: -40%; }
  to { left: 110%; }
}

/* --- the miniature page being assembled --- */

.working-frame {
  flex: none;
  width: 46px;
  height: 34px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 3px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 5px 1fr 1fr;
  gap: 2px;
  background: rgba(5, 8, 15, 0.5);
}

.wf-chrome { grid-column: 1 / -1; display: flex; gap: 2px; align-items: center; }
.wf-chrome span { width: 3px; height: 3px; border-radius: 50%; background: var(--line-hot); }
.wf-chrome span:first-child { background: var(--pink); }
.wf-chrome span:nth-child(2) { background: var(--amber); }
.wf-chrome span:nth-child(3) { background: var(--green); }

/*
 * The blocks fill in sequence on a loop, each delayed by a fraction of the
 * cycle, so the frame reads as a page being laid out rather than as a spinner.
 */
.wf-line, .wf-block {
  border-radius: 1px;
  background: rgba(34, 211, 238, 0.22);
  animation: buildBlock 2s ease-in-out infinite;
}

.wf-line.wf-a { animation-delay: 0s; }
.wf-line.wf-b { animation-delay: 0.18s; }
.wf-block.wf-c { animation-delay: 0.36s; }
.wf-block.wf-d { animation-delay: 0.54s; }

@keyframes buildBlock {
  0%, 100% { background: rgba(34, 211, 238, 0.18); box-shadow: none; }
  40% { background: rgba(34, 211, 238, 0.75); box-shadow: 0 0 8px rgba(34, 211, 238, 0.7); }
}

.working-info { flex: 1; min-width: 0; }

.working-label {
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.working-detail {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 14px;
}

.working-side { flex: none; display: flex; align-items: center; gap: 12px; }

.working-time { font-family: var(--mono); font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Four bars, each rising in turn: a compact equaliser. */
.working-bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }

.working-bars i {
  width: 3px;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  animation: barJump 1.1s ease-in-out infinite;
}

.working-bars i:nth-child(1) { animation-delay: 0s; }
.working-bars i:nth-child(2) { animation-delay: 0.14s; }
.working-bars i:nth-child(3) { animation-delay: 0.28s; }
.working-bars i:nth-child(4) { animation-delay: 0.42s; }

@keyframes barJump {
  0%, 100% { height: 4px; opacity: 0.4; }
  50% { height: 16px; opacity: 1; }
}

/* ---------------------------------------------------------------- composer */

.composer-wrap { flex: none; padding: 0 32px 15px; }

.attach-strip { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 9px; }

.attach {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--cyan);
  max-width: 280px;
}

.attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach button { background: none; border: none; color: var(--text-faint); font-size: 13px; padding: 0 2px; }
.attach button:hover { color: var(--red); }
.attach.pending { opacity: 0.55; }

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(19, 29, 46, 0.8);
  border: 1px solid var(--line-hot);
  border-radius: 10px;
  padding: 9px 9px 9px 11px;
  transition: 0.22s var(--ease);
  position: relative;
}

.composer:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1), 0 0 26px rgba(34, 211, 238, 0.16);
}

.composer textarea {
  flex: 1;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--text);
  resize: none;
  max-height: 200px;
  min-height: 30px;
}

.composer textarea::placeholder { color: var(--text-faint); }
.composer textarea:focus { outline: none; }
.composer textarea:disabled { color: var(--text-faint); }

.attach-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: 0.2s var(--ease);
}

.attach-btn:hover { background: rgba(34, 211, 238, 0.1); color: var(--cyan); }

.send {
  flex: none;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 7px;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  color: #04121a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s var(--ease);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.34);
}

.send:hover:not(:disabled) { box-shadow: 0 0 30px rgba(34, 211, 238, 0.6); transform: translateY(-1px); }
.send:disabled { background: var(--line); color: var(--text-faint); box-shadow: none; cursor: default; }

.composer-hint { padding-top: 8px; font-size: 11.5px; color: var(--text-faint); }

/* --- drag overlay --- */

.drop-veil {
  position: absolute;
  inset: 12px;
  border: 2px dashed var(--cyan);
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.06);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  animation: workingIn 0.2s var(--ease);
}

.drop-veil span {
  font-family: var(--head);
  font-weight: 700;
  font-size: 17px;
  color: var(--cyan);
  background: var(--bg-deep);
  border: 1px solid rgba(34, 211, 238, 0.4);
  padding: 11px 22px;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.35);
}

/* -------------------------------------------------------------- right col */

.col-right {
  border-left: 1px solid var(--line);
  background: rgba(10, 16, 28, 0.7);
  overflow-y: auto;
  min-height: 0;
}

.panel { padding: 20px 19px 22px; border-bottom: 1px solid var(--line); }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }

.panel-head h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.panel-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.65; margin-bottom: 13px; }

.materials { display: grid; gap: 8px; margin-bottom: 13px; }

.material {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: 0.18s var(--ease);
  background: rgba(19, 29, 46, 0.5);
}

.material:hover { border-color: var(--line-hot); box-shadow: 0 0 16px rgba(0, 0, 0, 0.4); }

.material .ico {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(167, 139, 250, 0.13));
  border: 1px solid rgba(34, 211, 238, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
}

.material .body { flex: 1; min-width: 0; }
.material .nm { font-size: 12.5px; line-height: 1.45; word-break: break-word; margin-bottom: 3px; color: var(--text-dim); }
.material .meta { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.material .meta.bad { color: var(--red); }
.material .acts { flex: none; display: flex; gap: 3px; }
.material .acts button { background: none; border: none; color: var(--text-faint); padding: 2px 4px; font-size: 12px; transition: 0.16s var(--ease); }
.material .acts button:hover { color: var(--cyan); }
.material .acts button.x:hover { color: var(--red); }

.drop-zone {
  width: 100%;
  border: 1.5px dashed var(--line-hot);
  border-radius: var(--radius);
  background: rgba(34, 211, 238, 0.03);
  padding: 18px 12px;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--text-faint);
  transition: 0.2s var(--ease);
}

.drop-zone:hover, .drop-zone.over {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  box-shadow: inset 0 0 24px rgba(34, 211, 238, 0.14);
}

.drop-zone span { font-size: 12.5px; }
.drop-zone em { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }

.site-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: rgba(19, 29, 46, 0.5);
}

.site-card .url { font-family: var(--mono); font-size: 11.5px; word-break: break-all; margin-bottom: 9px; color: var(--cyan); }
.site-card .row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 7px; }
.site-card .row span:first-child { color: var(--text-faint); }
.site-card .row span:last-child { font-family: var(--mono); font-size: 11.5px; text-align: right; color: var(--text-dim); }
.site-card .ok { color: var(--green) !important; }
.site-card .bad { color: var(--red) !important; }
.site-actions { display: flex; gap: 8px; margin-top: 12px; }

.versions { display: grid; gap: 8px; }
.muted { color: var(--text-faint); font-size: 12.5px; line-height: 1.65; }

.version {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: 0.18s var(--ease);
  background: rgba(19, 29, 46, 0.4);
}

.version:hover { border-color: var(--line-hot); }
.version .when { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); margin-bottom: 4px; }
.version .what { font-size: 12.5px; line-height: 1.55; margin-bottom: 8px; word-break: break-word; color: var(--text-dim); }

.version button {
  font-size: 11.5px;
  padding: 4px 10px;
  border: 1px solid var(--line-hot);
  background: none;
  border-radius: 4px;
  color: var(--text-dim);
  transition: 0.18s var(--ease);
}

.version button:hover { border-color: var(--red); color: var(--red); }
.version button:disabled { opacity: 0.5; cursor: default; }

/* ------------------------------------------------------------------ modal */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  overflow-y: auto;
  z-index: 100;
  animation: workingIn 0.22s var(--ease);
}

.modal-box {
  background: var(--bg-soft);
  border: 1px solid var(--line-hot);
  border-radius: 10px;
  max-width: 580px;
  width: 100%;
  padding: 28px 30px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(34, 211, 238, 0.06);
}

.modal-box.wide { max-width: 800px; }

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }

.modal-head h2 {
  font-family: var(--head);
  font-size: 20px;
  background: linear-gradient(92deg, var(--text), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-note { font-size: 13.5px; color: var(--text-dim); line-height: 1.75; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 9px; margin-top: 20px; }

.field-row { display: flex; gap: 9px; }

.field-row input {
  flex: 1;
  font-family: var(--mono);
  font-size: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background: rgba(5, 8, 15, 0.6);
  color: var(--text);
}

.field-row input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1); }

.primary {
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  color: #04121a;
  border: none;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: 0.2s var(--ease);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
}

.primary:hover { box-shadow: 0 0 36px rgba(34, 211, 238, 0.55); transform: translateY(-1px); }
.primary:disabled { opacity: 0.45; cursor: default; box-shadow: none; transform: none; }

.connect-status { margin-top: 15px; padding: 13px 15px; border-radius: var(--radius); font-size: 13.5px; line-height: 1.65; }
.connect-status.error { background: rgba(248, 113, 113, 0.09); border: 1px solid rgba(248, 113, 113, 0.34); color: #fca5a5; }
.connect-status.info { background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.28); color: var(--cyan); }

.approve-link {
  display: block;
  margin: 17px 0 13px;
  padding: 13px 15px;
  background: rgba(5, 8, 15, 0.7);
  border: 1px solid var(--line-hot);
  color: var(--cyan);
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11.5px;
  word-break: break-all;
  transition: 0.2s var(--ease);
}

.approve-link:hover { border-color: var(--cyan); box-shadow: 0 0 20px rgba(34, 211, 238, 0.2); }

.waiting { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-hot);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* --- providers --- */

.provider-list { display: grid; gap: 11px; }

.provider {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  transition: 0.2s var(--ease);
  background: rgba(19, 29, 46, 0.45);
}

.provider:hover { border-color: var(--line-hot); }

.provider.active {
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.08), rgba(167, 139, 250, 0.05));
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.12);
}

.provider-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.provider-top h4 { font-family: var(--head); font-size: 15px; font-weight: 700; color: var(--text); }

.provider-top .badge {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge.on { background: var(--green); color: #04120c; box-shadow: 0 0 12px rgba(52, 211, 153, 0.5); }
.badge.saved { background: var(--line-hot); color: var(--text-dim); }
.provider-top .use { margin-left: auto; }

.provider-note { font-size: 12.5px; color: var(--text-dim); line-height: 1.65; margin-bottom: 13px; }
.provider-note a { color: var(--cyan); }

.provider-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.provider-fields label { display: grid; gap: 6px; font-size: 11.5px; color: var(--text-faint); }
.provider-fields label.full { grid-column: 1 / -1; }

.provider-fields input, .provider-fields select {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 10px 12px;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background: rgba(5, 8, 15, 0.6);
  color: var(--text);
  width: 100%;
}

.provider-fields input:focus, .provider-fields select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.09);
}

.field-hint { font-family: var(--mono); font-size: 10px; color: var(--cyan); }

.provider-actions { display: flex; gap: 8px; margin-top: 13px; align-items: center; flex-wrap: wrap; }
.provider-result { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.provider-result.ok { color: var(--green); }
.provider-result.bad { color: var(--red); }

.ghost-sm {
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid var(--line-hot);
  color: var(--text-dim);
  border-radius: var(--radius);
  padding: 8px 15px;
  font-size: 13px;
  transition: 0.2s var(--ease);
}

.ghost-sm:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 14px rgba(34, 211, 238, 0.2); }
.ghost-sm.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 0 14px rgba(248, 113, 113, 0.2); }
.ghost-sm.full { width: 100%; margin-top: 10px; }
.ghost-sm:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* --------------------------------------------------------------- scrollbar */

* { scrollbar-width: thin; scrollbar-color: var(--line-hot) transparent; }

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-hot); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--cyan); background-clip: content-box; }

/* -------------------------------------------------------- reduced motion */

/*
 * Everything above is decoration. Someone who has asked their system not to
 * animate things gets the same information without the movement — the working
 * bar still says what is happening, it simply stops pulsing.
 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .backdrop-scan, .brand-sheen::before, .working::after { display: none; }
  .working-bars i { height: 10px; opacity: 0.8; }
  .wf-line, .wf-block { background: rgba(34, 211, 238, 0.5); }
}
