/* ── Building screen ────────────────────────────────────── */

.building {
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
  padding-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  text-align: center;
}

.orb {
  width: 132px; height: 132px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 28%, var(--accent-hi), var(--accent) 62%, transparent 74%);
  box-shadow: 0 0 60px var(--accent-glow);
  animation: breathe 3.4s ease-in-out infinite;
}

.orb::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid var(--accent-soft);
  animation: ripple 3.4s ease-out infinite;
}

.orb.is-done { animation: none; background: radial-gradient(circle at 32% 28%, #8fd0a8, var(--good) 62%, transparent 74%); box-shadow: 0 0 60px rgba(111, 191, 143, 0.2); }
.orb.is-done::after { animation: none; border-color: rgba(111, 191, 143, 0.28); }
.orb svg { width: 42px; height: 42px; color: var(--on-accent); }

@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes ripple { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.35); opacity: 0; } }

.building h1 { font-size: clamp(26px, 4vw, 34px); }
.building p { color: var(--muted); max-width: 44ch; }

.checklist { width: 100%; display: flex; flex-direction: column; gap: 3px; text-align: left; }

.check {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  color: var(--subtle);
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.check.is-active { color: var(--text); background: var(--surface); }
.check.is-done { color: var(--muted); }

.check-mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-hi);
  display: grid; place-items: center;
  flex: none;
  transition: all 0.3s var(--ease);
}

.check.is-done .check-mark { background: var(--good); border-color: var(--good); }
.check.is-done .check-mark svg { width: 11px; height: 11px; color: var(--on-accent); }
.check.is-active .check-mark { border-color: var(--accent); }

/* ── Done screen ────────────────────────────────────────── */

.done { max-width: 660px; margin: 0 auto; width: 100%; padding-top: 44px; display: flex; flex-direction: column; gap: 26px; }
.done-head { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.done-head h1 { font-size: clamp(28px, 4.4vw, 40px); }
.done-head p { color: var(--muted); max-width: 46ch; }

.link-card {
  padding: 8px 8px 8px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-hi);
  background: var(--bg-raised);
}

.link-url {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.dns-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.dns-table th {
  text-align: left;
  font-family: var(--font);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--subtle);
  font-weight: 500;
  padding: 0 12px 8px 0;
}

.dns-table td { padding: 8px 12px 8px 0; border-top: 1px solid var(--line); color: var(--muted); word-break: break-all; }
.dns-table td:first-child { color: var(--text); }

.done-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── Chat surface ───────────────────────────────────────── */

.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  padding: 0 22px;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--line);
}

.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 16px;
  flex: none;
  box-shadow: none;
}

.chat-title { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.chat-subtitle { font-size: 13px; color: var(--subtle); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: thin;
}

.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 8px; }

/* Entrance animations below deliberately omit `both`. With a fill mode the
   element holds the from-state (opacity 0) whenever the animation has not
   progressed, so anything that stops the clock -- a throttled background tab,
   a headless render -- leaves the content permanently invisible. Without it the
   element rests at its natural visible style and the animation is pure garnish.
   The staggered `.rise-1..4` classes keep `both` because they have a delay and
   would otherwise flash before starting. */
.msg { display: flex; gap: 13px; animation: rise 0.34s var(--ease); max-width: 100%; }
.msg--user { justify-content: flex-end; }

.msg-bubble {
  padding: 13px 18px;
  border-radius: var(--r-md);
  font-size: 15px;
  line-height: 1.65;
  max-width: 78%;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.msg--user .msg-bubble {
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 6px;
}

.msg--agent .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 10px;
  background: var(--accent);
  flex: none;
  display: grid; place-items: center;
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.chat-empty h2 { font-size: 24px; color: var(--text); }

.starter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; width: 100%; max-width: 520px; margin-top: 12px; }

.starter {
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s var(--ease);
}
.starter:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.composer {
  padding: 14px 0 26px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.composer-input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  font-size: 15px;
  resize: none;
  max-height: 180px;
  line-height: 1.55;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.composer-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.send-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  display: grid; place-items: center;
  flex: none;
  box-shadow: none;
  transition: transform 0.18s var(--ease), opacity 0.18s;
}
.send-btn:hover:not(:disabled) { transform: scale(1.06); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn svg { width: 18px; height: 18px; }

.typing { display: inline-flex; gap: 5px; align-items: center; padding: 4px 0; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: bounce 1.3s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.16s; }
.typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── Overlay / auth modal ───────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 5, 10, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade 0.24s var(--ease);
}

.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(440px, 100%);
  padding: 34px 32px 32px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-hi);
  background: var(--bg-raised);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: pop 0.3s var(--ease);
}

@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.modal-head h2 { font-size: 23px; letter-spacing: -0.02em; }
.modal-head p { font-size: 14.5px; color: var(--muted); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.code-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 0.4em;
  padding: 15px 10px;
  text-indent: 0.4em;
}

.modal-foot { font-size: 13px; color: var(--subtle); text-align: center; }
.modal-foot button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }
.modal-foot button:hover { text-decoration: underline; }

/* ── Sign-in modal: Google button, legal line, corner close ── */
.modal { position: relative; }

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--danger);           /* theme-aware red */
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }

.btn--google {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
}
.google-logo { display: inline-flex; }
.google-logo svg { width: 18px; height: 18px; }

.modal-legal {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}
.modal-legal a { color: inherit; text-decoration: underline; }
