/*
 * 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 {
  /*
   * A light interface with a technical edge.
   *
   * The dark version was replaced because it was tiring to read rather than
   * because dark is wrong: a console someone stares at for an hour should not
   * be a place where the faintest text sits four steps from the background.
   *
   * Light also changes what "depth" means. On dark, panels were distinguished
   * by being slightly lighter than their surroundings and by glowing at the
   * edges. On light, everything is white and the separation comes from shadow
   * and a hairline border. The accent colours are correspondingly deeper —
   * #38d9f0 is a lovely thing to glow with on black and is 3.7:1 on white,
   * which is not readable.
   */
  --bg-deep: #e7edf7;
  --bg: #ffffff;
  --bg-soft: #f4f7fc;
  --bg-raise: #ffffff;
  --line: #e3e9f2;
  --line-hot: #ccd6e5;

  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eff3f9;
  --scrim: rgba(15, 23, 42, 0.42);

  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #5c6b80;

  /* Readable accents. Used for text, borders and icons. */
  --cyan: #0e7490;
  --violet: #7c3aed;
  --pink: #db2777;
  --amber: #b45309;
  --green: #047857;
  --red: #dc2626;

  /* Saturated accents. Only for the brand mark and decorative gradients,
     where nothing depends on being able to read them. */
  --cyan-bright: #22b8d4;
  --violet-bright: #a78bfa;
  --pink-bright: #f472b6;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 2px 6px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.13), 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-cyan: 0 6px 18px rgba(14, 116, 144, 0.18);

  --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);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --left: 278px;
  --right: 344px;
  --radius: 8px;
}

* { 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(14, 116, 144, 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.
 *
 * On dark these were glows — light added to a black field. On light the same
 * idea inverts: the fields are pastel washes and the grid is a hairline, or the
 * page turns into a smudge. The bright accents are used here rather than the
 * readable ones, because nothing on this layer is text.
 */
.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(14, 116, 144, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 116, 144, 0.07) 1px, transparent 1px);
  background-size: 52px 52px;
  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.42; }

.backdrop-glow.g1 {
  width: 640px; height: 640px; top: -280px; left: -140px;
  background: radial-gradient(circle, rgba(34, 184, 212, 0.42), 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.4), 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(14, 116, 144, 0.06), 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(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 var(--line), 0 2px 12px rgba(15, 23, 42, 0.03);
  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-bright), var(--violet-bright), var(--pink-bright), var(--amber), var(--cyan-bright));
  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-bright), var(--violet-bright), var(--pink-bright), var(--amber), var(--cyan-bright));
  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: 20.5px;
  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(14, 116, 144, 0.4)) drop-shadow(0 0 26px rgba(124, 58, 237, 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(14, 116, 144, 0.06);
  border: 1px solid var(--line-hot);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text-dim);
}

.model-chip:hover {
  border-color: var(--cyan);
  color: var(--text);
  box-shadow: var(--shadow-cyan);
}

.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: 15px;
}

.ghost:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--shadow-cyan); }

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

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

/* The centre column is the only part of the app that is not a white panel. A
   barely-there tint is what stops three white columns reading as one flat
   sheet. */
.col-main { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); }

@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: var(--surface);
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.02), 2px 0 12px rgba(15, 23, 42, 0.03);
  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(14, 116, 144, 0.05);
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 15.5px;
  font-weight: 500;
  text-align: left;
}

.project-btn:hover { border-color: var(--cyan); box-shadow: var(--shadow-cyan); }
.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: var(--shadow-lg), 0 0 0 1px rgba(15, 23, 42, 0.04);
  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: 15.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}

.menu button:last-child { border-bottom: none; }
.menu button:hover { background: rgba(14, 116, 144, 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: 12.5px;
  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);
}

.icon-btn:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--shadow-cyan); }

.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;
  position: relative;
}

.conv:hover { background: rgba(14, 116, 144, 0.05); border-color: var(--line); }
.conv.on {
  background: linear-gradient(100deg, rgba(14, 116, 144, 0.13), rgba(124, 58, 237, 0.09));
  border-color: rgba(14, 116, 144, 0.34);
  box-shadow: inset 3px 0 0 var(--cyan);
}

