/* ===== THEME TOKENS ===== */
:root {
  --bg: #000;
  --surface-low: #0a0a0a;
  --surface-mid: #141414;
  --surface-high: #1f1f1f;
  --hero-logo-bg: #0d0d0d;

  --text-main: #fff;
  --text-dim: #a0a0a0;
  --text-muted: #666;

  --nothing-red: #ff2d37;
  --nothing-green: #00ff88;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.04);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition: 0.5s var(--ease);

  --dot-bg: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}

[data-theme="light"] {
  --bg: #f4f4f4;
  --surface-low: #fff;
  --surface-mid: #eee;
  --surface-high: #e0e0e0;
  --hero-logo-bg: #e9e9e9;

  --text-main: #000;
  --text-dim: #444;
  --text-muted: #777;

  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(0, 0, 0, 0.03);

  --dot-bg: radial-gradient(circle, rgba(0, 0, 0, 0.08) 1px, transparent 1px);
}

/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.62;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}

/* ===== BACKGROUND ===== */
.nt-canvas {
  position: fixed;
  inset: 0;
  background-image: var(--dot-bg);
  background-size: 28px 28px;
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 900px;
  z-index: 9999;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 16px;

  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.4s var(--ease);
}

.nav-brand {
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-main);
  transition: color var(--transition), background var(--transition);
  margin-right: auto;
}

.nav-menu {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-mid);
  color: var(--text-main);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--surface-low);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-mid);
  border-color: var(--text-dim);
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1000px;
  margin: auto;
  padding: 100px 20px 60px;
}

.grid-interface {
  display: block;
}

.widget {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 20px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.hero-widget {
  background: var(--hero-logo-bg);
}

/* ===== HERO ===== */
.hero-title {
  font-size: 40px;
  margin-bottom: 10px;
  color: var(--text-main);
  letter-spacing: -0.03em;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.dot-matrix {
  font-size: 14px;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
}

.hero-logo {
  display: block;
  width: min(100%, 420px);
  height: auto;
  object-fit: contain;
}

.hero-desc {
  color: var(--text-dim);
}

/* ===== STATUS ===== */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--nothing-green);
  background: transparent;
  padding: 6px 0;
  width: fit-content;
  margin-bottom: 18px;
  font-weight: 700;
  white-space: nowrap;
  user-select: none;
  border: none;
}

.red-dot {
  width: 8px;
  height: 8px;
  background: var(--nothing-green);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: strobe 2s infinite;
}

#status-text {
  display: inline-block;
  min-width: 140px;
  color: var(--text-main);
}

/* ===== LABEL ===== */
.label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.codesentinel-widget > .label {
  color: #fff;
}

[data-theme="light"] .codesentinel-widget > .label {
  color: #111;
}

/* ===== HEADER ===== */
.play-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  gap: 12px;
  flex-wrap: wrap;
}

.play-title {
  font-size: 22px;
  color: var(--text-main);
}

.section-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.play-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  height: 18px;
  border-radius: 20px;
  font-size: 10px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--glass-border);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
}

.chip b {
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
}



/* ===== GRID ===== */
.play-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 800px) {
  .play-grid {
    grid-template-columns: 1fr;
  }
}

.codesentinel-widget {
  --codesentinel-debug-height: 808px;
  --codesentinel-fix-height: 808px;
  --advanced-stats-extra: 0px;
}

/* ===== PANEL ===== */
.play-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 15px;
  transition: background var(--transition), border-color var(--transition), transform 0.35s var(--ease);
}

.response-panel {
  display: flex;
  flex-direction: column;
  height: calc(var(--codesentinel-debug-height) + var(--advanced-stats-extra));
  min-height: calc(var(--codesentinel-debug-height) + var(--advanced-stats-extra));
  transition: height 0.3s ease, min-height 0.3s ease, background var(--transition), border-color var(--transition), transform 0.35s var(--ease);
}

.input-panel {
  display: flex;
  flex-direction: column;
  height: calc(var(--codesentinel-debug-height) + var(--advanced-stats-extra));
  min-height: calc(var(--codesentinel-debug-height) + var(--advanced-stats-extra));
  padding: 15px;
  transition: height 0.3s ease, min-height 0.3s ease, background var(--transition), border-color var(--transition), transform 0.35s var(--ease);
}

.codesentinel-widget.mode-fix .response-panel,
.codesentinel-widget.mode-fix .input-panel {
  height: var(--codesentinel-fix-height);
  min-height: var(--codesentinel-fix-height);
}

.codesentinel-widget.mode-debug.advanced-stats-visible {
  --advanced-stats-extra: 340px;
}

.input-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
}

.panel-main-label {
  margin-bottom: 10px;
}

.fix-panel-label {
  margin-bottom: 2px;
}

.api-register-card {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 18px;
  align-items: stretch;
}

.api-register-intro {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.api-register-intro .play-title {
  margin-bottom: 10px;
}

.api-register-intro .section-desc {
  max-width: 760px;
  margin-bottom: 0;
}

.api-register-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
  height: 100%;
}

.api-register-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.api-start-card {
  min-height: 100%;
  height: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(10, 10, 10, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 28px -24px rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
}

.api-start-title {
  color: #fff !important;
  letter-spacing: 0.18em;
}

.api-start-divider {
  height: 1px;
  margin-top: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.api-start-steps {
  margin: 12px 0 14px;
  padding-left: 32px;
  color: #fbfbfb;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.api-start-steps li + li {
  margin-top: 7px;
}

.api-start-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 200, 87, 0.22);
  background: rgba(255, 200, 87, 0.06);
  color: #ffd980;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  text-align: justify;
}

.api-start-warning-icon {
  flex: 0 0 auto;
  color: #ffc857;
  font-size: 14px;
  line-height: 1.2;
}

.api-start-help {
  margin: 15px 0 16px;
  color: #8ccfff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.api-start-help code {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(114, 193, 255, 0.32);
  background: rgba(57, 143, 255, 0.1);
  color: #b8e2ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.api-start-links {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.api-access-link {
  --provider-accent: rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.96), rgba(15, 15, 15, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px -20px rgba(0, 0, 0, 0.95);
  color: #f6f6f6;
  text-decoration: none;
  transition:
    transform 0.24s var(--ease),
    border-color 0.24s var(--ease),
    background 0.24s var(--ease),
    box-shadow 0.24s var(--ease);
}

.api-access-link:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--provider-accent) 50%, rgba(255, 255, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 24px -22px rgba(0, 0, 0, 0.95),
    0 0 0 1px color-mix(in srgb, var(--provider-accent) 18%, transparent);
}

