/* ============================================================
   Dashboard (console) — original design, offline, demo mode.
   Variables the original referenced but never defined
   (--ink-base, --sand-border, --danger, --border-subtle) are
   defined here; a missing @keyframes spin is added.
   ============================================================ */

body.tone-dashboard {
  --ink-base: var(--ink-parchment);
  --sand-border: var(--line-parchment);
  --sand-card-subtle: #FAF9F5;
  --border-subtle: var(--line-subtle);
  --danger: #f87171;
  --theme-parchment: #F4F3EE;
  --theme-sand: #EAE8E0;
  --theme-sand-dark: #DDD9CE;
  background-color: #F4F3EE;
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.45) 0%, rgba(0, 0, 0, 0.015) 100%);
  color: var(--ink-parchment);
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes drawerSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gptMenuFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinkingBounce {
  0%,
  80%,
  100% {
    transform: scale(0.4);
    opacity: 0.3;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes reasoningPulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

body.tone-dashboard a {
  text-decoration: none;
}

.dashboard-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #F4F3EE;
  border-bottom: 1px solid var(--line-parchment);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--line-parchment);
}

.nav-breadcrumb {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft-parchment);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-center-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft-parchment);
}

.nav-center-links a {
  transition: color 0.15s ease;
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
}

.nav-center-links a:hover,
.nav-center-links a.active {
  color: var(--ink-parchment);
}

.nav-center-links a.active::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink-parchment);
  border-radius: 2px;
}

.nav-user-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-return-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft-parchment);
  padding: 5px 12px;
  border-radius: 980px;
  border: 1px solid var(--line-parchment);
  background: #fff;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.site-return-link:hover {
  color: var(--ink-parchment);
  border-color: var(--ink-soft-parchment);
}

#user-button-mount {
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.user-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 980px;
  border: 1px solid var(--line-parchment);
  background: #fff;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-parchment);
  cursor: pointer;
}

.user-profile .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink-parchment);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 28px 64px;
  width: 100%;
}

.dashboard-header {
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-parchment);
}

.welcome-title-wrap h1 {
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #1F1E1B;
}

.welcome-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft-parchment);
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 5px;
  border-radius: 9999px;
  background: #ffffff;
  color: var(--ink-parchment);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  letter-spacing: -0.01em;
  transition: all 0.15s ease;
}

.plan-pill:hover {
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.plan-badge-tier {
  font-weight: 700;
  color: #1F1E1B;
  background: #EAE8E0;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  letter-spacing: -0.01em;
}

.plan-badge-status {
  font-weight: 500;
  color: #373631;
  padding-right: 2px;
  font-size: 12px;
}

.endpoint-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 10px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #1F1E1B;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.endpoint-pill code {
  color: #1F1E1B;
}

.copy-btn {
  background: #F4F3EE;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft-parchment);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.copy-btn:hover {
  border-color: #1F1E1B;
  color: #1F1E1B;
  background: #ffffff;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 32px;
}

.bento-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px -2px rgba(45, 40, 30, 0.06), 0 1px 3px rgba(45, 40, 30, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bento-card:hover {
  box-shadow: 0 6px 24px -2px rgba(45, 40, 30, 0.09), 0 2px 6px rgba(45, 40, 30, 0.04);
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-stat-big {
  font-size: clamp(32px, 3.8vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink-parchment);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.card-stat-desc {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.stat-unit {
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-soft-parchment);
  margin-left: 2px;
}

.feature-visual {
  background: #FAF9F5;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: 14px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.meter {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 74px;
  margin-bottom: 12px;
  width: 100%;
}

.meter div {
  flex: 1;
  min-width: 6px;
  background: #7E7A71;
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
  cursor: pointer;
}

.meter div.latest {
  background: #1F1E1B;
}

.meter div:hover {
  background: #1F1E1B;
}

.meter-empty {
  width: 100%;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink-muted);
  border: 1px dashed var(--sand-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.015);
  text-align: center;
  padding: 0 12px;
}

.meter-caption {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  line-height: 1.2;
}

.meter div.selected {
  background: #1F1E1B;
  transform: scaleY(1.06);
  box-shadow: 0 0 0 2px #FAF8F5, 0 0 0 4px #1F1E1B;
  z-index: 2;
}

.meter div.dimmed {
  opacity: 0.22;
}

.model-breakdown-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.model-breakdown-empty {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-style: italic;
}

.model-call-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-soft-parchment);
  background: #EFECE3;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.model-call-chip:hover {
  background: #E5E1D5;
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--ink-base);
}