.conv .t { font-size: 15.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: 12.5px; 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: 15.5px;
  padding: 2px 5px;
}

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

.empty-note { padding: 11px; font-size: 14.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(255, 255, 255, 0.62);
}

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

.task-meta { font-family: var(--mono); font-size: 13px; 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: 27px;
  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: 16px; margin-bottom: 17px; line-height: 1.7; }

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

.example {
  position: relative;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 15.5px;
  color: var(--text-dim);
  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: var(--shadow);
}

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

.fine { font-size: 14.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(14, 116, 144, 0.14), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(14, 116, 144, 0.26);
  color: var(--text);
  padding: 13px 17px;
  border-radius: 12px 12px 3px 12px;
  font-size: 16px;
  line-height: 1.6;
  width: fit-content;
  max-width: 640px;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
}

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

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

.msg.agent { font-size: 16px; line-height: 1.8; color: #334155; }
.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: 14.5px;
  background: rgba(14, 116, 144, 0.1);
  border: 1px solid rgba(14, 116, 144, 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(14, 116, 144, 0.4); }

.msg.error {
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.34);
  color: var(--red);
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 15.5px;
  line-height: 1.65;
}

.msg.warn {
  background: rgba(4, 120, 87, 0.07);
  border: 1px solid rgba(4, 120, 87, 0.28);
  color: var(--green);
  padding: 12px 15px;
  border-radius: var(--radius);
  font-size: 15.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: 15px;
  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 0 3px rgba(14, 116, 144, 0.16);
}

.step.ok .mark {
  border: none;
  animation: none;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.18);
  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 0 3px rgba(185, 28, 28, 0.18);
}

.step .path { font-family: var(--mono); font-size: 13.5px; color: var(--cyan); }
.step .note { color: var(--text-faint); font-size: 14px; }
.step.ok .label, .step.bad .label { color: var(--text-dim); }
.step.bad .label { color: var(--red); }

/* --- aftercare --- */

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

.mini {
  font-size: 14.5px;
  padding: 6px 13px;
  border: 1px solid var(--line-hot);
  background: rgba(14, 116, 144, 0.06);
  border-radius: var(--radius);
  color: var(--cyan);
}

.mini:hover { border-color: var(--cyan); box-shadow: var(--shadow-cyan); }
.mini.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 6px 18px rgba(185, 28, 28, 0.16); }