.api-access-link.is-active {
  border-color: color-mix(in srgb, var(--provider-accent) 62%, rgba(255, 255, 255, 0.1));
  background: linear-gradient(180deg, color-mix(in srgb, var(--provider-accent) 12%, #1b1b1b), #121212);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px color-mix(in srgb, var(--provider-accent) 24%, transparent),
    0 16px 24px -24px rgba(0, 0, 0, 0.96);
}

.api-access-link[data-provider="gemini"].is-active,
.api-access-link[data-provider="gemini"]:hover {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(12, 12, 12, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
}

.api-access-mark {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0c0c0c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.api-access-link[data-provider="gemini"].is-active .api-access-mark,
.api-access-link[data-provider="gemini"]:hover .api-access-mark {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(15, 15, 15, 0.98), rgba(9, 9, 9, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
}

.api-access-logo {
  width: 17px;
  height: 17px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

.api-access-link[data-provider="openai"] .api-access-logo {
  filter: drop-shadow(0 4px 10px rgba(116, 170, 156, 0.28));
}

.api-access-link[data-provider="xai"] .api-access-logo {
  filter:
    brightness(0) invert(1)
    drop-shadow(0 4px 10px rgba(255, 255, 255, 0.12));
}

.api-access-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}

.api-access-name {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f7f7f7;
}

.api-register-form {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  overflow: visible;
}

.api-future-card {
  flex: 1 0 auto;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.beta-access-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-color: rgba(255, 200, 87, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 0 1px rgba(255, 200, 87, 0.16),
      0 0 22px -14px rgba(255, 200, 87, 0.68);
}

.beta-access-card:not(.is-ready) {
    border-color: rgba(255, 200, 87, 0.44);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 0 1px rgba(255, 200, 87, 0.26),
      0 0 0 2px rgba(255, 200, 87, 0.08),
      0 0 30px -14px rgba(255, 200, 87, 0.9);
}

.beta-access-copy {
  margin: 0;
  color: #f5f5f5;
  font-size: 13px;
  line-height: 1.55;
}

.beta-access-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--text-main);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  box-shadow: 0 0 0 1px var(--glass-border);
  transition: background var(--transition), color var(--transition), box-shadow 0.22s var(--ease), opacity 0.22s var(--ease);
}

.beta-access-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--nothing-green);
}

.beta-access-card:not(.is-ready) .beta-access-input {
    border-color: rgba(255, 200, 87, 0.36);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.03),
      0 0 0 1px rgba(255, 200, 87, 0.18);
}

.beta-access-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.beta-access-actions {
  margin-top: 2px;
  margin-bottom: 6px;
}

.beta-access-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

#betaAccessSubmitBtn {
  background: linear-gradient(180deg, #ffd970, #f0b92c);
  color: #121212;
  border: 1px solid rgba(255, 211, 105, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 16px -14px rgba(255, 200, 87, 0.65);
}

#betaAccessSubmitBtn:hover:not(:disabled) {
  filter: brightness(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 12px 20px -14px rgba(255, 200, 87, 0.72);
}

#betaAccessSubmitBtn:disabled {
  opacity: 0.7;
}

.beta-access-status {
  color: #ffd980;
  flex: 1 1 auto;
}

.beta-access-status-icon {
  color: #ffc857;
  margin-right: 6px;
}

.beta-access-status-text {
  color: #f5f5f5;
}

.beta-access-owner-inline {
  display: inline-block;
  white-space: nowrap;
}

.beta-access-owner-link {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.beta-access-owner-link:hover {
  opacity: 0.86;
}

.beta-access-status.is-ready {
  color: var(--nothing-green);
}

.beta-access-status.is-error {
  color: var(--nothing-red);
}

.beta-access-status.is-used-link {
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.beta-access-rank {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: right;
  color: #ffd970;
  font-size: 18px;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s ease, transform 0.2s ease, color var(--transition);
}

.beta-access-rank.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.beta-access-rank.is-master {
  color: #66d9ff;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(102, 217, 255, 0.28);
  animation: strobe 2s infinite;
}

.beta-access-card.is-ready {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 0 0 1px rgba(255, 255, 255, 0.03);
}

.api-widget.is-beta-locked .api-register-form {
  opacity: 0.52;
}

.api-widget.is-beta-locked .api-provider-option,
.api-widget.is-beta-locked #apiKeyInput,
.api-widget.is-beta-locked #apiSubmitBtn,
.api-widget.is-beta-locked #apiRemoveBtn {
  cursor: not-allowed;
}

.api-provider-grid {
  display: grid;
  grid-template-columns: repeat(5, 96px);
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  overflow: visible;
}

.api-provider-option {
  --provider-accent: rgba(255, 255, 255, 0.4);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 96px;
  min-height: 112px;
  padding: 12px 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #121212;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 20px -18px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  isolation: isolate;
  overflow: visible;
  transition:
    transform 0.26s var(--ease),
    box-shadow 0.26s var(--ease),
    border-color 0.26s var(--ease),
    background 0.26s var(--ease),
    filter 0.26s var(--ease);
}

.api-provider-option::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

.api-provider-option:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--provider-accent) 48%, rgba(255, 255, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 24px -18px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.api-provider-option.is-active {
  border-color: color-mix(in srgb, var(--provider-accent) 55%, rgba(255, 255, 255, 0.12));
  background: linear-gradient(180deg, color-mix(in srgb, var(--provider-accent) 10%, #161616), #101010);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 24px -18px rgba(0, 0, 0, 0.9),
    0 0 0 1px color-mix(in srgb, var(--provider-accent) 24%, transparent);
}

.api-provider-option[data-provider="gemini"].is-active {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(23, 24, 28, 0.98), rgba(11, 12, 15, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 24px -18px rgba(0, 0, 0, 0.9),
    0 0 18px -12px rgba(49, 134, 255, 0.4);
}

.api-provider-option[data-provider="gemini"]:hover {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(25, 26, 30, 0.98), rgba(12, 13, 16, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 24px -18px rgba(0, 0, 0, 0.9),
    0 0 14px -12px rgba(49, 134, 255, 0.35);
}

.api-provider-option[data-provider="gemini"]:hover .api-provider-mark,
.api-provider-option[data-provider="gemini"].is-active .api-provider-mark {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(12, 12, 12, 0.98), rgba(10, 10, 10, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
}

.api-provider-option:active {
  transform: translateY(1px) scale(0.98);
}

.api-provider-mark,
.api-provider-logo,
.api-provider-badge,
.api-provider-name,
.api-provider-tooltip {
  position: relative;
  z-index: 1;
}

.api-provider-mark {
  width: 100%;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #0a0a0a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.26s var(--ease), border-color 0.26s var(--ease), background 0.26s var(--ease);
}

.api-provider-logo {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  object-fit: contain;
  display: block;
  transition: transform 0.26s var(--ease), filter 0.26s var(--ease);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.36));
}

.api-provider-option:hover .api-provider-mark,
.api-provider-option.is-active .api-provider-mark {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--provider-accent) 30%, rgba(255, 255, 255, 0.1));
}

.api-provider-option:hover .api-provider-logo,
.api-provider-option.is-active .api-provider-logo {
  transform: translateY(-1px);
}

.api-provider-option[data-provider="openai"] .api-provider-logo {
  filter: drop-shadow(0 6px 12px rgba(116, 170, 156, 0.3));
}

.api-provider-option[data-provider="xai"] .api-provider-logo {
  filter:
    brightness(0) invert(1)
    drop-shadow(0 6px 12px rgba(255, 255, 255, 0.14));
}

.api-provider-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.api-provider-name {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  white-space: nowrap;
  line-height: 1.1;
}

.api-provider-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(10px) scale(0.96);
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    0 24px 42px -26px rgba(0, 0, 0, 0.92),
    0 0 30px -16px rgba(255, 255, 255, 0.28);
  color: var(--text-main);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.api-provider-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 1px);
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.api-provider-option:hover .api-provider-tooltip,
.api-provider-option:focus-visible .api-provider-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.api-key-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text-main);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  box-shadow: 0 0 0 1px var(--glass-border);
  transition: background var(--transition), color var(--transition), box-shadow 0.22s var(--ease);
}

.api-key-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--nothing-green);
}

.api-register-form.is-awaiting-api .api-key-input {
    border-color: rgba(176, 116, 255, 0.82);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 0 1px rgba(176, 116, 255, 0.64),
      0 0 34px -10px rgba(176, 116, 255, 1);
}

.api-register-form.is-awaiting-api .api-key-input:focus {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 0 1px rgba(196, 146, 255, 0.92),
      0 0 40px -8px rgba(196, 146, 255, 1);
}

.api-widget.is-awaiting-api .api-register-copy,
.api-widget.is-awaiting-api .beta-access-card.is-ready {
    opacity: 0.68;
}