.model-call-chip.active {
  background: #1F1E1B;
  color: #FAF8F5;
  border-color: #1F1E1B;
}

.model-call-chip .chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-base);
}

.model-call-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.2);
  color: #FAF8F5;
}

.region-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.reg-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F4F3EE;
  border: 1px solid rgba(0, 0, 0, 0.07);
  color: var(--ink-soft-parchment);
  font-family: var(--font-mono);
}

.chip-tag {
  font-family: var(--font-sans);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title-wrap h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink-parchment);
}

.playground-section {
  margin-bottom: 36px;
  scroll-margin-top: 84px;
}

.playground-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.playground-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gpt-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gpt-model-dropdown-wrap {
  position: relative;
}

.gpt-model-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-parchment);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  font-family: var(--font-mono);
}

.gpt-model-selector-btn:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.gpt-chevron {
  color: var(--ink-soft-parchment);
  transition: transform 0.2s ease;
}

.gpt-model-dropdown-wrap.open .gpt-chevron {
  transform: rotate(180deg);
}

.gpt-model-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 240px;
  max-height: 380px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.04);
  padding: 6px;
  z-index: 100;
}

.gpt-model-menu.open {
  display: block;
  animation: gptMenuFade 0.15s ease;
}

.gpt-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  font-family: inherit;
}

.gpt-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.gpt-menu-item.active {
  background: rgba(10, 132, 255, 0.08);
}

.gpt-menu-item-name {
  font-size: 13px;
  color: var(--ink-parchment);
  font-weight: 500;
  font-family: var(--font-mono);
}

.gpt-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gpt-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ink-soft-parchment);
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
}

.gpt-action-pill:hover {
  color: var(--ink-parchment);
  border-color: rgba(0, 0, 0, 0.16);
}

.playground-drawer {
  display: none;
  padding: 14px 20px;
  background: #FAF9F5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.playground-drawer.open {
  display: block;
  animation: drawerSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
}

.drawer-textarea {
  width: 100%;
  height: 72px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-parchment);
  resize: none;
  outline: none;
  line-height: 1.4;
}

.drawer-textarea:focus {
  border-color: #0a84ff;
}

.drawer-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.drawer-ctrl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-soft-parchment);
}

.chat-thread-container {
  height: 480px;
  max-height: 560px;
  overflow-y: auto;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  background: #fff;
}

.chat-thread-container::-webkit-scrollbar {
  width: 6px;
}

.chat-thread-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 10px;
}

.chat-stream-inner {
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: auto 0;
  width: 100%;
  padding: 130px 16px 40px;
}

.chat-empty-headline {
  font-size: 28px;
  font-weight: 500;
  color: #0d0d0d;
  letter-spacing: -0.018em;
  line-height: 1.3;
  user-select: none;
}

.msg-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.msg-group.user {
  align-items: flex-end;
}

.msg-bubble-user {
  background: #F4F3EE;
  color: var(--ink-parchment);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 18px;
  border-radius: 20px 20px 4px 20px;
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 76%;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.msg-bubble-assistant {
  background: #fff;
  border: 1px solid var(--line-parchment);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft-parchment);
  max-width: 90%;
}

.msg-group.assistant {
  align-items: flex-start;
  width: 100%;
}

.assistant-content-wrap {
  width: 100%;
  max-width: 100%;
}

.msg-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-parchment);
  word-break: break-word;
}