/* ------------------------------------------------------------ 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(14, 116, 144, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(14, 116, 144, 0.09), rgba(124, 58, 237, 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(14, 116, 144, 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(14, 116, 144, 0.4);
  border-radius: 3px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 5px 1fr 1fr;
  gap: 2px;
  background: rgba(247, 249, 252, 0.9);
}

.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(14, 116, 144, 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(14, 116, 144, 0.18); box-shadow: none; }
  40% { background: rgba(14, 116, 144, 0.75); box-shadow: 0 0 8px rgba(14, 116, 144, 0.5); }
}

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

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

.working-detail {
  font-family: var(--mono);
  font-size: 13px;
  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: 14px; 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(14, 116, 144, 0.08);
  border: 1px solid rgba(14, 116, 144, 0.24);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  font-size: 14px;
  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: 15px; 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(255, 255, 255, 0.94);
  border: 1px solid var(--line-hot);
  border-radius: 10px;
  padding: 9px 9px 9px 11px;
  position: relative;
}

.composer:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.14), var(--shadow);
}

.composer textarea {
  flex: 1;
  font: inherit;
  font-size: 16.5px;
  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;
}

.attach-btn:hover { background: rgba(14, 116, 144, 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: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-cyan);
}

.send:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(14, 116, 144, 0.3); transform: translateY(-1px); }
.send:disabled { background: var(--line); color: var(--text-faint); box-shadow: none; cursor: default; }

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

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

.drop-veil {
  position: absolute;
  inset: 12px;
  border: 2px dashed var(--cyan);
  border-radius: 10px;
  background: rgba(14, 116, 144, 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: 18.5px;
  color: var(--cyan);
  background: var(--bg-deep);
  border: 1px solid rgba(14, 116, 144, 0.4);
  padding: 11px 22px;
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(14, 116, 144, 0.22);
}

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

.col-right {
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -1px 0 0 rgba(15, 23, 42, 0.02), -2px 0 12px rgba(15, 23, 42, 0.03);
  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: 12.5px;
  font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.panel-note { font-size: 14.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;
  background: rgba(255, 255, 255, 0.8);
}

.material:hover { border-color: var(--line-hot); box-shadow: var(--shadow); }

.material .ico {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.16), rgba(124, 58, 237, 0.13));
  border: 1px solid rgba(14, 116, 144, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
}

.material .body { flex: 1; min-width: 0; }
.material .nm { font-size: 14.5px; line-height: 1.45; word-break: break-word; margin-bottom: 3px; color: var(--text-dim); }
.material .meta { font-family: var(--mono); font-size: 12.5px; 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: 14px; }
.material .acts button:hover { color: var(--cyan); }
.material .acts button.x:hover { color: var(--red); }

.material-preview {
  display: inline-block;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font-size: 12.5px;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.reference-dialog {
  width: min(1540px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 18px;
  border: 1px solid var(--line-hot);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.reference-dialog::backdrop { background: rgba(12, 27, 36, 0.73); }
.reference-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.reference-head h2 { font-size: 20px; margin: 0 0 5px; overflow-wrap: anywhere; }
.reference-head p, .reference-assets p { margin: 0 0 12px; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.reference-close { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 6px 10px; }
.reference-controls { display: flex; gap: 8px; margin: 5px 0 12px; flex-wrap: wrap; }
.reference-controls button { border: 1px solid var(--line-hot); border-radius: 6px; background: white; color: var(--text); padding: 7px 10px; }
.reference-controls button[aria-pressed="true"] { background: var(--cyan); color: white; border-color: var(--cyan); }
.reference-viewport { width: 100%; min-height: 280px; max-height: min(72vh, 940px); overflow: auto; background: #e6e9e8; border: 1px solid var(--line); border-radius: 6px; }
.reference-frame-shell { position: relative; margin: 0 auto; background: white; }
.reference-frame-shell iframe { position: absolute; inset: 0 auto auto 0; border: 0; background: white; transform-origin: top left; }
.reference-assets { margin-top: 18px; }
.reference-assets h3 { font-size: 16px; margin: 0 0 5px; }
.reference-gallery { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; }
.reference-gallery button { flex: 0 0 130px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 5px; text-align: left; color: var(--text-dim); }
.reference-gallery button:hover, .reference-gallery button:focus-visible { border-color: var(--cyan); }
.reference-gallery img { width: 100%; height: 84px; object-fit: contain; display: block; background: #f0f2f1; }
.reference-gallery span { display: block; font-size: 12px; line-height: 1.35; margin: 5px 2px 1px; overflow-wrap: anywhere; }
.reference-image-focus { margin-top: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; text-align: center; background: #f7f9f8; }
.reference-image-focus img { max-width: 100%; max-height: 65vh; object-fit: contain; }

.drop-zone {
  width: 100%;
  border: 1.5px dashed var(--line-hot);
  border-radius: var(--radius);
  background: rgba(14, 116, 144, 0.03);
  padding: 18px 12px;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--text-faint);
}

.drop-zone:hover, .drop-zone.over {
  border-color: var(--cyan);
  background: rgba(14, 116, 144, 0.08);
  color: var(--cyan);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

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

.site-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.8);
}

.site-card .url { font-family: var(--mono); font-size: 13.5px; word-break: break-all; margin-bottom: 9px; color: var(--cyan); }
.site-card .row { display: flex; justify-content: space-between; gap: 10px; font-size: 14.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: 13.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: 14.5px; line-height: 1.65; }

.version {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(247, 249, 252, 0.9);
}

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

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

.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: var(--scrim);
  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: var(--shadow-lg), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.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: 21.5px;
  background: linear-gradient(92deg, var(--text), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-note { font-size: 15.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: 15.5px;
  padding: 13px 15px;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--text);
}

.field-row input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15); }

.primary {
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
  box-shadow: var(--shadow-cyan);
}

.primary:hover { box-shadow: 0 10px 26px rgba(14, 116, 144, 0.3); 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: 15.5px; line-height: 1.65; }
.connect-status.error { background: rgba(185, 28, 28, 0.09); border: 1px solid rgba(185, 28, 28, 0.34); color: var(--red); }
.connect-status.info { background: rgba(14, 116, 144, 0.08); border: 1px solid rgba(14, 116, 144, 0.28); color: var(--cyan); }

.approve-link {
  display: block;
  margin: 17px 0 13px;
  padding: 13px 15px;
  background: rgba(247, 249, 252, 0.95);
  border: 1px solid var(--line-hot);
  color: var(--cyan);
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13.5px;
  word-break: break-all;
}

.approve-link:hover { border-color: var(--cyan); box-shadow: var(--shadow-cyan); }

.waiting { display: flex; align-items: center; gap: 10px; font-size: 15px; 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;
  background: rgba(255, 255, 255, 0.7);
}

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

.provider.active {
  border-color: rgba(14, 116, 144, 0.45);
  background: linear-gradient(120deg, rgba(14, 116, 144, 0.08), rgba(124, 58, 237, 0.05));
  box-shadow: var(--shadow-sm);
}

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

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

.badge.on { background: var(--green); color: #ffffff; box-shadow: 0 0 12px rgba(4, 120, 87, 0.5); }
.badge.saved { background: var(--line-hot); color: var(--text-dim); }
.provider-top .use { margin-left: auto; }

.provider-note { font-size: 14.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: 13.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: 14.5px;
  padding: 10px 12px;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  background: #f7f9fc;
  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(14, 116, 144, 0.14);
}

.model-picker { display: grid; gap: 7px; }
.model-picker select { cursor: pointer; }
.model-picker input:not([hidden]) {
  border-style: dashed;
  background: #ffffff;
}

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

.reasoning-field {
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.055), rgba(124, 58, 237, 0.045));
}
.reasoning-field[hidden] { display: none; }
.reasoning-control { display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 14px; align-items: center; }
.reasoning-meter {
  height: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.reasoning-meter i { border-radius: 99px; background: #dce4ec; transition: background .2s, transform .2s; }
.reasoning-field[data-level="none"] .reasoning-meter i:first-child,
.reasoning-field[data-level="minimal"] .reasoning-meter i:first-child,
.reasoning-field[data-level="low"] .reasoning-meter i:nth-child(-n+1),
.reasoning-field[data-level="medium"] .reasoning-meter i:nth-child(-n+2),
.reasoning-field[data-level="high"] .reasoning-meter i:nth-child(-n+3),
.reasoning-field[data-level="xhigh"] .reasoning-meter i,
.reasoning-field[data-level="max"] .reasoning-meter i {
  background: linear-gradient(90deg, var(--cyan), #7c3aed);
  transform: scaleY(1.35);
}

@media (max-width: 640px) {
  .reasoning-control { grid-template-columns: 1fr; }
  .reasoning-meter { width: 116px; }
}

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

/*
 * Shown when the saved model name is not in the provider's current list — the
 * most useful warning on this screen, because a renamed model fails later at
 * request time with an API error, nowhere near where the name was typed.
 */
