:root {
  --bg-1: #ffffff;
  --bg-2: #f4f6f8;
  --bg-3: #e7ebef;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(17, 24, 39, 0.12);
  --text: #122228;
  --muted: #45616b;
  --accent: #0e8d95;
  --accent-strong: #0b6369;
  --danger: #af2c2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: linear-gradient(
    160deg,
    var(--bg-1) 0%,
    var(--bg-2) 60%,
    var(--bg-3) 100%
  );
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(17, 24, 39, 0.04), transparent 30%),
    radial-gradient(circle at 85% 75%, rgba(17, 24, 39, 0.06), transparent 35%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 24px;
  backdrop-filter: blur(8px);
}

.sidebar h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.5px;
}

.subtitle {
  margin-top: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.4;
}

.field-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: #22313a;
}

.sidebar input,
.sidebar select,
.sidebar button {
  width: 100%;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.18);
}

.sidebar input[type="text"],
.sidebar input[type="password"],
.sidebar select {
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--text);
  background: #ffffff;
}

.sidebar select option {
  color: #122228;
  background: #ffffff;
}

.temp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

#temperatureValue {
  min-width: 44px;
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
}

#analyzeButton {
  margin-top: 20px;
  padding: 11px 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(120deg, #dbe2ea, #c4cfda);
  color: #0f172a;
  font-weight: 700;
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

#analyzeButton:hover {
  transform: translateY(-1px);
  filter: saturate(1.02);
}

.small-note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.main-content {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 12px 35px rgba(17, 24, 39, 0.08);
  animation: rise 360ms ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel h2 {
  margin: 0 0 12px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 12px;
  padding: 12px;
  font-size: 1rem;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: #ffffff;
}

.status {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
  font-weight: 700;
}

.summary {
  margin-bottom: 12px;
  color: var(--muted);
}

.token-grid {
  display: grid;
  gap: 10px;
}

.token-card {
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.token-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.token-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  color: #334155;
}

.token-text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
  color: #0f172a;
  word-break: break-word;
}

.embedding-preview {
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: #475569;
}

details {
  margin-top: 8px;
}

details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.embedding-full {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  background: #f8fafc;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.42;
  color: #0f172a;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(17, 24, 39, 0.12);
  }
}