.msg-body p {
  margin: 0 0 0.85em;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

.msg-body code:not(pre code) {
  background: #ECE9E1;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #1F1E1B;
}

.code-block-wrapper {
  background: #161614;
  border-radius: 12px;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #22211E;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #9C9A94;
  font-size: 11.5px;
  font-family: var(--font-mono);
}

.code-copy-btn {
  color: #A8A69E;
  font-size: 11.5px;
  padding: 3px 6px;
  border-radius: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}

.code-copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.code-block-wrapper pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: transparent;
  color: #FAF9F5;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}

.msg-actions-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}

.msg-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-parchment);
}

.thinking-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-soft-parchment);
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1F1E1B;
  animation: thinkingBounce 1.2s infinite ease-in-out both;
}

.thinking-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.thinking-dot:nth-child(3) {
  animation-delay: -0.32s;
}

.reasoning-block {
  margin-bottom: 12px;
  max-width: 100%;
}

.reasoning-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #FAF9F5;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  padding: 5px 12px 5px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft-parchment);
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.reasoning-toggle:hover {
  background: #EAE8E0;
  color: var(--ink-parchment);
  border-color: rgba(0, 0, 0, 0.18);
}

.reasoning-toggle.thinking-active {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
  color: #4338ca;
}

.reasoning-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reasoning-spark-icon {
  width: 13px;
  height: 13px;
  color: #6366f1;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.reasoning-toggle.thinking-active .reasoning-spark-icon {
  animation: reasoningPulse 1.4s infinite ease-in-out;
  color: #4f46e5;
}

.reasoning-badge-text {
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.01em;
}

.reasoning-badge-timer {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.reasoning-toggle.thinking-active .reasoning-badge-timer {
  color: #6366f1;
  font-weight: 600;
}

.reasoning-chevron {
  width: 12px;
  height: 12px;
  color: var(--ink-muted);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  margin-left: 1px;
}

.reasoning-block.collapsed .reasoning-chevron {
  transform: rotate(-90deg);
}

.reasoning-dropdown {
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, margin-top 0.2s ease;
  max-height: 2500px;
  opacity: 1;
  margin-top: 8px;
}

.reasoning-block.collapsed .reasoning-dropdown {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.reasoning-content {
  border-left: 2px solid rgba(99, 102, 241, 0.4);
  background: rgba(250, 249, 245, 0.85);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #57534E;
  word-break: break-word;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.reasoning-content p {
  margin: 0 0 0.6em;
}

.reasoning-content p:last-child {
  margin-bottom: 0;
}

.reasoning-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.playground-input-dock {
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 20px 16px;
  border-radius: 0 0 20px 20px;
}

.chat-input-capsule {
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  background: #FAF9F5;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 26px;
  padding: 10px 14px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.chat-input-capsule:focus-within {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.chat-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink-parchment);
  outline: none;
  resize: none;
  min-height: 24px;
  max-height: 140px;
  line-height: 1.5;
  padding: 2px 0;
}

.chat-textarea::placeholder {
  color: #9C9A94;
}

.capsule-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.capsule-left-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.capsule-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft-parchment);
  font-family: var(--font-mono);
}

.btn-send-chat {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.3);
  cursor: not-allowed;
  transition: all 0.15s ease;
}

.btn-send-chat.active {
  background: #1F1E1B;
  color: #FAF9F5;
  cursor: pointer;
}

.btn-send-chat.active:hover {
  background: #000000;
  transform: scale(1.04);
}

.inline-banner {
  display: none;
  max-width: 760px;
  width: 100%;
  margin: 0 auto 10px;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.inline-banner .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.banner-amber {
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #92400e;
}

.banner-red {
  background: #fef2f2;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}

.banner-amber a,
.banner-red a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #fff;
  background: #000;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 11.5px;
  white-space: nowrap;
}

.key-warning {
  margin: 24px auto;
  max-width: 520px;
  padding: 22px 26px;
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.28);
}

.key-warning h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-base);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.key-warning p {
  font-size: 13px;
  color: var(--ink-soft-parchment);
  margin: 0 0 16px;
  line-height: 1.5;
}

.banner-amber .callout,
.banner-red .callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
}

