:root {
    --bg: #0b0b0f;
    --bg-soft: #0e1116;
    --card: #10141b;
    --card-2: #0f131a;
    --text: #e5e7eb;
    --text-muted: #a5adba;
    --border: #1f2430;
    --ring: #1f2230;
    --accent: #8b5cf6; /* violet-500 */
    --accent-600: #7c3aed;
    --accent-700: #6d28d9;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --cyan: #22d3ee;
  }
  
  /* Reset */
  * { 
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-soft);
  }

  /* Dark theme scrollbars */
  *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  *::-webkit-scrollbar-track {
    background: var(--bg-soft);
    border-radius: 4px;
  }

  *::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    border: 1px solid var(--bg-soft);
  }

  *::-webkit-scrollbar-thumb:hover {
    background: #2b3242;
  }

  *::-webkit-scrollbar-corner {
    background: var(--bg-soft);
  }
  html, body { height: 100%; }
  body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: radial-gradient(1200px 600px at 20% -10%, rgba(139, 92, 246, 0.12), transparent 50%),
                radial-gradient(900px 500px at 110% 10%, rgba(34, 211, 238, 0.10), transparent 50%),
                var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Layout helpers */
  .container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
  }
  
  /* Navbar */
  .navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 11, 15, 0.7);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
  }
  .brand-logo {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 6px rgba(139, 92, 246, 0.35));
  }
  .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
  }
  .brand-name {
    font-weight: 700;
    letter-spacing: 0.2px;
  }
  .brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
  }
  
  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--border);
    color: var(--text);
    background: linear-gradient(180deg, rgba(16,20,27,0.9), rgba(16,20,27,0.7));
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
  }
  .btn:hover { transform: translateY(-1px); border-color: #2b3242; }
  .btn:active { transform: translateY(0); }
  
  .btn-primary {
    background: linear-gradient(180deg, var(--accent), var(--accent-600));
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.25);
  }
  .btn-primary:hover {
    background: linear-gradient(180deg, var(--accent-600), var(--accent-700));
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.35);
  }
  
  .btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
  }
  
  /* Hero */
  .hero {
    position: relative;
    padding: 64px 0 16px;
    overflow: clip;
  }
  .hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-title {
    font-size: clamp(28px, 6vw, 44px);
    font-weight: 800;
    letter-spacing: -0.4px;
    background: linear-gradient(90deg, #ffffff, #c7c9d1 60%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0 0 10px;
  }
  .hero-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    max-width: 720px;
    margin: 0 0 16px;
  }
  .hero-cta { display: flex; gap: 10px; margin-bottom: 14px; }
  .hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
  .badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #131826;
    border: 1px solid var(--border);
    color: #cbd5e1;
    font-size: 12px;
  }
  .hero-glow {
    position: absolute;
    inset: -20% -20% auto -20%;
    height: 360px;
    background: radial-gradient(45% 50% at 30% 20%, rgba(139,92,246,0.18), transparent 60%),
                radial-gradient(45% 50% at 70% 10%, rgba(34,211,238,0.16), transparent 60%);
    pointer-events: none;
    z-index: -1;
  }
  
  /* Cards */
  .card {
    background: linear-gradient(180deg, rgba(16,20,27, 0.9), rgba(13,17,23, 0.95));
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 10px 28px rgba(0,0,0,0.35);
  }
  
  /* Playground */
  .playground-section { padding: 16px 0 24px; }
  .playground { padding: 20px; }
  .playground-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .playground-title { font-weight: 700; font-size: 16px; }
  .playground-hint { color: var(--text-muted); font-size: 12px; }
  
  .form-row {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 12px;
    align-items: end;
  }
  .form-group { display: grid; gap: 8px; }
  
  label {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 13px;
  }
  
  textarea, select {
    width: 100%;
    color: var(--text);
    background: #0c1118;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    padding: 14px 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  }
  textarea::placeholder { color: #6b7280; }
  textarea { min-height: 120px; resize: vertical; }
  
  textarea:focus, select:focus {
    border-color: #2e3750;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
  }
  
  .rate-limit-notice {
    margin-top: 12px;
    font-size: 12px;
    color: #f8dfa6;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 10px 12px;
    border-radius: 10px;
    text-align: center;
  }
  
  /* Model info/tabs */
  .models-info-section { padding: 16px 0 32px; }
  .models-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    margin: 4px 0 6px;
  }
  .models-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 18px;
  }
  
  .tabs-container { width: 100%; }
  .tabs-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
  }
  .tab-btn {
    background: #0c1118;
    color: #cbd5e1;
    border: 1px solid var(--border);
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  }
  .tab-btn:hover { transform: translateY(-1px); border-color: #2b3242; }
  .tab-btn.active {
    background: linear-gradient(180deg, var(--accent), var(--accent-600));
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.2);
  }
  
  .tab-content { display: none; animation: fadeIn 0.25s ease-in-out; }
  .tab-content.active { display: block; }
  
  .model-showcase { padding: 20px; }
  .model-showcase h3 { margin: 0 0 8px; font-size: 18px; }
  .model-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
    font-size: 14px;
  }
  
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
  }
  .feature-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(16,20,27,0.9), rgba(16,20,27,0.7));
  }
  .feature-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  }
  .feature-text { display: grid; gap: 4px; }
  .feature-text strong { font-size: 14px; }
  .feature-text span { font-size: 13px; color: var(--text-muted); }
  
  .use-cases, .safety-categories, .languages-supported {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0c1118;
    color: #cbd5e1;
    font-size: 13px;
  }
  
  /* Results */
  .results-section {
    display: none;
    margin: 0 auto 40px;
    max-width: 1120px;
    padding: 20px;
  }
  .results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 18px;
  }
  .results-title { margin: 0; font-size: 18px; font-weight: 800; }
  .processing-time {
    background: linear-gradient(180deg, var(--accent), var(--accent-600));
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
  }
  .model-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 14px;
  }
  .model-card {
    background: #0c1118;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  }
  .model-card:hover {
    transform: translateY(-2px);
    border-color: #2b3242;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  }
  .model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .model-name { font-weight: 700; }
  .model-time {
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: #0b0f14;
    padding: 4px 8px;
    border-radius: 8px;
  }
  
  .result-main { margin-bottom: 10px; }
  .result-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
  }
  .result-value {
    display: inline-block;
    font-weight: 800;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
  }
  
  /* Result chips */
  .spam { background: rgba(239, 68, 68, 0.15); color: #fecaca; border-color: rgba(239,68,68,0.35); }
  .not-spam, .ok { background: rgba(16,185,129,0.15); color: #bbf7d0; border-color: rgba(16,185,129,0.35); }
  .very-negative { background: rgba(245,158,11,0.15); color: #fde68a; border-color: rgba(245,158,11,0.35); }
  .negative { background: rgba(244,63,94,0.18); color: #fecdd3; border-color: rgba(244,63,94,0.35); }
  .positive { background: rgba(16,185,129,0.15); color: #bbf7d0; border-color: rgba(16,185,129,0.35); }
  .very-positive { background: rgba(5,150,105,0.15); color: #a7f3d0; border-color: rgba(5,150,105,0.35); }
  
  .toxicity { background: rgba(239,68,68,0.15); color: #fecaca; border-color: rgba(239,68,68,0.35); }
  .severe_toxicity { background: rgba(185,28,28,0.18); color: #fecaca; border-color: rgba(185,28,28,0.45); }
  .obscene { background: rgba(234,179,8,0.15); color: #fde68a; border-color: rgba(234,179,8,0.35); }
  .threat { background: rgba(244,63,94,0.18); color: #fecdd3; border-color: rgba(244,63,94,0.35); }
  .insult { background: rgba(245,158,11,0.15); color: #fde68a; border-color: rgba(245,158,11,0.35); }
  .identity_attack { background: rgba(190,24,93,0.18); color: #fbcfe8; border-color: rgba(190,24,93,0.45); }
  .sexual_explicit { background: rgba(219,39,119,0.18); color: #f9a8d4; border-color: rgba(219,39,119,0.45); }
  .non-toxic, .neutral { background: rgba(34,197,94,0.15); color: #bbf7d0; border-color: rgba(34,197,94,0.35); }
  
  /* Progress */
  .progress-container { margin-top: 8px; }
  .progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 6px;
  }
  .progress-bar {
    width: 100%;
    height: 8px;
    background: #0b0f14;
    border-radius: 999px;
    border: 1px solid var(--border);
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    width: 0%;
    transition: width 0.9s ease;
  }
  
  /* Koala/Detoxify details */
  .koala-details { margin-top: 10px; }
  .koala-category {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #232a3a;
  }
  .koala-category:last-child { border-bottom: 0; }
  .category-name { color: #cbd5e1; }
  .category-prob { color: var(--text-muted); font-size: 12px; }
  
  /* Unicode details */
  .unicode-details {
    margin-top: 10px;
    background: #0b0f14;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
  }
  .unicode-item { display: flex; justify-content: space-between; margin-bottom: 6px; }
  .unicode-item:last-child { margin-bottom: 0; }
  .unicode-label { font-weight: 700; color: #cbd5e1; font-size: 12px; }
  .unicode-value { color: #e2e8f0; font-weight: 600; font-size: 12px; }
  
  /* Feedback & states */
  .loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
  }
  .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.12);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  
  .error, .rate-limit-error {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid;
    margin-top: 10px;
    font-weight: 700;
    font-size: 13px;
  }
  .error {
    color: #fecaca;
    background: rgba(239,68,68,0.08);
    border-color: rgba(239, 68, 68, 0.35);
  }
  .rate-limit-error {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.35);
    animation: shake 0.5s ease-in-out;
  }
  @keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
  
  /* Footer */
  .footer {
    border-top: 1px solid var(--border);
    padding: 18px 0 28px;
    color: var(--text-muted);
  }
  .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .footer a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
  }
  .footer a:hover { color: white; }
  .footer-links { display: flex; gap: 12px; }
  
  /* Animations */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .nav-inner { height: 58px; }
    .form-row { grid-template-columns: 1fr; }
    .model-results { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 10px; }
  }