.api-widget.is-awaiting-api .api-start-card,
.api-widget.is-awaiting-api .api-future-card.is-ready {
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.03),
      0 10px 20px -24px rgba(0, 0, 0, 0.9);
}

.api-widget.is-awaiting-api .api-start-card,
.api-widget.is-awaiting-api .beta-access-card.is-ready {
    filter: saturate(0.78) brightness(0.92);
}

.api-widget.is-awaiting-api .api-register-form {
    border-color: rgba(196, 146, 255, 0.26);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 0 0 1px rgba(196, 146, 255, 0.12),
      0 18px 32px -28px rgba(196, 146, 255, 0.58);
}

.api-register-actions {
  margin-top: 12px;
}

.api-remove-btn {
  background: transparent;
  color: var(--nothing-red);
  border: 1px solid rgba(255, 45, 55, 0.45);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition), border-color var(--transition), background var(--transition), opacity var(--transition);
}

.api-remove-btn:hover:not(:disabled) {
  background: rgba(255, 45, 55, 0.08);
  border-color: rgba(255, 45, 55, 0.72);
}

.api-remove-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.api-register-status {
  margin-top: 12px;
  color: var(--text-dim);
}

.api-provider-status-name {
  font-weight: 700;
}

.api-provider-name-gemini {
  background: linear-gradient(90deg, #fabc12 0%, #f94543 32%, #3186ff 68%, #08b962 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.api-provider-name-openai {
  color: #74aa9c;
}

.api-provider-name-xai {
  color: #b8beca;
}

.api-provider-name-claude {
  color: #f28b54;
}

.api-provider-name-deepseek {
  color: #4d6bfe;
}

.api-register-status.is-ready {
  color: var(--nothing-green);
}

.api-register-status.is-error {
  color: var(--nothing-red);
}

.api-privacy-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 136, 0.18);
  background: rgba(0, 255, 136, 0.04);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.codesentinel-widget.is-locked {
  opacity: 0.62;
}

.codesentinel-widget.is-locked .play-panel,
.codesentinel-widget.is-locked .play-chips {
  pointer-events: none;
}

.control-card {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition), border-color var(--transition), transform 0.3s var(--ease);
}

.input-stack .control-card:last-child {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.mode-card {
  padding-bottom: 12px;
}

.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.play-panel > .mono,
.control-card > .mono,
.fix-card > .mono,
.api-register-form > .mono,
.api-future-card > .mono,
.panel-main-label,
.advanced-stats-head .mono,
.stats-head .mono {
  color: #fff;
}

.beta-access-card > .mono {
  color: #ffe49a;
}

/* ===== CHAT ===== */
#chatBox {
  height: 304px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--glass-border);
  white-space: normal;
}

.codesentinel-widget.mode-debug #chatBox {
  height: 346px;
}

.chat-line {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.6;
}

.chat-line:first-child {
  margin-top: 0;
}

.chat-ai-reply {
  color: #9fd7ff;
  background: rgba(77, 163, 255, 0.08);
  border: 1px solid rgba(77, 163, 255, 0.18);
}

.chat-user-thought {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-clean-reply {
  color: var(--nothing-green);
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.18);
}

.chat-hint-reply {
  color: #ffe07a;
  background: rgba(245, 200, 76, 0.1);
  border: 1px solid rgba(245, 200, 76, 0.24);
}

.chat-hint-icon {
  margin-right: 6px;
}

.chat-wrong-reply {
  color: #ff9aa1;
  background: rgba(255, 45, 55, 0.08);
  border: 1px solid rgba(255, 45, 55, 0.2);
}

/* ===== INPUT ===== */
#codeInput,
.coach-input {
  width: 100%;
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px;
  color: var(--text-main);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  transition: background var(--transition), border-color var(--transition), color var(--transition), height 0.22s var(--ease), min-height 0.22s var(--ease), max-height 0.22s var(--ease), box-shadow 0.22s var(--ease);
  scrollbar-gutter: stable;
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
  box-shadow: 0 0 0 1px var(--glass-border);
}

#codeInput {
  height: 180px;
  resize: none;
  overflow: auto;
}

.coach-input {
  min-height: 42px;
  max-height: 202px;
  height: 42px;
  resize: none;
  overflow-y: hidden;
  overflow-x: hidden;
  line-height: 18px;
}

.codesentinel-widget.mode-fix .coach-input {
  max-height: 238px;
}

#codeInput,
.coach-input {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

#codeInput::-webkit-scrollbar,
.coach-input::-webkit-scrollbar {
  width: 8px;
}

#codeInput::-webkit-scrollbar-track,
.coach-input::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin: 6px 0;
}

#codeInput::-webkit-scrollbar-thumb,
.coach-input::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#codeInput::-webkit-scrollbar-corner,
.coach-input::-webkit-scrollbar-corner {
  background: transparent;
}

#codeInput:focus,
.coach-input:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--nothing-red);
}

/* ===== BUTTONS ===== */
.btn-row {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.mode-buttons {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.mode-card-buttons,
.input-actions,
.coach-actions {
  width: 100%;
}

.mode-card-buttons .btn-system,
.input-actions .btn-system,
.coach-actions .btn-system {
  flex: 1 1 0;
  justify-content: center;
}

.coach-actions {
  margin-top: 12px;
}

.debug-mode-shell {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 12px;
  gap: 10px;
  overflow: hidden;
}

.debug-mode-selector {
  --debug-mode-index: 0;
  --debug-mode-color: #00ff88;
  flex: 0 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.debug-mode-highlight {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  height: calc(100% - 8px);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  box-shadow: 0 0 18px -10px rgba(255, 255, 255, 0.15);
  transform: translateX(calc(var(--debug-mode-index) * 100%));
  transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
  pointer-events: none;
}

.debug-mode-selector[data-active="beginner"] .debug-mode-highlight {
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.2), rgba(0, 99, 55, 0.42));
  box-shadow: 0 0 24px -10px rgba(0, 255, 136, 0.34);
}

.debug-mode-selector[data-active="intermediate"] .debug-mode-highlight {
  background: linear-gradient(180deg, rgba(255, 200, 87, 0.22), rgba(122, 82, 8, 0.44));
  box-shadow: 0 0 24px -10px rgba(255, 200, 87, 0.34);
}

.debug-mode-selector[data-active="pro"] .debug-mode-highlight {
  background: linear-gradient(180deg, rgba(255, 45, 55, 0.24), rgba(112, 9, 16, 0.44));
  box-shadow: 0 0 24px -10px rgba(255, 45, 55, 0.34);
}

.debug-mode-option {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.24s ease, transform 0.24s ease, filter 0.24s ease;
}

.debug-mode-option:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}

.debug-mode-option.is-active {
  color: #f7f7f7;
  filter: brightness(1.02);
}

.debug-mode-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.016));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.24s ease, transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.debug-mode-card::-webkit-scrollbar {
  width: 6px;
}

.debug-mode-card::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin: 8px 0;
}

.debug-mode-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.debug-mode-section {
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.debug-mode-section-allowed {
  border-color: rgba(0, 255, 136, 0.2);
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.06), rgba(0, 255, 136, 0.015));
  box-shadow: inset 0 1px 0 rgba(0, 255, 136, 0.06);
}

