:root {
  color-scheme: light;
  --brand: #0a6dee;
  --brand-hover: #0552b7;
  --brand-soft: #eff6ff;
  --ink: #203247;
  --muted: #5e6e82;
  --background: #f5f7fa;
  --surface: #ffffff;
  --border: #e1e7ef;
  --border-strong: #c4d1e1;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 12px 40px #2032470a;
}
.login-logo {
  display: block;
  width: 190px;
  height: auto;
  margin: 0 auto 28px;
}
.login-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}
.login-card p {
  color: var(--muted);
}
.login-card form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
.login-card label {
  font-weight: 600;
}
.login-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: inherit;
  margin-bottom: 8px;
}
.login-card input:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.login-card button {
  background: var(--brand);
  color: white;
  border-radius: 8px;
  padding: 12px;
}
.login-card button:hover {
  background: var(--brand-hover);
}
button,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  min-height: 44px;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 4px;
}
button:active:enabled {
  box-shadow: inset 0 0 0 2px #2032471a;
}
[hidden] {
  display: none !important;
}
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 96px;
  padding: 20px 0;
  gap: 24px;
}
.topbar::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 calc((100% - 100vw) / 2);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 24px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
}
.brand-logo {
  display: block;
  width: 112px;
  height: auto;
}
.brand-label {
  border-left: 1px solid var(--border);
  padding: 12px 0 12px 24px;
  font-size: 13px;
  font-weight: 600;
}
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.topbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}
.topbar-button:hover:not(:disabled) {
  background: #eaf0f6;
  color: var(--ink);
}
.topbar-button-primary {
  background: var(--brand-soft);
  color: var(--brand-hover);
  font-weight: 600;
}
.topbar-button-primary:hover:not(:disabled) {
  background: #e0edff;
  color: var(--brand-hover);
}
.topbar-icon {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  mask: var(--icon) center / contain no-repeat;
}
.icon-history {
  --icon: url('/assets/icons/history.svg');
}
.icon-new {
  --icon: url('/assets/icons/add-comment.svg');
}
.icon-logout {
  --icon: url('/assets/icons/logout.svg');
}
.icon-chat {
  --icon: url('/assets/icons/chat.svg');
}
.icon-refresh {
  --icon: url('/assets/icons/refresh.svg');
}
.icon-delete {
  --icon: url('/assets/icons/delete.svg');
}
.log-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.log-detail-heading h2 {
  flex: 1;
  min-width: 160px;
}
.delete-log {
  color: #b42318;
}
.delete-log:hover:not(:disabled) {
  background: #fef3f2;
  color: #912018;
}
.secondary {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--brand-hover);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
}
.secondary:hover:enabled {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}
.nav-button:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.logs-heading {
  flex-wrap: wrap;
}
.logs-status,
.log-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.logs-status {
  margin: 0 0 16px;
}
.logs-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding-bottom: 32px;
}
.logs-sidebar,
.log-detail {
  min-width: 0;
}
.logs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.logs-list button {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  color: var(--ink);
}
.logs-list button:hover,
.logs-list button[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.log-problem {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}
.log-card-meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
#more-logs {
  margin-top: 16px;
  width: 100%;
}
.log-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.log-detail h2 {
  margin: 0;
  font-size: 21px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.logged-message {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.logged-message-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.logged-message.user .message-text {
  background: var(--brand-soft);
  padding: 12px 16px;
  border-radius: 8px;
}
main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 32px 0 24px;
}
.eyebrow {
  color: var(--brand-hover);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin: 0 0 8px;
}
h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.8px;
  font-weight: 650;
}
.subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 8px 0 0;
}
.conversation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  min-height: 360px;
  height: clamp(360px, 48dvh, 650px);
  overflow-y: auto;
  padding: 32px;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}