.table-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px -2px rgba(45, 40, 30, 0.06), 0 1px 3px rgba(45, 40, 30, 0.03);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

table.data-table th {
  background: #FAF9F5;
  padding: 13px 20px;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

table.data-table td {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--ink-parchment);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tr:hover td {
  background: rgba(244, 243, 238, 0.6);
}

.key-display {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #F4F3EE;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ink-parchment);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-parchment);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid transparent;
}

.status-indicator-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.status-indicator-badge.expired {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.status-indicator-badge.expired::before {
  background: var(--danger);
}

.status-indicator-badge.test {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.25);
}

.status-indicator-badge.test::before {
  background: #3b82f6;
}

.key-type-tag {
  display: inline-block;
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--ink-muted);
  margin-left: 6px;
  font-weight: normal;
  vertical-align: middle;
}

.key-type-tag.production {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.status-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

.status-code.status-err {
  color: #dc2626;
  background: #fef2f2;
}

.status-code.status-warn {
  color: #d97706;
  background: #fffbeb;
}

.action-btn-subtle {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #373631;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.action-btn-subtle:hover {
  color: #000000;
  border-color: rgba(0, 0, 0, 0.25);
  background: #FAF9F5;
}

.action-btn-danger {
  background: #ffffff;
  border: 1px solid rgba(220, 38, 38, 0.18);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.action-btn-danger:hover {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.38);
  background: #fef2f2;
}

.btn-create-key {
  background: #1F1E1B;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-create-key:hover {
  background: #000000;
  transform: translateY(-0.5px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}

.code-card {
  background: #191816;
  border-radius: 16px;
  padding: 22px 24px;
  color: #FAF9F5;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  box-shadow: 0 4px 20px -2px rgba(45, 40, 30, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.code-card pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #FAF9F5;
  white-space: pre-wrap;
  overflow-x: auto;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #8e8e93;
  font-size: 12px;
  font-family: var(--font-sans);
}

.traffic-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.c-comment {
  color: #8A877D;
}

.c-keyword {
  color: #ff7b72;
}

.c-fn {
  color: #d2a8ff;
}

.c-str {
  color: #a5d6ff;
}

.c-num {
  color: #79c0ff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 30, 27, 0.45);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 45px rgba(35, 30, 20, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-card h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--ink-parchment);
}

.modal-card p {
  font-size: 13.5px;
  color: var(--ink-soft-parchment);
  line-height: 1.45;
  margin-bottom: 20px;
}

.modal-card code {
  background: #F4F3EE;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-parchment);
  margin-bottom: 20px;
  outline: none;
  background: #F4F3EE;
  transition: border-color 0.15s ease;
}

.modal-input:focus {
  border-color: var(--accent);
  background: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.btn-secondary-modal {
  background: #F4F3EE;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--ink-parchment);
  padding: 9px 16px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary-modal {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary-modal:hover {
  background: #0972d9;
}

.plan-box {
  background: #F9F9F8;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.plan-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft-parchment);
  line-height: 1.8;
}

.modal-overlay .btn-primary-modal {
  background: #1F1E1B;
  color: #fff;
}

.modal-overlay .btn-primary-modal:hover {
  background: #000;
}

.dashboard-footer {
  border-top: 1px solid var(--line-parchment);
  padding: 32px 0;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.dashboard-footer .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-footer a {
  color: var(--ink-soft-parchment);
}

.dashboard-footer a:hover {
  color: var(--ink-parchment);
}

@media (max-width: 960px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .telemetry-grid {
    grid-template-columns: 1fr;
  }
  .nav-center-links {
    display: flex !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 14px;
    font-size: 12px;
    padding: 4px 0;
  }
  .nav-center-links::-webkit-scrollbar {
    display: none;
  }
  .brand-cluster .nav-breadcrumb,
  .brand-cluster .nav-divider {
    display: none;
  }
  .drawer-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .nav-container {
    padding: 0 12px;
  }
  .nav-center-links a:nth-child(n + 6) {
    display: none;
  }
  .dashboard-main {
    padding: 24px 14px 48px;
  }
  .playground-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
