/* Shared design system: dark cinematic palette, components, animations (V Download) */
    html { scroll-behavior: smooth; color-scheme: dark; }
    body {
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      background-color: #100C08;
      background-image:
        radial-gradient(1100px 560px at 88% -6%, rgba(149, 18, 44, 0.14), transparent 60%),
        radial-gradient(900px 520px at -6% 38%, rgba(10, 147, 150, 0.12), transparent 62%);
      color: #F3F4F5;
      font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    }
    ::selection { background-color: rgba(149, 18, 44, 0.42); color: #F3F4F5; }

    /* Hero — burgundy / teal brand atmosphere */
    .hero {
      position: relative;
      overflow: hidden;
      background: linear-gradient(160deg, #1A0A0F 0%, #100C08 50%, #0B1214 100%);
    }
    .hero::before {
      content: '';
      position: absolute;
      inset: 0;
      background:
        radial-gradient(900px 440px at 78% -8%, rgba(149, 18, 44, 0.38), transparent 62%),
        radial-gradient(760px 460px at 6% 108%, rgba(10, 147, 150, 0.22), transparent 68%);
      pointer-events: none;
    }
    .hero > * { position: relative; z-index: 1; }

    .spinner {
      width: 1rem;
      height: 1rem;
      border: 2px solid rgba(243, 244, 245, 0.25);
      border-top-color: currentColor;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: inline-block;
      flex-shrink: 0;
    }
    .spinner-lg {
      width: 1.5rem;
      height: 1.5rem;
      border-width: 2.5px;
    }
    .spinner-dark {
      border: 2px solid rgba(243, 244, 245, 0.16);
      border-top-color: #19B8B4;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    @keyframes toast-in {
      from { opacity: 0; transform: translateY(0.75rem) scale(0.97); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes toast-out {
      from { opacity: 1; }
      to { opacity: 0; transform: translateY(0.5rem); }
    }
    .toast-in { animation: toast-in 0.25s ease-out forwards; }
    .toast-out { animation: toast-out 0.25s ease-in forwards; }

    @keyframes fade-up {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .fade-up { animation: fade-up 0.3s ease-out both; }

    /* Format selection — burgundy / teal states */
    .format-option:checked + label {
      border-color: #95122C;
      background-color: rgba(149, 18, 44, 0.14);
      box-shadow: 0 0 0 1px rgba(149, 18, 44, 0.45);
    }
    .format-option:checked + label .radio-dot {
      border-color: #C72C4B;
      background: linear-gradient(135deg, #95122C, #C72C4B);
      box-shadow: inset 0 0 0 2.5px #100C08;
    }
    .format-option:focus-visible + label {
      outline: 2px solid #19B8B4;
      outline-offset: 2px;
    }
    :focus-visible {
      outline: 2px solid #19B8B4;
      outline-offset: 2px;
    }
    input[type="text"]:focus-visible { outline: none; }

    /* URL shell */
    .url-shell {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      background: #15110E;
      border: 1px solid rgba(243, 244, 245, 0.12);
      border-radius: 1rem;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.42);
      padding: 0.5rem 0.5rem 0.5rem 1rem;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }
    .url-shell:focus-within {
      border-color: #0A9396;
      box-shadow: 0 0 0 3px rgba(10, 147, 150, 0.28), 0 18px 40px rgba(0, 0, 0, 0.45);
    }
    .url-input {
      flex: 1;
      min-width: 0;
      border: none;
      background: transparent;
      padding: 0.7rem 0;
      font-size: 0.95rem;
      color: #F3F4F5;
      outline: none;
    }
    .url-input::placeholder { color: #858B93; }
    .analyze-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      height: 2.5rem;
      padding: 0 1.15rem;
      border-radius: 0.7rem;
      background: linear-gradient(135deg, #95122C 0%, #7C0F24 100%);
      color: #ffffff;
      font-size: 0.875rem;
      font-weight: 600;
      box-shadow: 0 8px 20px rgba(149, 18, 44, 0.32);
      transition: background-image 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
      white-space: nowrap;
    }
    .analyze-btn:hover:not(:disabled) {
      background: linear-gradient(135deg, #C72C4B 0%, #95122C 100%);
      box-shadow: 0 10px 26px rgba(149, 18, 44, 0.42), 0 0 0 1px rgba(25, 184, 180, 0.28);
    }
    .analyze-btn:disabled { opacity: 0.6; cursor: not-allowed; }

    .platform-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      color: #B8BDC4;
      font-size: 0.8125rem;
      font-weight: 500;
      transition: color 0.15s ease;
    }
    .platform-chip:hover { color: #19B8B4; }
    .platform-chip svg { opacity: 0.85; }

    .feature-card {
      background: #15110E;
      border: 1px solid #27231F;
      border-radius: 1rem;
      padding: 1.5rem;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 26px rgba(0, 0, 0, 0.32);
      transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    .feature-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 30px rgba(149, 18, 44, 0.18);
      border-color: rgba(149, 18, 44, 0.55);
    }
    .feature-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 2.5rem;
      height: 2.5rem;
      border-radius: 0.65rem;
      background: rgba(10, 147, 150, 0.16);
      color: #19B8B4;
      margin-bottom: 1rem;
    }

    /* Results / status cards — dark surfaces */
    .panel {
      background: #15110E;
      border: 1px solid rgba(243, 244, 245, 0.10);
      border-radius: 1rem;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.35);
    }

    .meta-chip {
      display: inline-flex;
      align-items: center;
      border-radius: 0.4rem;
      background: rgba(10, 147, 150, 0.16);
      padding: 0.15rem 0.5rem;
      font-size: 0.75rem;
      font-weight: 500;
      color: #19B8B4;
    }

    .format-label {
      display: flex;
      cursor: pointer;
      align-items: center;
      gap: 0.75rem;
      border-radius: 0.75rem;
      border: 1px solid #27231F;
      background: #1B1613;
      padding: 0.75rem 0.9rem;
      transition: border-color 0.15s ease, background-color 0.15s ease;
    }
    .format-label:hover { border-color: #0A9396; background: #211B17; }

    .tab-active {
      background: #95122C !important;
      color: #ffffff !important;
      box-shadow: 0 2px 8px rgba(149, 18, 44, 0.4);
    }
    .tab-inactive {
      background: transparent !important;
      color: #B8BDC4 !important;
    }
    .tab-inactive:hover { color: #F3F4F5 !important; }

    .primary-dark-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      border-radius: 0.75rem;
      background: linear-gradient(135deg, #95122C 0%, #7C0F24 100%);
      color: #ffffff;
      font-weight: 600;
      box-shadow: 0 8px 20px rgba(149, 18, 44, 0.3);
      transition: box-shadow 0.15s ease, opacity 0.15s ease, background-image 0.15s ease;
    }
    .primary-dark-btn:hover:not(:disabled) {
      background: linear-gradient(135deg, #C72C4B 0%, #95122C 100%);
      box-shadow: 0 12px 28px rgba(149, 18, 44, 0.42), 0 0 0 1px rgba(25, 184, 180, 0.3);
    }
    .primary-dark-btn:disabled { opacity: 0.6; cursor: not-allowed; }

    .secondary-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      border-radius: 0.65rem;
      border: 1px solid #27231F;
      background: #1B1613;
      color: #F3F4F5;
      font-weight: 500;
      transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    .secondary-btn:hover { background: #211B17; border-color: #0A9396; }

    @media (max-width: 640px) {
      .url-shell {
        flex-wrap: wrap;
        padding: 0.65rem;
      }
      .url-shell .url-icon { display: none; }
      .url-input {
        flex: 1 1 100%;
        order: 1;
        padding: 0.55rem 0.35rem;
        width: 100%;
      }
      .url-actions {
        display: flex;
        order: 2;
        width: 100%;
        gap: 0.5rem;
      }
      .url-actions .analyze-btn {
        flex: 1;
        height: 2.75rem;
      }
      #clear-btn { order: 1; }
    }
    @media (min-width: 641px) {
      .url-actions { display: contents; }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .fade-up, .toast-in, .toast-out { animation: none !important; }
      .spinner { animation-duration: 1.4s; }
      .feature-card { transition: none; }
      .feature-card:hover { transform: none; }
    }