.debug-mode-section-restricted {
  border-color: rgba(255, 45, 55, 0.2);
  background: linear-gradient(180deg, rgba(255, 45, 55, 0.06), rgba(255, 45, 55, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 45, 55, 0.06);
}

.debug-mode-section-bestfor {
  flex: 1 1 auto;
  border-color: rgba(127, 220, 255, 0.2);
  background: linear-gradient(180deg, rgba(127, 220, 255, 0.06), rgba(127, 220, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(127, 220, 255, 0.06);
}

.debug-mode-section-title {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.debug-mode-section-allowed .debug-mode-section-title {
  color: #b7ffe0;
  border-color: rgba(0, 255, 136, 0.22);
  background: rgba(0, 255, 136, 0.1);
}

.debug-mode-section-restricted .debug-mode-section-title {
  color: #ffc3c7;
  border-color: rgba(255, 45, 55, 0.22);
  background: rgba(255, 45, 55, 0.1);
}

.debug-mode-section-bestfor .debug-mode-section-title {
  color: #cdefff;
  border-color: rgba(127, 220, 255, 0.22);
  background: rgba(127, 220, 255, 0.1);
}

.debug-mode-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.debug-mode-list-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: start;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.debug-mode-icon {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  line-height: 1.3;
}

.debug-mode-list-item.is-allowed .debug-mode-icon {
  color: var(--nothing-green);
}

.debug-mode-list-item.is-restricted .debug-mode-icon {
  color: var(--nothing-red);
}

.debug-mode-list-item.is-bestfor .debug-mode-icon {
  color: #7fdcff;
}

.btn-system {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(224, 224, 224, 0.9));
  color: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -1px 0 rgba(0, 0, 0, 0.22), 0 10px 22px -16px rgba(255, 255, 255, 0.35);
  transition: transform 0.24s ease, filter 0.24s ease, background 0.24s ease, color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, opacity 0.24s ease;
}

.btn-system:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 14px 28px -16px rgba(255, 255, 255, 0.42);
}

.btn-system:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
  filter: brightness(0.97);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -1px 0 rgba(0, 0, 0, 0.28), 0 7px 16px -14px rgba(255, 255, 255, 0.18);
}

.btn-system:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-system:disabled:hover {
  transform: none;
  filter: none;
}

.btn-ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.24), 0 12px 24px -18px rgba(0, 0, 0, 0.65);
}

.btn-ghost:disabled:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  color: var(--text-main);
}

#thoughtBtn {
  background: linear-gradient(180deg, #8ce9ff, #58bde8);
  color: #06131a;
  border-color: rgba(127, 220, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56), inset 0 -1px 0 rgba(7, 19, 26, 0.25), 0 12px 26px -16px rgba(95, 201, 255, 0.5);
}

#thoughtBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, #a4efff, #64c9f0);
  color: #07131a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64), inset 0 -1px 0 rgba(7, 19, 26, 0.22), 0 18px 32px -18px rgba(95, 201, 255, 0.62);
}

#hintBtn {
  background: linear-gradient(180deg, #ffd96b, #d7a730);
  color: #161616;
  border-color: rgba(245, 200, 76, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 246, 214, 0.56), inset 0 -1px 0 rgba(27, 18, 0, 0.24), 0 12px 26px -16px rgba(245, 200, 76, 0.5);
}

#hintBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe58a, #e1b23c);
  color: #111;
  box-shadow: inset 0 1px 0 rgba(255, 249, 227, 0.66), inset 0 -1px 0 rgba(27, 18, 0, 0.2), 0 18px 32px -18px rgba(245, 200, 76, 0.64);
}

#doneBtn {
  background: linear-gradient(180deg, rgba(76, 255, 170, 0.22), rgba(6, 102, 60, 0.34));
  color: #d7ffeb;
  border: 1px solid rgba(0, 255, 136, 0.26);
  box-shadow: inset 0 1px 0 rgba(214, 255, 235, 0.16), inset 0 -1px 0 rgba(0, 46, 24, 0.34), 0 12px 26px -16px rgba(0, 255, 136, 0.34);
}

#doneBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(94, 255, 177, 0.28), rgba(7, 119, 69, 0.42));
  color: #d7ffeb;
  border-color: rgba(0, 255, 136, 0.28);
  box-shadow: inset 0 1px 0 rgba(214, 255, 235, 0.22), inset 0 -1px 0 rgba(0, 46, 24, 0.3), 0 18px 32px -18px rgba(0, 255, 136, 0.44);
}

#doneBtn:disabled:hover,
#hintBtn:disabled:hover,
#thoughtBtn:disabled:hover {
  background: inherit;
  color: inherit;
}

[data-theme="light"] #thoughtBtn {
  background: linear-gradient(180deg, #3ca0e8, #0f6fb2);
  color: #fff;
}

[data-theme="light"] #thoughtBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, #54b0ef, #1f82c7);
}

[data-theme="light"] #hintBtn {
  background: linear-gradient(180deg, #f0c854, #d7a423);
  color: #111;
}

[data-theme="light"] #hintBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f4d26f, #e2b23a);
}

[data-theme="light"] #doneBtn {
  background: linear-gradient(180deg, rgba(76, 179, 124, 0.22), rgba(31, 122, 70, 0.26));
  color: #225f3d;
  border: 1px solid rgba(31, 122, 70, 0.24);
}

[data-theme="light"] #doneBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(88, 194, 138, 0.28), rgba(31, 122, 70, 0.32));
  color: #1f6b42;
  border-color: rgba(31, 122, 70, 0.26);
}

.btn-mini {
  padding: 8px 12px;
  font-size: 11px;
}

#debugModeBtn:not(.btn-ghost) {
  background: linear-gradient(180deg, #ffd46f, #d9921c);
  color: #1a1200;
  border-color: rgba(255, 198, 76, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 247, 223, 0.58), inset 0 -1px 0 rgba(43, 23, 0, 0.22), 0 14px 28px -18px rgba(255, 178, 59, 0.52);
}

#debugModeBtn:not(.btn-ghost):hover:not(:disabled) {
  background: linear-gradient(180deg, #ffdd84, #e3a12d);
  box-shadow: inset 0 1px 0 rgba(255, 249, 233, 0.68), inset 0 -1px 0 rgba(43, 23, 0, 0.18), 0 18px 34px -18px rgba(255, 178, 59, 0.62);
}

#fixModeBtn:not(.btn-ghost) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(223, 223, 223, 0.9));
  color: #090909;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 14px 28px -18px rgba(255, 255, 255, 0.38);
}

#fixModeBtn:not(.btn-ghost):hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(235, 235, 235, 0.94));
}

.input-actions .btn-system:first-child {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 226, 226, 0.9));
  color: #090909;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 14px 28px -18px rgba(255, 255, 255, 0.36);
}

.input-actions .btn-system:first-child:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(237, 237, 237, 0.94));
}

.input-actions .btn-system:last-child {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.24), 0 12px 24px -18px rgba(0, 0, 0, 0.65);
}

.input-actions .btn-system:last-child:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 16px 28px -18px rgba(0, 0, 0, 0.72);
}

[data-theme="light"] #debugModeBtn:not(.btn-ghost) {
  background: linear-gradient(180deg, #f6c454, #d38e18);
  color: #2a1800;
}

[data-theme="light"] #fixModeBtn:not(.btn-ghost),
[data-theme="light"] .input-actions .btn-system:first-child {
  background: linear-gradient(180deg, #ffffff, #e8e8e8);
  color: #111;
}

[data-theme="light"] .input-actions .btn-system:last-child {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.015));
  color: #111;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.08), 0 10px 22px -18px rgba(0, 0, 0, 0.18);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  transition: color var(--transition);
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  align-items: center;
}