.provider-warn {
  margin-top: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(180, 83, 9, 0.3);
  background: rgba(180, 83, 9, 0.07);
  color: var(--amber);
  font-size: 14.5px;
  line-height: 1.55;
}

.provider-warn code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: rgba(180, 83, 9, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

.ghost-sm {
  background: rgba(14, 116, 144, 0.06);
  border: 1px solid var(--line-hot);
  color: var(--text-dim);
  border-radius: var(--radius);
  padding: 8px 15px;
  font-size: 15px;
}

.ghost-sm:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--shadow-cyan); }
.ghost-sm.danger:hover { border-color: var(--red); color: var(--red); box-shadow: 0 6px 18px rgba(185, 28, 28, 0.16); }
.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(14, 116, 144, 0.5); }
}

/* ------------------------------------------------------------------ account */

/*
 * The account strip lives in the top bar, to the right of Settings.
 *
 * The seat count is the one number in this header that changes what the person
 * can do next, so it is the only thing styled with any weight. It turns amber
 * when there is nothing left, which is the moment before a connection is
 * refused and the last moment the reason can be explained cheaply.
 */

.acct { display: flex; align-items: center; gap: 8px; }

.acct-seats {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--line-hot);
  background: rgba(247, 249, 252, 0.9);
}

.acct-seats.spent {
  border-color: rgba(180, 83, 9, 0.42);
  background: rgba(180, 83, 9, 0.09);
}

