:root {
  color-scheme: light;
  --ink: #333333;
  --muted: #737373;
  --faint: #a5a5a5;
  --paper: #eeeeee;
  --white: #ffffff;
  --chart-1: #375a7f;
  --chart-2: #b24c63;
  --chart-3: #3d8060;
  --chart-4: #9b6b2f;
  --chart-5: #755a9b;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body { min-height: 100vh; background: var(--paper); }
button, input, textarea { font: inherit; color: inherit; }
button { appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer; }
button:hover, button:focus-visible { text-decoration: underline; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 1px dotted var(--ink); outline-offset: 5px; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login form { width: min(320px, 88vw); text-align: center; }
.field { display: block; text-align: center; margin: 24px 0; }
.field span { display: block; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.field input {
  appearance: none;
  width: 100%;
  border: 1px solid var(--white);
  border-radius: 0;
  background: transparent;
  padding: 10px 12px;
  font-size: 18px;
}
.login button {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
}
.form-error { color: var(--ink); min-height: 20px; margin: 24px 0 0; font-size: 13px; }

.landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 12vh;
}
.landing-actions {
  position: absolute;
  top: 36px;
  right: clamp(22px, 5vw, 76px);
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
}
.landing img { width: min(520px, 78vw); height: auto; margin-bottom: 46px; }
.prompt {
  width: min(720px, 88vw);
  border: 1px solid var(--white);
  border-radius: 0;
  box-shadow: 0 0 24px rgba(51, 51, 51, .18);
}
.prompt textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  resize: none;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
  padding: 12px;
}
.prompt textarea::placeholder { color: var(--faint); }
.prompt textarea:focus, .prompt textarea:focus-visible { outline: none; }

.workspace { min-height: 100vh; padding: 36px clamp(22px, 5vw, 76px) 180px; }
.topline { display: flex; align-items: center; justify-content: flex-end; gap: 28px; margin-bottom: 72px; }
.top-actions { display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
.conversation { max-width: 1120px; margin: 0 auto; }
.question { font-size: clamp(20px, 2.6vw, 34px); line-height: 1.3; font-weight: 430; max-width: 900px; margin: 0 0 64px; }
.summary { white-space: pre-wrap; font-size: 17px; line-height: 1.7; max-width: 850px; margin: 0 0 60px; }
.block { margin: 0 0 72px; }
.block h2 { font-size: 13px; font-weight: 550; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 28px; }
.metric-value { font-size: clamp(38px, 7vw, 84px); line-height: 1; letter-spacing: -.04em; }
.metric-label { margin-top: 14px; font-size: 15px; }
.metric-detail, .notes { color: var(--muted); font-size: 13px; line-height: 1.6; }
.notes { max-width: 800px; margin-top: 54px; }
.notes p { margin: 8px 0; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 34px 48px; }
.profile-card {
  text-align: left;
  min-width: 0;
  border: 1px solid var(--white);
  border-radius: 0;
  padding: 18px;
  box-shadow: none;
}
.profile-name { font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; }
.profile-email, .profile-meta { color: var(--muted); margin-top: 8px; font-size: 13px; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0 16px; text-align: left; }
th { color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; padding: 0 22px 4px 0; }
td { padding: 0 22px 0 0; vertical-align: top; line-height: 1.4; overflow-wrap: anywhere; }

.chart-wrap { width: 100%; overflow-x: auto; }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.chart text { font-family: inherit; fill: var(--muted); font-size: 11px; }
.chart .value { fill: var(--ink); font-size: 11px; }

.timeline { display: grid; gap: 28px; }
.timeline time { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.timeline-label { line-height: 1.45; }
.timeline-detail { color: var(--muted); font-size: 13px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

.composer {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 48px));
  background: var(--paper);
  padding: 16px 0;
  border: 1px solid var(--white);
  border-radius: 0;
}
.composer textarea { width: 100%; resize: none; min-height: 44px; max-height: 150px; border: 0; background: transparent; padding: 10px 4px; font-size: 16px; }
.stop-button {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  border: 1px solid var(--white);
  border-radius: 0;
  background: var(--paper);
  padding: 16px 30px;
  color: var(--muted);
  font-size: 13px;
  z-index: 5;
}
.stop-button:disabled { cursor: default; opacity: .55; }
.status { text-align: center; color: var(--muted); font-size: 13px; margin: 34px 0; }
.progress-log { display: grid; gap: 8px; }
.progress-log p { margin: 0; }
.progress-log p:not(:last-child) { color: var(--faint); }

.history-panel, .profile-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(720px, 100vw);
  min-height: 100vh;
  overflow-y: auto;
  background: var(--paper);
  padding: 38px clamp(24px, 5vw, 68px) 80px;
  z-index: 10;
  border: 1px solid var(--white);
  border-radius: 0;
  box-shadow: -18px 0 30px rgba(51, 51, 51, .16);
}
.panel-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 60px; }
.panel-head h1 { font-size: 16px; margin: 0; font-weight: 550; }
.history-list { display: grid; gap: 24px; }
.history-list button { text-align: left; line-height: 1.4; }
.history-date { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.profile-panel h2 { font-size: clamp(28px, 5vw, 52px); font-weight: 430; margin: 0 0 12px; overflow-wrap: anywhere; }
.profile-primary { font-size: 16px; color: var(--muted); overflow-wrap: anywhere; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin: 56px 0; }
.fact-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.fact-value { overflow-wrap: anywhere; }
.properties { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }

.busy img { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .45; } 50% { opacity: 1; } }

@media (max-width: 700px) {
  .workspace { padding-top: 24px; }
  .topline { margin-bottom: 46px; }
  .profile-facts { grid-template-columns: 1fr; }
  .question { margin-bottom: 42px; }
  .block { margin-bottom: 54px; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { .busy img { animation: none; } }