.footer-right {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.footer-strong {
  color: var(--text-main);
}

.footer-link {
  color: var(--text-main);
  text-decoration: none;
}

.footer-timer {
  color: var(--text-main);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
}

.legal {
  color: var(--text-muted);
  text-align: center;
}

/* ===== MOBILE ===== */
@media (max-width: 600px) {
  .hero-title {
    font-size: 28px;
  }

  .hero-logo {
    width: min(100%, 300px);
  }

  #chatBox {
    height: 180px;
  }

  #codeInput {
    height: 140px;
  }

  nav {
    width: calc(100% - 20px);
    padding: 10px 12px;
  }

  .nav-menu {
    gap: 6px;
  }

  .nav-link {
    padding: 1px 10px;
    font-size: 11px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-high);
  border-radius: 10px;
}

.mode-buttons .btn-system:not(.btn-ghost) {
  background: var(--text-main);
  color: var(--bg);
}




.mode-debug {
  color: #c88a00;
}

.mode-fix {
  color: var(--nothing-green);
}

@keyframes strobe {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes skill-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

#csStatus {
  display: inline-block;
}


.chip-pulse {
  display: inline-block;
  animation: chip-pulse-glow 1.2s infinite ease-in-out !important;
}

@keyframes chip-pulse-glow {

  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
    text-shadow: 0 0 0 transparent;
  }

  50% {
    opacity: 0.35;
    filter: brightness(1.35);
    text-shadow: 0 0 8px currentColor;
  }
}


.status-idle {
  color: var(--text-main);
}

.status-running {
  color: var(--nothing-red) !important;
}

.status-output {
  color: var(--nothing-green) !important;
}

.status-done {
  color: var(--nothing-green) !important;
}

.status-error {
  color: var(--nothing-red) !important;
}






.chat-bugfound {
  color: #ffd54a;
}

.chat-success {
  color: var(--nothing-green);
}

.chat-help-title,
.chat-help {
  color: #9cffc9;
}

.chat-help-command-label {
  color: var(--text-main);
}

.chat-help-command-value {
  color: #7fdcff;
}

.chat-help-btn {
  font-weight: 800;
  color: #cde9ff;
}

[data-theme="light"] .chat-ai-reply {
  color: #0f5f94;
  background: rgba(15, 111, 178, 0.08);
  border: 1px solid rgba(15, 111, 178, 0.16);
}

[data-theme="light"] .chat-wrong-reply {
  color: #9c1f29;
  background: rgba(255, 45, 55, 0.08);
  border: 1px solid rgba(156, 31, 41, 0.18);
}

[data-theme="light"] .chat-user-thought {
  color: #1f1f1f;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .chat-clean-reply {
  color: #1f7a46;
  background: rgba(31, 122, 70, 0.08);
  border: 1px solid rgba(31, 122, 70, 0.16);
}

[data-theme="light"] .chat-hint-reply {
  color: #9a6a00;
  background: rgba(245, 200, 76, 0.14);
  border: 1px solid rgba(154, 106, 0, 0.18);
}

[data-theme="light"] .play-panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #chatBox {
  background: #f7f7f7;
  color: #2f2f2f;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #codeInput,
[data-theme="light"] .coach-input {
  background: #ffffff;
  color: #111;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mono {
  color: #666;
}

[data-theme="light"] .play-panel > .mono,
[data-theme="light"] .control-card > .mono,
[data-theme="light"] .fix-card > .mono,
[data-theme="light"] .api-register-form > .mono,
[data-theme="light"] .api-future-card > .mono,
[data-theme="light"] .panel-main-label,
[data-theme="light"] .advanced-stats-head .mono,
[data-theme="light"] .stats-head .mono {
  color: #111;
}

[data-theme="light"] .beta-access-card > .mono {
    color: #b87400;
}

[data-theme="light"] .beta-access-card:not(.is-ready) {
    border-color: rgba(184, 116, 0, 0.34);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 0 0 1px rgba(184, 116, 0, 0.14),
      0 0 24px -18px rgba(184, 116, 0, 0.38);
}

[data-theme="light"] .beta-access-copy {
    color: #333;
}

[data-theme="light"] .beta-access-card:not(.is-ready) .beta-access-input {
    border-color: rgba(184, 116, 0, 0.26);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 0 0 1px rgba(184, 116, 0, 0.14);
}

[data-theme="light"] .beta-access-status {
    color: #9a6a00;
}

[data-theme="light"] .beta-access-status.is-used-link {
    color: #b23a46;
}

[data-theme="light"] .beta-access-status-text {
  color: #333;
}

[data-theme="light"] .beta-access-owner-link {
  color: inherit;
}

[data-theme="light"] .beta-access-rank {
  color: #9a6a00;
}

[data-theme="light"] .beta-access-rank.is-master {
  color: #0f6fb2;
}

[data-theme="light"] .chat-help-title,
[data-theme="light"] .chat-help {
  color: #1f5f3b;
}

[data-theme="light"] .chat-help-btn {
  color: #0f4c81;
}

[data-theme="light"] .chat-help-command-label {
  color: #111;
}

[data-theme="light"] .chat-help-command-value {
  color: #0f6fb2;
}

[data-theme="light"] .chat-bugfound {
  color: #9a6a00;
}

[data-theme="light"] .chat-success {
  color: #1f7a46;
}

.stats-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.stats-progress-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.progress-wrap {
  margin-top: 0;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff2d37, #ff2d37);
  transition: width 0.55s var(--ease), background 0.55s var(--ease), box-shadow 0.55s var(--ease), filter 0.55s var(--ease);
}

.stats-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px;
}

.stat-label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.stat-good {
  color: var(--nothing-green);
}

.stat-bad {
  color: var(--nothing-red);
}

#statThoughts {
  color: #7fdcff;
}

#statHints {
  color: #f5c84c;
}

#statBestProgress {
  color: #ff7ac8 !important;
}

.stats-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 14px;
}

.advanced-toggle-row {
  margin-top: 14px;
}

.advanced-toggle-btn {
  min-width: 180px;
}

.advanced-stats-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  pointer-events: none;
  transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease, border-color 0.3s ease;
}

.codesentinel-widget.advanced-stats-visible .advanced-stats-panel {
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
  margin-top: 16px;
  padding-top: 16px;
  border-top-color: var(--glass-border);
  pointer-events: auto;
}

.codesentinel-widget.mode-debug.advanced-stats-visible .debug-mode-shell {
  display: flex;
}

.advanced-stats-head {
  margin-bottom: 12px;
}

.advanced-progress-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.advanced-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.advanced-progress-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.advanced-progress-value {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.advanced-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.advanced-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff2d37, #ff2d37);
  transition: width 0.55s var(--ease), background 0.55s var(--ease), box-shadow 0.55s var(--ease);
}

.advanced-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 0;
  margin-right: 0;
  margin-bottom: 0;
}

.advanced-stat-card {
  min-height: 72px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  z-index: 0;
  box-shadow: 0 10px 22px -20px rgba(255, 255, 255, 0.16);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease), background 0.28s var(--ease);
}

.advanced-stat-card:hover {
  transform: translateY(-2px) scale(1.01);
  z-index: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 22px -8px rgba(255, 255, 255, 0.16), 0 14px 30px -18px rgba(255, 255, 255, 0.16);
}

.advanced-stat-label {
  display: block;
  margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.advanced-stat-value {
  display: block;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.stat-danger-card:hover {
  border-color: rgba(255, 45, 55, 0.32);
  box-shadow: 0 0 0 1px rgba(255, 45, 55, 0.08), 0 0 24px -8px rgba(255, 45, 55, 0.24), 0 14px 30px -18px rgba(255, 45, 55, 0.28);
}

.stat-warning-card:hover {
  border-color: rgba(245, 200, 76, 0.34);
  box-shadow: 0 0 0 1px rgba(245, 200, 76, 0.08), 0 0 24px -8px rgba(245, 200, 76, 0.24), 0 14px 30px -18px rgba(245, 200, 76, 0.28);
}

.stat-positive-card:hover {
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.08), 0 0 24px -8px rgba(0, 255, 136, 0.22), 0 14px 30px -18px rgba(0, 255, 136, 0.24);
}

.stat-neutral-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 20px -10px rgba(255, 255, 255, 0.16), 0 14px 30px -18px rgba(255, 255, 255, 0.14);
}