.acct-seats-n {
  font-family: var(--mono);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}

.acct-seats.spent .acct-seats-n { color: var(--amber); }

.acct-seats-l { font-size: 13px; color: var(--text-faint); }

.acct-link {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--body);
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.acct-link:hover { color: var(--cyan); border-color: var(--line-hot); }
.acct-quiet { color: var(--text-faint); }

/* -------------------------------------------------------------- redeem box */

.modal-box.narrow { max-width: 460px; }

.modal-note.tiny {
  font-size: 13.5px;
  color: var(--text-faint);
  margin-top: -6px;
}

.redeem-note {
  min-height: 18px;
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.redeem-note.ok { color: var(--green); }
.redeem-note.bad { color: var(--red); }

@media (max-width: 720px) {
  /* The email is the first thing to go; the seat count is what matters. */
  .acct-link.acct-quiet { display: none; }
}

/* ------------------------------------------------------- connector plugin */

/*
 * The install instructions inside the connect dialog.
 *
 * This is the one place in the product where a customer has to leave and do
 * something on their own server, so it gets numbered steps and a download
 * button rather than a sentence telling them a plugin exists.
 */

.connect-steps-list {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 4px 0 16px;
}

.connect-steps-list li {
  counter-increment: step;
  position: relative;
  padding-left: 28px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-dim);
}

.connect-steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(14, 116, 144, 0.13);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------ buy seats */

/*
 * The buy-seats panel.
 *
 * The QR is the only picture in this product that is not the brand mark, so it
 * gets a white card around it: a payment code is designed to be scanned off a
 * dark screen, and putting it straight on the navy background costs contrast
 * exactly where it matters.
 */

.buy-rule {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.buy-rule strong { color: var(--text); font-weight: 600; }

.buy-qr { text-align: center; }

.buy-qr-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 232px;
  min-height: 232px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line-hot);
  box-shadow: var(--shadow-lg);
}

.buy-qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.buy-qr-missing {
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
  padding: 0 14px;
}

.buy-price {
  margin-top: 14px;
  font-family: var(--head);
  font-size: 18.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--amber);
}

.buy-how {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-dim);
}

.buy-how strong { color: var(--text); font-weight: 500; }

.buy-contact {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--cyan);
  word-break: break-all;
}

/* The seam between "pay here" and "already have a code". */
.buy-divide {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  font-size: 13.5px;
  color: var(--text-faint);
}

.buy-divide::before,
.buy-divide::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

@media (max-width: 480px) {
  .buy-qr-frame { width: 200px; min-height: 200px; }
}

/* --------------------------------------------------- connect: install steps */

/*
 * The install guide.
 *
 * This is the one place a customer has to leave the product and do something on
 * their own server, so the steps name the exact buttons they will see in
 * WordPress rather than describing the idea of installing a plugin.
 */

.connect-steps-list code {
  font-family: var(--mono);
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(14, 116, 144, 0.1);
  color: var(--cyan);
}

.connect-steps-list strong {
  color: var(--text);
  font-weight: 600;
}

