:root {
  --ink: #172033;
  --muted: #65728a;
  --cream: #f6f1e8;
  --sand: #efe4d3;
  --signal: #ce5f36;
  --signal-dark: #973d1c;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(23, 32, 51, 0.12);
  --shadow: 0 20px 45px rgba(23, 32, 51, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(206, 95, 54, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(67, 142, 154, 0.18), transparent 24%),
    linear-gradient(180deg, #f4ecde 0%, #f8f4ee 100%);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.topbar,
.split-panel,
.search-row,
.session-badge {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.topbar {
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--signal-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.main-content {
  display: grid;
  gap: 1.25rem;
}

.panel,
.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel {
  padding: 1.25rem;
}

.hero-card {
  display: grid;
  gap: 1.5rem;
  padding: 1.75rem;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
}

.login-panel {
  padding: 1.5rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(239, 228, 211, 0.9));
  display: grid;
  place-items: center;
  gap: 1rem;
}

.body-copy,
.muted {
  color: var(--muted);
}

.button {
  border: none;
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  background: var(--signal);
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

input[type="search"] {
  flex: 1 1 280px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  padding: 0.82rem 1rem;
  font: inherit;
}

.table-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 1fr 1fr 0.9fr;
  gap: 0.65rem 0.9rem;
  align-items: start;
}

.usage-grid {
  grid-template-columns: 1fr repeat(4, 0.8fr);
}

.table-head {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.table-cell {
  padding: 0.35rem 0;
}

.strong {
  font-weight: 700;
}

.meta-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.meta-item {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.meta-key {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.timeline {
  display: grid;
  gap: 0.85rem;
}

.message-card {
  border-radius: 18px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}

.role-user {
  border-left: 6px solid rgba(206, 95, 54, 0.8);
}

.role-assistant {
  border-left: 6px solid rgba(67, 142, 154, 0.8);
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.media-list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.error-text {
  color: #8b1e14;
  text-align: center;
}

.empty-state {
  color: var(--muted);
  padding: 1rem 0;
}

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

  .table-grid,
  .usage-grid {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: none;
  }

  .table-cell {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
  }
}