.stat-danger-text {
  color: var(--nothing-red);
}

.stat-warning-text {
  color: #f5c84c;
}

.stat-positive-text {
  color: var(--nothing-green);
}

.stat-neutral-text {
  color: var(--text-main);
}

.advanced-download-btn {
  background: var(--nothing-red);
  color: #fff;
  border: 1px solid rgba(255, 45, 55, 0.34);
}

.advanced-download-btn:hover:not(:disabled) {
  background: #ff4751;
  color: #fff;
  box-shadow: 0 0 22px rgba(255, 45, 55, 0.28);
}

.fix-results-panel {
  display: none;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 0;
  flex: 1 1 auto;
  align-content: start;
}

.fix-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition), border-color var(--transition), transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.fix-code-card {
  min-height: 464px;
}

.fix-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.copy-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition), opacity var(--transition);
}

.copy-icon-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.copy-icon-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

.copy-icon {
  width: 16px;
  height: 16px;
}

.copy-icon-done {
  display: none;
}

.copy-icon-btn.is-copied {
  color: var(--nothing-green);
}

.copy-icon-btn.is-copied .copy-icon-default {
  display: none;
}

.copy-icon-btn.is-copied .copy-icon-done {
  display: block;
}

.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;
}

.fix-output-box {
  min-height: 424px;
  height: 424px;
  max-height: 424px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.36);
  color: var(--text-main);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  box-sizing: border-box;
  background-clip: padding-box;
  transition: border-color var(--transition), background var(--transition), min-height 0.35s var(--ease), height 0.35s var(--ease), opacity 0.35s var(--ease);
}

.fix-output-box::-webkit-scrollbar {
  width: 6px;
}

.fix-output-box::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin: 10px 0;
}

.fix-output-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.fix-output-box::-webkit-scrollbar-corner {
  background: transparent;
}

.code-keyword {
  color: #ff8e6e;
}

.code-function {
  color: #8ab4ff;
}

.code-string {
  color: #8de5a1;
}

.code-number {
  color: #f7d774;
}

.code-comment {
  color: #7f8b93;
}

.code-preprocessor {
  color: #d89cff;
}

.change-log-card {
  border-color: var(--glass-border);
  height: 174px;
  min-height: 174px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.change-log-card .mono {
  color: var(--text-main);
}

.change-log-box {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(127, 220, 255, 0.45);
  background: rgba(127, 220, 255, 0.06);
  color: #7fdcff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 220, 255, 0.28) transparent;
  box-sizing: border-box;
  transition: border-color var(--transition), background var(--transition), min-height 0.35s var(--ease), height 0.35s var(--ease), opacity 0.35s var(--ease);
}

.change-log-box::-webkit-scrollbar {
  width: 6px;
}

.change-log-box::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin: 10px 0;
}

.change-log-box::-webkit-scrollbar-thumb {
  background: rgba(127, 220, 255, 0.28);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.change-log-box::-webkit-scrollbar-corner {
  background: transparent;
}

.codesentinel-widget.mode-fix .fix-code-card {
  min-height: 524px;
}

.codesentinel-widget.mode-fix .fix-output-box {
  min-height: 484px;
  height: 484px;
  max-height: 484px;
}

.change-log-line {
  margin-top: 8px;
}

.change-log-line:first-child {
  margin-top: 0;
}

@keyframes panel-fade-up {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="light"] .progress-wrap,
[data-theme="light"] .stat-item,
[data-theme="light"] .advanced-progress-card,
[data-theme="light"] .advanced-stat-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .progress-track {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #statThoughts {
  color: #0f6fb2;
}

[data-theme="light"] #statHints {
  color: #9a6a00;
}

[data-theme="light"] #statBestProgress {
  color: #b0307b !important;
}

[data-theme="light"] .advanced-progress-track {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .stat-danger-text {
  color: #c02432;
}

[data-theme="light"] .stat-warning-text {
  color: #9a6a00;
}

[data-theme="light"] .stat-positive-text {
  color: #1f7a46;
}

[data-theme="light"] .advanced-stat-card:hover {
  box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .stat-danger-card:hover {
  box-shadow: 0 12px 26px -18px rgba(192, 36, 50, 0.22);
}

[data-theme="light"] .stat-warning-card:hover {
  box-shadow: 0 12px 26px -18px rgba(154, 106, 0, 0.22);
}

[data-theme="light"] .stat-positive-card:hover {
  box-shadow: 0 12px 26px -18px rgba(31, 122, 70, 0.22);
}

[data-theme="light"] .advanced-download-btn {
  background: #c02432;
  border-color: rgba(192, 36, 50, 0.3);
  color: #fff;
}

[data-theme="light"] .advanced-download-btn:hover:not(:disabled) {
  background: #d53442;
  color: #fff;
}

[data-theme="light"] .fix-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .fix-output-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #111;
  scrollbar-color: rgba(0, 0, 0, 0.16) transparent;
}

[data-theme="light"] .copy-icon-btn {
  color: #666;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .copy-icon-btn:hover {
  color: #111;
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .copy-icon-btn:active {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .api-remove-btn {
  color: #c02432;
  border-color: rgba(192, 36, 50, 0.32);
}

[data-theme="light"] .api-remove-btn:hover:not(:disabled) {
    background: rgba(192, 36, 50, 0.08);
    border-color: rgba(192, 36, 50, 0.52);
}

[data-theme="light"] .api-register-form.is-awaiting-api .api-key-input {
    border-color: rgba(128, 70, 212, 0.48);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.96),
      0 0 0 1px rgba(128, 70, 212, 0.24),
      0 0 24px -18px rgba(128, 70, 212, 0.54);
}

[data-theme="light"] .api-register-form.is-awaiting-api .api-key-input:focus {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.96),
      0 0 0 1px rgba(128, 70, 212, 0.32),
      0 0 28px -18px rgba(128, 70, 212, 0.62);
}

[data-theme="light"] .api-widget.is-awaiting-api .api-register-copy,
[data-theme="light"] .api-widget.is-awaiting-api .beta-access-card.is-ready {
    opacity: 0.74;
}

[data-theme="light"] .api-widget.is-awaiting-api .api-start-card,
[data-theme="light"] .api-widget.is-awaiting-api .api-future-card.is-ready {
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      0 10px 20px -24px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .api-widget.is-awaiting-api .api-start-card,
[data-theme="light"] .api-widget.is-awaiting-api .beta-access-card.is-ready {
    filter: saturate(0.82) brightness(0.97);
}

[data-theme="light"] .api-widget.is-awaiting-api .api-register-form {
    border-color: rgba(128, 70, 212, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.96),
      0 0 0 1px rgba(128, 70, 212, 0.08),
      0 18px 28px -26px rgba(128, 70, 212, 0.18);
}

[data-theme="light"] .api-privacy-note {
  border-color: rgba(0, 138, 92, 0.18);
  background: rgba(0, 138, 92, 0.05);
  color: #255849;
}

[data-theme="light"] .api-start-card {
  border-color: rgba(0, 0, 0, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 246, 246, 0.94)),
    #f1f1f1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 14px 28px -24px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .api-start-title {
  color: #2d6a53;
}

[data-theme="light"] .api-start-divider {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.04));
}

[data-theme="light"] .api-start-steps {
  color: #171717;
}

