:root {
  color: #111827;
  background: #f6f7f9;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  align-items: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(135deg, #eef1f5 0%, #f8f9fb 48%, #e8edf3 100%);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  backdrop-filter: blur(22px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(17, 24, 39, 0.12);
  max-width: 460px;
  padding: 34px;
  width: 100%;
}

.login-topline,
.product,
.identity-card,
.header-actions {
  align-items: center;
  display: flex;
}

.login-topline {
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
}

.brand-mark,
.product-icon,
.avatar {
  align-items: center;
  background: #111827;
  border-radius: 12px;
  color: white;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
}

.brand-mark {
  height: 32px;
  width: 32px;
}

.login-panel h1 {
  font-size: 52px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
  margin: 34px 0 12px;
}

.login-panel p {
  color: #5b6472;
  font-size: 16px;
  margin: 0 0 30px;
}

label,
.label {
  color: #667085;
  display: grid;
  font-size: 12px;
  font-weight: 750;
  gap: 8px;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #dde3eb;
  border-radius: 14px;
  color: #111827;
  outline: none;
  padding: 13px 14px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.login-panel button,
.composer button {
  background: #111827;
  border: 0;
  border-radius: 14px;
  color: white;
  font-weight: 760;
  margin-top: 16px;
  padding: 13px 16px;
}

.app-shell {
  background:
    radial-gradient(circle at 75% 8%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(145deg, #f7f8fa, #eceff4);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  backdrop-filter: blur(24px);
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px;
}

.product {
  gap: 12px;
  padding: 4px 2px 14px;
}

.product-icon {
  height: 42px;
  width: 42px;
}

.product strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0;
}

.product span,
.identity-card span:not(.avatar) {
  color: #737d8c;
  display: block;
  font-size: 13px;
}

.control-block {
  display: grid;
  gap: 10px;
}

.audit-panel {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid #e5eaf0;
  border-radius: 18px;
  padding: 12px;
}

.metric-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.metric-row span {
  color: #667085;
  font-size: 12px;
}

.metric-row strong {
  color: #111827;
  font-size: 13px;
}

.identity-card {
  background: #f8fafc;
  border: 1px solid #e5eaf0;
  border-radius: 18px;
  gap: 10px;
  padding: 12px;
}

.avatar {
  background: #e7eaf0;
  color: #111827;
  font-size: 11px;
  height: 34px;
  width: 34px;
}

.segmented {
  background: #e8ecf2;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
}

.segmented button,
.examples button,
.ghost {
  border: 0;
  border-radius: 11px;
}

.segmented button {
  background: transparent;
  color: #667085;
  font-weight: 760;
  padding: 10px;
}

.segmented button.active {
  background: white;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
  color: #111827;
}

.examples button,
.ghost {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #e4e9ef;
  color: #252f3f;
  padding: 11px 12px;
  text-align: left;
}

.examples button:hover,
.ghost:hover {
  background: white;
  border-color: #cfd7e2;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.ghost {
  text-align: center;
}

.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 100vh;
}

.chat-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 24px 34px 18px;
}

.chat-header h1 {
  font-size: 25px;
  font-weight: 760;
  letter-spacing: 0;
  margin: 0;
}

.chat-header p {
  color: #6b7280;
  margin: 4px 0 0;
}

.chat-header code {
  display: inline;
  padding: 2px 6px;
}

.header-actions {
  gap: 8px;
}

.status-pill {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid #e0e6ee;
  border-radius: 999px;
  color: #344054;
  font-size: 12px;
  font-weight: 760;
  padding: 8px 11px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 20px 34px 28px;
}

.empty-state {
  align-self: center;
  color: #667085;
  margin-top: 12vh;
  max-width: 620px;
  text-align: center;
}

.empty-kicker {
  background: #111827;
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 12px;
  font-weight: 760;
  padding: 6px 10px;
}

.empty-state h2 {
  color: #111827;
  font-size: 42px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.06;
  margin: 18px 0 10px;
}

.message {
  border-radius: 22px;
  max-width: 880px;
  padding: 16px 18px;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: #111827;
  color: white;
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 40px rgba(17, 24, 39, 0.06);
  color: #17202a;
}

.message.loading {
  color: #667085;
}

.debug-line {
  color: #737d8c;
  font-size: 12px;
  font-weight: 760;
  margin-top: 12px;
  text-transform: uppercase;
}

.sources {
  border-top: 1px solid #e6ebf1;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
}

.sources h3 {
  font-size: 14px;
  margin: 0;
}

details {
  background: #f8fafc;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  padding: 11px;
}

summary {
  cursor: pointer;
  display: flex;
  gap: 8px;
}

summary b {
  background: #111827;
  border-radius: 999px;
  color: white;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
}

summary span {
  flex: 1;
  font-weight: 760;
  overflow-wrap: anywhere;
}

summary em {
  color: #667085;
  font-size: 12px;
  font-style: normal;
}

details p {
  color: #465466;
  margin: 10px 0;
}

code {
  background: #edf1f5;
  border-radius: 8px;
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
  padding: 8px;
}

.error-banner {
  background: #fff2ef;
  border-top: 1px solid #ffd4cc;
  color: #a3311d;
  font-weight: 760;
  padding: 10px 34px;
}

.composer {
  align-items: end;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: 0 18px 60px rgba(17, 24, 39, 0.09);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin: 0 34px 28px;
  padding: 10px;
}

.composer textarea {
  background: transparent;
  border: 0;
  min-height: 54px;
  resize: vertical;
}

.composer textarea:focus {
  box-shadow: none;
}

.composer button {
  margin: 0;
  min-height: 50px;
  padding-left: 18px;
  padding-right: 18px;
}

.composer button:disabled {
  background: #9aa4b2;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .examples,
  .audit-panel {
    display: none;
  }

  .chat-header {
    align-items: stretch;
    display: grid;
    gap: 12px;
  }

  .composer {
    grid-template-columns: 1fr;
    margin: 0 16px 18px;
  }

  .messages,
  .chat-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .empty-state h2 {
    font-size: 34px;
  }
}