#connectInstall .plugin-where { margin-bottom: 3px; }

#connectAsk .modal-actions,
#connectInstall .modal-actions,
#connectApprove .modal-actions { justify-content: flex-start; }

/*
 * A bare <button> in this app has `color: inherit` and the browser's default
 * light background, which is light text on a light surface — an invisible
 * button. It shipped that way once, on the "换个地址" control. Rather than rely
 * on remembering to add a class, give every button a sane base and let the
 * classes override it.
 */
/*
 * Only buttons that have no class of their own.
 *
 * The first attempt was a plain `button { ... }` and it broke the close icon:
 * `.icon-btn` sets width and height but not padding, so the inherited padding
 * squeezed the glyph out of a 25px square and every dialog got an empty box in
 * its corner. Element selectors and class selectors do not merge the way it is
 * tempting to assume — this only applies where nothing else has.
 */
button:not([class]) {
  background: none;
  border: 1px solid var(--line-hot);
  border-radius: var(--radius);
  padding: 8px 16px;
  color: var(--text-dim);
}

button:not([class]):hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }

/* ------------------------------------------------------- task completion */

/*
 * The card that ends a task.
 *
 * It replaces a wall of markdown with one line saying the thing was done and a
 * disclosure holding the same wall, unchanged. The tick is the only decoration:
 * everything else on this card is there to answer "did it work" and "what do I
 * do now", in that order.
 */

.done {
  max-width: 800px;
  margin: 4px 0 20px;
  border: 1px solid rgba(4, 120, 87, 0.32);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(4, 120, 87, 0.07), rgba(4, 120, 87, 0.02));
  overflow: hidden;
  animation: msgIn 0.32s var(--ease);
}

.done-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
}

.done-tick {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(4, 120, 87, 0.16);
  border: 1px solid rgba(4, 120, 87, 0.45);
  color: var(--green);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.done-text { min-width: 0; }

.done-title {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--green);
}

/* The goal, quoted back. Truncated at three lines: it is a reminder of what was
   asked, not a place to re-read the whole request. */
.done-goal {
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.done-meta {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.done-more { border-top: 1px solid rgba(4, 120, 87, 0.2); }

.done-more summary {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}

.done-more summary::-webkit-details-marker { display: none; }

.done-more summary::before {
  content: '▸';
  font-size: 11px;
  color: var(--text-faint);
  transition: transform 0.18s var(--ease);
}

.done-more[open] summary::before { transform: rotate(90deg); }
.done-more summary:hover { color: var(--cyan); }

.done-report {
  padding: 4px 18px 20px;
  font-size: 15px;
  line-height: 1.8;
  color: #334155;
}

/* The write-up keeps the chat's typography without the chat's spacing. */
.done-report p { margin-bottom: 12px; }
.done-report p:last-child { margin-bottom: 0; }
.done-report strong { font-weight: 600; color: var(--text); }
.done-report ul, .done-report ol { margin: 0 0 12px 20px; }
.done-report li { margin-bottom: 6px; }

.done-report h1, .done-report h2, .done-report h3, .done-report h4 {
  font-family: var(--head);
  color: var(--text);
  letter-spacing: -0.012em;
  margin: 20px 0 10px;
}

.done-report h1 { font-size: 19px; }
.done-report h2 { font-size: 17.5px; }
.done-report h3 { font-size: 16.5px; }
.done-report h4 { font-size: 15.5px; }
.done-report > :first-child { margin-top: 0; }

.done-report code {
  font-family: var(--mono);
  font-size: 13.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(14, 116, 144, 0.1);
  color: var(--cyan);
}

.done-report a { color: var(--cyan); }

.done-actions {
  max-width: 800px;
  margin: -8px 0 22px;
}

/* ------------------------------------------------------------ light polish */

/*
 * Detail that makes a light interface read as technical rather than blank.
 *
 * On dark, the hardware did this for free: a cyan glow on a black field is a
 * technology signal by itself. On white there is nothing to glow, so the same
 * impression has to come from precision — hairline rules, a consistent mono
 * label style, small colour marks that mean something, and shadows that sit
 * under things instead of around them.
 */

/* Panel headings get a colour mark and a rule under them. The mark is the same
   cyan used everywhere the system is talking, so it reads as a category. */
.col-head {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.col-head h3::before,
.panel-head h3::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cyan);
  vertical-align: 2px;
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
}

/* The rule under the heading is what turns a label into a section boundary. */
.col-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.panel-head {
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

/* The two mono label styles met in the middle: 12.5px with 1.6px tracking is
   the right register for a label, and slightly darker makes it readable on
   white without competing with the content under it. */
.col-head h3,
.panel-head h3 {
  color: var(--text-dim);
  font-size: 12.5px;
  letter-spacing: 1.4px;
}

/* The right-hand panels get a hairline top accent, so three stacked white
   blocks read as three distinct sections rather than one long column. */
.panel { position: relative; }

.panel::before {
  content: '';
  position: absolute;
  left: 19px;
  right: 19px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(14, 116, 144, 0.22), rgba(124, 58, 237, 0.14), transparent 70%);
}

.panel:first-child::before { display: none; }

/* Cards sit on the page rather than in it. */
.example,
.material,
.version,
.site-card {
  box-shadow: var(--shadow-sm);
}

.example:hover,
.material:hover,
.version:hover,
.site-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line-hot);
}