[data-theme="light"] .api-start-help {
  color: #2d79b3;
}

[data-theme="light"] .api-start-warning {
  border-color: rgba(191, 125, 0, 0.2);
  background: rgba(255, 201, 87, 0.14);
  color: #8a5d00;
}

[data-theme="light"] .api-start-warning-icon {
  color: #b87400;
}

[data-theme="light"] .api-start-help code {
  border-color: rgba(58, 133, 197, 0.24);
  background: rgba(66, 153, 225, 0.1);
  color: #15598f;
}

[data-theme="light"] .api-access-link {
  border-color: rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 241, 241, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 18px -20px rgba(0, 0, 0, 0.18);
  color: #151515;
}

[data-theme="light"] .api-access-link:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 14px 24px -22px rgba(0, 0, 0, 0.2),
    0 0 0 1px color-mix(in srgb, var(--provider-accent) 16%, rgba(0, 0, 0, 0.06));
}

[data-theme="light"] .api-access-link.is-active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--provider-accent) 10%, #ffffff), #ededed);
}

[data-theme="light"] .api-access-link[data-provider="gemini"].is-active,
[data-theme="light"] .api-access-link[data-provider="gemini"]:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 243, 243, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
}

[data-theme="light"] .api-access-mark {
  border-color: rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

[data-theme="light"] .api-access-link[data-provider="gemini"].is-active .api-access-mark,
[data-theme="light"] .api-access-link[data-provider="gemini"]:hover .api-access-mark {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 247, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
}

[data-theme="light"] .api-access-link[data-provider="xai"] .api-access-logo {
  filter:
    brightness(0)
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.14));
}

[data-theme="light"] .api-access-badge {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.08);
  color: #111;
}

[data-theme="light"] .api-access-name {
  color: #111;
}

[data-theme="light"] .api-provider-option {
  border-color: rgba(0, 0, 0, 0.08);
  background: #f2f2f2;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 20px -18px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .api-provider-name-xai {
  color: #5c6573;
}

[data-theme="light"] .api-provider-option:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 14px 24px -18px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .api-provider-option.is-active {
  border-color: color-mix(in srgb, var(--provider-accent) 42%, rgba(0, 0, 0, 0.08));
  background: linear-gradient(180deg, color-mix(in srgb, var(--provider-accent) 8%, #ffffff), #ececec);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 14px 24px -18px rgba(0, 0, 0, 0.18),
    0 0 0 1px color-mix(in srgb, var(--provider-accent) 18%, transparent);
}

[data-theme="light"] .api-provider-option[data-provider="gemini"]:hover,
[data-theme="light"] .api-provider-option[data-provider="gemini"].is-active {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 240, 244, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 14px 24px -18px rgba(0, 0, 0, 0.18),
    0 0 14px -12px rgba(49, 134, 255, 0.2);
}

[data-theme="light"] .api-provider-option[data-provider="gemini"]:hover .api-provider-mark,
[data-theme="light"] .api-provider-option[data-provider="gemini"].is-active .api-provider-mark {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 248, 0.98)) padding-box,
    linear-gradient(135deg, #fabc12 0%, #f94543 30%, #3186ff 65%, #08b962 100%) border-box;
}

[data-theme="light"] .api-provider-mark {
  border-color: rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

[data-theme="light"] .api-provider-option[data-provider="xai"] .api-provider-logo {
  filter:
    brightness(0)
    drop-shadow(0 5px 10px rgba(0, 0, 0, 0.16));
}

[data-theme="light"] .api-provider-badge {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(0, 0, 0, 0.06);
  color: #111;
}

[data-theme="light"] .api-provider-name {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  white-space: nowrap;
  line-height: 1.1;
}

[data-theme="light"] .api-provider-tooltip {
  border-color: rgba(0, 0, 0, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.92), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 242, 242, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03),
    0 24px 42px -26px rgba(0, 0, 0, 0.25),
    0 0 24px -18px rgba(0, 0, 0, 0.12);
  color: #111;
}

[data-theme="light"] .api-provider-tooltip::after {
  border-right-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 242, 242, 0.86));
}

[data-theme="light"] .debug-mode-selector,
[data-theme="light"] .debug-mode-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .debug-mode-section {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .debug-mode-option {
  color: #6c6c6c;
}

[data-theme="light"] .debug-mode-option:hover {
  color: #111;
}

[data-theme="light"] .debug-mode-option.is-active {
  color: #fff;
}

[data-theme="light"] .debug-mode-selector[data-active="beginner"] .debug-mode-highlight {
  background: linear-gradient(180deg, rgba(31, 122, 70, 0.86), rgba(19, 97, 53, 0.96));
  box-shadow: 0 0 24px -10px rgba(31, 122, 70, 0.28);
}

[data-theme="light"] .debug-mode-selector[data-active="intermediate"] .debug-mode-highlight {
  background: linear-gradient(180deg, rgba(214, 163, 35, 0.9), rgba(179, 126, 8, 0.96));
  box-shadow: 0 0 24px -10px rgba(214, 163, 35, 0.28);
}

[data-theme="light"] .debug-mode-selector[data-active="pro"] .debug-mode-highlight {
  background: linear-gradient(180deg, rgba(192, 36, 50, 0.9), rgba(163, 20, 33, 0.96));
  box-shadow: 0 0 24px -10px rgba(192, 36, 50, 0.28);
}

[data-theme="light"] .debug-mode-card {
  scrollbar-color: rgba(0, 0, 0, 0.16) transparent;
}

[data-theme="light"] .debug-mode-card::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .debug-mode-section-allowed {
  border-color: rgba(31, 122, 70, 0.22);
  background: linear-gradient(180deg, rgba(31, 122, 70, 0.07), rgba(31, 122, 70, 0.02));
}

[data-theme="light"] .debug-mode-section-allowed .debug-mode-section-title {
  color: #1f7a46;
  border-color: rgba(31, 122, 70, 0.24);
  background: rgba(31, 122, 70, 0.08);
}

[data-theme="light"] .debug-mode-section-restricted {
  border-color: rgba(192, 36, 50, 0.22);
  background: linear-gradient(180deg, rgba(192, 36, 50, 0.07), rgba(192, 36, 50, 0.02));
}

[data-theme="light"] .debug-mode-section-bestfor {
  border-color: rgba(15, 111, 178, 0.22);
  background: linear-gradient(180deg, rgba(15, 111, 178, 0.07), rgba(15, 111, 178, 0.02));
}

[data-theme="light"] .debug-mode-section-restricted .debug-mode-section-title {
  color: #c02432;
  border-color: rgba(192, 36, 50, 0.24);
  background: rgba(192, 36, 50, 0.08);
}

[data-theme="light"] .debug-mode-section-bestfor .debug-mode-section-title {
  color: #0f6fb2;
  border-color: rgba(15, 111, 178, 0.24);
  background: rgba(15, 111, 178, 0.08);
}

[data-theme="light"] .fix-output-box::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .code-keyword {
  color: #b5482d;
}

[data-theme="light"] .code-function {
  color: #1f5fbf;
}

[data-theme="light"] .code-string {
  color: #2f8757;
}

[data-theme="light"] .code-number {
  color: #a36a00;
}

[data-theme="light"] .code-comment {
  color: #7a7a7a;
}

[data-theme="light"] .code-preprocessor {
  color: #8b4fc4;
}

[data-theme="light"] .change-log-box {
  border-color: rgba(15, 111, 178, 0.35);
}

[data-theme="light"] .change-log-card {
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .change-log-card .mono {
  color: #111;
}

[data-theme="light"] .change-log-box {
  color: #0f6fb2;
}

[data-theme="light"] .change-log-box {
  background: rgba(15, 111, 178, 0.06);
}

[data-theme="light"] .change-log-box {
  scrollbar-color: rgba(15, 111, 178, 0.24) transparent;
}

[data-theme="light"] .change-log-box::-webkit-scrollbar-thumb {
  background: rgba(15, 111, 178, 0.24);
}

/* API registration refresh */
.api-register-form {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 15, 0.94);
  box-shadow: none;
}

.api-provider-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.api-provider-option {
  width: auto;
  min-height: 104px;
  padding: 10px 8px 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #141414;
  box-shadow: none;
  gap: 8px;
}

.api-provider-option::before,
.api-provider-tooltip {
  display: none;
}

.api-provider-option:hover {
  transform: translateY(-1px);
  border-color: #4a4a4a;
  background: #171717;
  box-shadow: none;
}

.api-provider-option.is-active,
.api-provider-option[data-provider="gemini"].is-active,
.api-provider-option[data-provider="gemini"]:hover {
  border-color: rgba(152, 177, 255, 0.9);
  background: rgba(93, 114, 196, 0.12);
  box-shadow: none;
}

.api-provider-mark {
  height: 58px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0d0d0d;
  box-shadow: none;
}

.api-provider-option:hover .api-provider-mark,
.api-provider-option.is-active .api-provider-mark,
.api-provider-option[data-provider="gemini"]:hover .api-provider-mark,
.api-provider-option[data-provider="gemini"].is-active .api-provider-mark {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
  background: #0d0d0d;
}

.api-provider-logo {
  width: 32px;
  height: 32px;
  filter: none;
}

.api-provider-option[data-provider="openai"] .api-provider-logo,
.api-provider-option[data-provider="xai"] .api-provider-logo {
  filter: none;
}

.api-provider-option[data-provider="xai"] .api-provider-logo {
  width: 19px;
  height: 19px;
}

.api-provider-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.api-key-input {
  border-color: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.api-key-input:focus {
  box-shadow:
    0 0 0 1px rgba(166, 132, 255, 0.9),
    0 0 0 4px rgba(166, 132, 255, 0.12);
}

.api-register-form.is-awaiting-api .api-key-input {
  border-color: rgba(154, 120, 255, 0.76);
  box-shadow:
    0 0 0 1px rgba(154, 120, 255, 0.78),
    0 0 0 5px rgba(154, 120, 255, 0.14);
}

.api-register-form.is-awaiting-api .api-key-input:focus {
  box-shadow:
    0 0 0 1px rgba(180, 150, 255, 0.94),
    0 0 0 6px rgba(180, 150, 255, 0.18);
}

.api-demo-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #333;
  background: rgba(255, 255, 255, 0.015);
  transition:
    border-color 0.24s var(--ease),
    background 0.24s var(--ease);
}

.api-demo-card.is-active {
  border-color: rgba(142, 124, 255, 0.5);
  background: rgba(142, 124, 255, 0.06);
}

.api-demo-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-demo-title {
  color: #fff;
  letter-spacing: 0.14em;
}

.api-demo-copy p {
  margin: 0;
  color: #d8d8dc;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

.api-demo-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(147, 166, 255, 0.32);
  background: linear-gradient(180deg, rgba(112, 132, 255, 0.18), rgba(112, 132, 255, 0.08));
  color: #eef1ff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background 0.24s var(--ease),
    border-color 0.24s var(--ease),
    color 0.24s var(--ease),
    transform 0.2s var(--ease);
}

.api-demo-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(165, 181, 255, 0.42);
  background: linear-gradient(180deg, rgba(112, 132, 255, 0.24), rgba(112, 132, 255, 0.12));
}

