.ytx-root {
    --bg: #fff;
    --bg-muted: #f8fafc;
    --bg-img: #f1f5f9;
    --text: #1e293b;
    --text-label: #334155;
    --text-muted: #64748b;
    --text-placeholder: #cbd5e1;
    --border: #e2e8f0;
    --paste-bg: #f1f5f9;
    --paste-hover: #e2e8f0;
    --paste-color: #64748b;
    --paste-hover-color: #0f172a;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --shadow: rgba(0, 0, 0, 0.08);

    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .theme-dark .ytx-root {
    --bg: #0f172a;
    --bg-muted: #020617;
    --bg-img: #1e293b;
    --text: #f1f5f9;
    --text-label: #cbd5e1;
    --text-muted: #94a3b8;
    --text-placeholder: #475569;
    --border: #1e293b;
    --paste-bg: #1e293b;
    --paste-hover: #334155;
    --paste-color: #94a3b8;
    --paste-hover-color: #f1f5f9;
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #fca5a5;
    --shadow: rgba(0, 0, 0, 0.3);
  }

  .ytx-input-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .ytx-url-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 50px;
    box-shadow: 0 10px 40px var(--shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  .ytx-url-container:focus-within {
    border-color: #ef4444;
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
  }

  .ytx-search-icon {
    position: absolute;
    left: 1.5rem;
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  #ytx-url-input {
    width: 100%;
    padding: 1.25rem 3.5rem;
    padding-right: 4.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: var(--text);
    outline: none;
    font-weight: 500;
  }

  #ytx-url-input::placeholder {
    color: var(--text-placeholder);
    font-weight: 400;
  }

  .ytx-paste-btn {
    position: absolute;
    right: 0.5rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--paste-bg);
    color: var(--paste-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }

  .ytx-paste-btn:hover {
    background: var(--paste-hover);
    color: var(--paste-hover-color);
    transform: scale(1.05);
  }

  .ytx-paste-btn:active { transform: scale(0.95); }

  .ytx-helper-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
  }

  .ytx-results-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transition: opacity 0.4s;
  }

  .ytx-main-card {
    position: relative;
    background: var(--bg);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 10px 30px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
  }

  .ytx-ribbon {
    position: absolute;
    top: 2rem;
    left: -2.5rem;
    background: #ef4444;
    color: white;
    padding: 0.5rem 3rem;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    transform: rotate(-45deg);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    z-index: 10;
  }

  #ytx-main-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow);
    display: block;
    background: var(--bg-muted);
    min-height: 300px;
    object-fit: cover;
  }

  .ytx-card-actions {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .ytx-download-btn {
    background: #ef4444;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
  }

  .ytx-download-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.4);
  }

  .ytx-download-btn:active { transform: translateY(1px); }

  .ytx-resolutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  @media (max-width: 650px) {
    .ytx-resolutions-grid { grid-template-columns: 1fr; }
  }

  .ytx-res-card {
    background: var(--bg);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
  }

  .ytx-res-card img {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--bg-img);
  }

  .ytx-res-label {
    margin: 0;
    font-weight: 700;
    color: var(--text-label);
    font-size: 0.95rem;
  }

  .ytx-res-card a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
  }

  .ytx-res-card a:hover {
    color: #2563eb;
    text-decoration: underline;
  }

  .ytx-error-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--error-bg);
    border-left: 4px solid #ef4444;
    color: var(--error-text);
    padding: 1.5rem;
    border-radius: 12px;
    font-weight: 500;
  }

  .ytx-hidden {
    display: none;
  }