/* The composer is the one element that should look like it is waiting for
   something, so it gets a stronger border and a soft shadow underneath. */
.composer {
  box-shadow: var(--shadow);
}

.composer:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12), var(--shadow);
}

/* The empty state in the middle column was a large white void. A centred
   marker gives it a focus instead of looking unloaded. */
.welcome-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border-radius: 13px;
  background: conic-gradient(from 0deg, var(--cyan-bright), var(--violet-bright), var(--pink-bright), var(--cyan-bright));
  box-shadow: var(--shadow-cyan);
  animation: spin 9s linear infinite;
}

/* ---------------------------------------------------------- plugin link */

/*
 * The plugin download, which lives under whatever the site panel is showing.
 *
 * It is a line rather than a button on purpose: it is needed once per website
 * and then never again, so it should be findable and unremarkable — not
 * competing with "open the site" and "disconnect", which are used constantly.
 */

.plugin-note {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/*
 * Where to ask for the plugin.
 *
 * No longer a link — the archive is not served to customers any more, they get
 * it from the operator — so this is a statement rather than something to click.
 * Styled as a quiet chip so it reads as "here is the detail you need" without
 * pretending to be actionable.
 */
.plugin-where {
  align-self: flex-start;
  padding: 7px 13px;
  border: 1px solid rgba(14, 116, 144, 0.28);
  border-radius: var(--radius);
  background: rgba(14, 116, 144, 0.05);
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.plugin-where strong { color: var(--cyan); font-weight: 600; }

.plugin-note span {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-faint);
}

/* ------------------------------------------------------- contact line row */

.plugin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
}

.plugin-note strong { color: var(--text-dim); font-weight: 600; }

/* --------------------------------------------------- block theme warning */

/*
 * Loud on purpose.
 *
 * A block theme makes two of this product's promises silently false, and the
 * customer has no way to tell a broken feature from a missing one. This is the
 * one place in the console where amber is used for something other than a spent
 * seat, and it earns it.
 */

.theme-warn {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(180, 83, 9, 0.34);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: rgba(180, 83, 9, 0.06);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

.theme-warn-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--amber);
  font-size: 14px;
}

.theme-warn-head span { font-size: 15px; }
.theme-warn-head strong { color: var(--amber); font-weight: 600; }

.theme-warn p { margin-bottom: 8px; }
.theme-warn p:last-child { margin-bottom: 0; }

.theme-warn ul {
  margin: 0 0 9px 17px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.theme-warn li { padding-left: 2px; }
.theme-warn strong { color: var(--text); font-weight: 600; }

.theme-warn-how {
  padding-top: 9px;
  border-top: 1px dashed rgba(180, 83, 9, 0.28);
}