.api-demo-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.api-register-status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.api-register-status {
  margin-top: 0;
  flex: 1 1 100%;
  min-width: 0;
  font-size: 9px;
  letter-spacing: 0.1em;
  white-space: normal;
  line-height: 1.45;
}

.api-provider-name-demo {
  color: #d7d0ff;
}

.api-register-copy {
  opacity: 1;
}

.api-widget.is-awaiting-api .api-start-card {
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  filter: none;
}

.api-widget.is-awaiting-api .api-register-copy {
  opacity: 0.7;
}

.api-widget.is-awaiting-api .api-register-form {
  border-color: rgba(154, 120, 255, 0.28);
  box-shadow: none;
}

.api-widget.is-demo-active .api-start-card {
  opacity: 0.6;
}

.api-start-links {
  gap: 10px;
}

.api-access-link {
  min-height: 42px;
  border: 1px solid #333;
  background: #141414;
  box-shadow: none;
}

.api-access-link:hover {
  transform: translateY(-1px);
  border-color: #444;
  box-shadow: none;
}

.api-access-link.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.api-access-link[data-provider="gemini"].is-active,
.api-access-link[data-provider="gemini"]:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.api-access-mark {
  border-radius: 8px;
  box-shadow: none;
}

.api-access-link[data-provider="gemini"].is-active .api-access-mark,
.api-access-link[data-provider="gemini"]:hover .api-access-mark {
  border-color: rgba(255, 255, 255, 0.08);
  background: #0c0c0c;
}

.api-access-logo {
  filter: none;
}

.api-access-link[data-provider="openai"] .api-access-logo,
.api-access-link[data-provider="xai"] .api-access-logo {
  filter: none;
  width: 10px;
  height: 10px;
}

[data-theme="light"] .api-register-form {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] .api-provider-option {
  border-color: #d7d7dd;
  background: #fcfcfd;
}

[data-theme="light"] .api-provider-option:hover {
  border-color: #b9b9c3;
  background: #fafafd;
}

[data-theme="light"] .api-provider-option.is-active,
[data-theme="light"] .api-provider-option[data-provider="gemini"].is-active,
[data-theme="light"] .api-provider-option[data-provider="gemini"]:hover {
  border-color: rgba(92, 117, 220, 0.62);
  background: rgba(92, 117, 220, 0.08);
}

[data-theme="light"] .api-provider-mark {
  border-color: rgba(0, 0, 0, 0.08);
  background: #f1f2f7;
}

[data-theme="light"] .api-key-input {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .api-key-input:focus {
  box-shadow:
    0 0 0 1px rgba(122, 100, 222, 0.78),
    0 0 0 4px rgba(122, 100, 222, 0.12);
}

[data-theme="light"] .api-register-form.is-awaiting-api .api-key-input {
  border-color: rgba(122, 100, 222, 0.5);
  box-shadow:
    0 0 0 1px rgba(122, 100, 222, 0.56),
    0 0 0 5px rgba(122, 100, 222, 0.12);
}

[data-theme="light"] .api-demo-card {
  border-color: #d7d7dd;
  background: rgba(89, 101, 165, 0.04);
}

[data-theme="light"] .api-demo-card.is-active {
  border-color: rgba(122, 100, 222, 0.34);
  background: rgba(122, 100, 222, 0.08);
}

[data-theme="light"] .api-demo-copy p {
  color: #484b56;
}

[data-theme="light"] .api-demo-btn {
  border-color: rgba(122, 100, 222, 0.2);
  background: linear-gradient(180deg, rgba(122, 100, 222, 0.12), rgba(122, 100, 222, 0.05));
  color: #352f54;
}

[data-theme="light"] .api-access-link {
  border-color: #d7d7dd;
  background: #fafafa;
}

@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .api-register-card {
    grid-template-columns: 1fr;
  }

  .api-provider-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .advanced-stat-grid {
    grid-template-columns: 1fr;
  }

  .codesentinel-widget.mode-debug.advanced-stats-visible {
    --advanced-stats-extra: 620px;
  }

  .stats-actions {
    justify-content: stretch;
  }

  .stats-actions .btn-system {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .api-provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }
}