.welcome {
  max-width: 560px;
  margin: 16px auto 8px;
  text-align: center;
}
h2 {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.5px;
  margin: 24px 0 12px;
}
.welcome p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
}
.examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0 16px;
}
.examples > span {
  grid-column: 1 / -1;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.examples button {
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.examples button span {
  color: var(--brand-hover);
  font-size: 18px;
}
.examples button:hover:enabled {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.welcome .escalation {
  font-size: 12px;
}
.message {
  display: flex;
  gap: 16px;
  margin: 0 auto 32px;
  max-width: 800px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--brand-soft) url('/assets/support.svg') center / 20px
    no-repeat;
  color: var(--brand-hover);
  font-size: 0;
}
.message.user .avatar {
  background: #edf1f6;
  color: #4e6076;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.message-body {
  min-width: 0;
  flex: 1;
}
.message-name {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin: 8px 0 12px;
  color: var(--muted);
}
.message-text {
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  tab-size: 2;
}
.message.assistant .message-text {
  padding: 0 0 0 16px;
  border-left: 2px solid #cee1fb;
}
.message.user .message-text {
  background: #f1f5fb;
  padding: 12px 16px;
  border: 1px solid #e7edf5;
  border-radius: 0 10px 10px 10px;
}
.loading {
  display: flex;
  align-items: center;
  max-width: 800px;
  margin: 16px auto;
  color: var(--brand-hover);
  font-size: 13px;
  line-height: 1.6;
}
.pulse {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.composer-area {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 0 24px;
}
.composer {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  padding: 4px;
  background: var(--surface);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}
.composer:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #0a6dee18;
}
textarea {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  resize: none;
  height: 44px;
  min-height: 44px;
  max-height: 200px;
  border: 0;
  padding: 10px 16px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 24px;
}
textarea:focus-visible {
  outline: none;
}
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.composer-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  align-self: flex-end;
}
#input-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
#send {
  background: var(--brand);
  color: white;
  border-radius: 14px;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#send:hover:enabled {
  background: var(--brand-hover);
}
#send .send-icon {
  display: block;
  width: 22px;
  height: 22px;
  background-color: currentColor;
  mask: url('/assets/icons/send.svg') center / contain no-repeat;
}
.disclaimer {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  margin: 12px 0 0;
}
main:has(#welcome:not([hidden])) {
  padding-bottom: clamp(80px, 16dvh, 160px);
}
main:has(#welcome:not([hidden])) .conversation {
  height: auto;
  min-height: 0;
  margin-top: auto;
  padding: 24px 0 0;
  border: 0;
  background: transparent;
}
main:has(#welcome:not([hidden])) .welcome {
  margin: 0 auto 8px;
}
main:has(#welcome:not([hidden])) .composer-area {
  margin-bottom: auto;
}
.error,
.context-notice {
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 0 0 16px;
  background: #fffaee;
  color: #775719;
  border: 1px solid #efddb5;
  border-left-width: 3px;
  overflow-wrap: anywhere;
}
.error {
  background: #fff4f3;
  color: #a1342f;
  border-color: #efcfcb;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  padding: 20px 0 24px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1000px) {
  .app {
    padding: 0 24px;
  }
  .brand {
    gap: 16px;
  }
  .brand-label {
    padding-left: 16px;
  }
  .conversation {
    padding: 24px;
  }
}
@media (max-width: 700px) {
  .logs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .logs-list {
    max-height: 35dvh;
    overflow-y: auto;
  }
  .log-detail {
    padding: 16px;
  }
  .app {
    padding: 0 16px;
  }
  .topbar {
    padding: 16px 0;
    min-height: 0;
    flex-wrap: wrap;
    gap: 16px;
  }
  .brand-logo {
    width: 96px;
  }
  .brand-label {
    font-size: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .topbar-actions {
    width: 100%;
  }
  .topbar-actions .topbar-button {
    flex: 1;
    justify-content: center;
  }
  .heading {
    margin: 24px 0;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1.2px;
  }
  .subtitle {
    font-size: 13px;
  }
  .conversation {
    padding: 24px 16px;
    height: 48dvh;
    min-height: 400px;
  }
  .welcome {
    margin-top: 0;
  }
  h2 {
    font-size: 22px;
    margin-top: 16px;
  }
  .examples {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 20px;
  }
  .examples button {
    padding: 12px 16px;
  }
  .message {
    gap: 12px;
    margin-bottom: 24px;
  }
  .avatar {
    width: 32px;
    height: 32px;
  }
  .message-text {
    font-size: 14px;
    line-height: 1.8;
  }
  .message.assistant .message-text {
    padding-left: 12px;
  }
  .composer-area {
    padding: 16px 0 24px;
  }
  .composer {
    padding: 4px;
  }
  textarea {
    font-size: 16px;
  }
  #input-help {
    max-width: 155px;
    font-size: 10px;
  }
  #send {
    padding: 0;
  }
  footer {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 10px;
    padding: 16px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

.sim-home {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: clamp(48px, 12vh, 128px) 0 40px;
}

.sim-home h1 {
  margin: 0 0 24px;
}

.sim-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.sim-option {
  display: grid;
  place-items: center;
  min-height: 88px;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

a.sim-option:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
