:root {
  --bg: #101614;
  --bg-2: #17201c;
  --card: #1d2924;
  --line: rgba(243, 239, 228, 0.1);
  --ink: #f3efe4;
  --muted: #b7c0b4;
  --gold: #e0b75a;
  --gold-2: #f0d392;
  --green: #7dce9a;
  --danger: #e58a7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --sans: "Manrope", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(224, 183, 90, 0.12), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(125, 206, 154, 0.08), transparent 45%),
    var(--bg);
  color: var(--ink);
}

a { color: var(--gold); }
button, input, textarea { font: inherit; }
img { max-width: 100%; height: auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 8px;
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.brand strong {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}
.brand span, .who, .hint { color: var(--muted); font-size: 0.86rem; }

.wrap { width: min(1100px, calc(100% - 28px)); margin: 0 auto 32px; }
.hero, .card, .chat-shell, .task-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero { padding: 28px 24px; margin-top: 18px; }
.hero-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
}
.hero-logo img {
  height: 48px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
}
.brand-mark {
  height: 42px;
  width: auto;
  background: #fff;
  border-radius: 10px;
  padding: 4px 8px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 8px 0 10px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.col h2 {
  margin: 18px 4px 10px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item .id { color: var(--gold-2); font-weight: 700; }
.meta { color: var(--muted); font-size: 0.84rem; margin-top: 4px; }
.details { white-space: pre-wrap; margin: 8px 0 0; line-height: 1.45; }

.pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.75rem;
  color: var(--gold-2);
}
.pill.done { color: var(--green); }
.pill.wait { color: var(--gold); }

.btn {
  appearance: none;
  border: 0;
  background: var(--gold);
  color: #1a1408;
  font-weight: 700;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.danger { background: #c96b5a; color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.wide { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field input, .field textarea, .field select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field select option {
  color: #1a1408;
  background: #fff;
}
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input {
  width: 100%;
  padding-right: 48px;
}
.eye {
  appearance: none;
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--gold-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
}
.eye svg { pointer-events: none; display: block; }
.eye:hover, .eye.on { background: rgba(224, 183, 90, 0.16); }

.chat-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 88px);
  overflow: hidden;
}
.chat-log {
  flex: 1;
  overflow: auto;
  padding: 8px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble {
  align-self: flex-end;
  max-width: 92%;
  background: #24332c;
  border-radius: 18px 18px 6px 18px;
  padding: 12px 14px;
}
.bubble.done { align-self: stretch; border-color: var(--green); }
.status-line {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--gold-2);
  font-weight: 700;
}
.composer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.file-row, .file-list { margin-top: 8px; font-size: 0.86rem; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-chip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.attach {
  color: var(--muted);
  font-size: 0.82rem;
}
.file-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  position: relative;
}
.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(224, 183, 90, 0.45);
  background: rgba(224, 183, 90, 0.08);
  color: var(--gold-2);
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.file-btn:hover { background: rgba(224, 183, 90, 0.16); }
.file-name {
  color: var(--muted);
  font-size: 0.78rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer textarea {
  flex: 1;
  min-height: 48px;
  max-height: 120px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px;
}
.empty { color: var(--muted); padding: 28px 16px; text-align: center; }
.worker-stage { padding: 18px; }
.task-card { padding: 22px; }
.task-card h2 { font-family: var(--display); margin: 8px 0 12px; }
.links { display: flex; flex-direction: column; gap: 8px; padding: 8px 16px 16px; }
.link-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #111;
  border: 1px solid var(--gold);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  display: none;
  z-index: 20;
}
.toast.show { display: block; }
.login-box { padding: 22px; margin-top: 22px; max-width: 420px; }
.reply-box { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
code { color: var(--gold-2); }

body.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.home-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 12px;
}
.home-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 42%), var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.home-left {
  padding: 36px 32px 32px;
}
.home-left h1 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 560;
  margin: 6px 0 8px;
  line-height: 1.15;
}
.home-left h2 {
  font-family: var(--display);
  margin: 8px 0 14px;
  font-size: 1.45rem;
}
.eyebrow {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}
.home-lead { color: var(--muted); margin: 0 0 22px; }
.role-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.role-btn {
  appearance: none;
  border: 1px solid rgba(224, 183, 90, 0.35);
  background: rgba(224, 183, 90, 0.08);
  color: var(--gold-2);
  border-radius: 16px;
  padding: 18px 12px;
  font-weight: 800;
  font-size: 1.02rem;
  cursor: pointer;
}
.role-btn:hover { background: rgba(224, 183, 90, 0.18); }
.back-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  margin-bottom: 8px;
  cursor: pointer;
}
.back-link:hover { color: var(--gold-2); }
.home-logo {
  display: grid;
  place-items: center;
  background: #fff;
  padding: 28px;
  min-height: 320px;
}
.home-logo img {
  width: min(240px, 70%);
  height: auto;
  max-height: 220px;
  object-fit: contain;
}
.site-footer {
  text-align: center;
  padding: 18px 16px 22px;
  color: var(--muted);
}
.site-footer p { margin: 0 0 6px; font-size: 0.88rem; letter-spacing: 0.04em; }
.site-footer strong { color: var(--gold-2); font-weight: 700; }
.site-footer a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.92rem;
}
.site-footer a:hover { text-decoration: underline; }
@media (max-width: 800px) {
  .home-card { grid-template-columns: 1fr; }
  .home-logo { min-height: 180px; order: -1; padding: 18px; }
  .home-logo img { width: 140px; max-height: 120px; }
  .home-left { padding: 22px 20px 24px; }
}
