@media (max-width: 640px) {
  *, *::before, *::after {
    box-sizing: border-box;
  }

  body {
    background: #fff;
    align-items: stretch;
    overflow-x: hidden;
    width: 100%;
  }

  .app-container {
    padding: 0;
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    gap: 0;
    background: #fff;
    overflow-x: hidden;
  }

  .content-card {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* --- YouTube-style top bar --- */
  .app-header {
    padding: 44px 16px 8px;
    background: #fff;
    text-align: center;
    border-bottom: none;
  }

  .logo-container {
    margin-bottom: 0;
  }

  .brand-logo {
    gap: 10px;
    justify-content: center;
    align-items: center;
  }

  .brand-initials {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111;
    line-height: 1;
    letter-spacing: -0.5px;
  }

  .brand-right {
    gap: 1px;
    align-items: flex-start;
  }

  .brand-name {
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    color: #606060;
    font-weight: 500;
  }

  .brand-tagline {
    display: none;
  }

  .tagline {
    display: none !important;
  }

  .brand-logo, .brand-initials, .brand-name, .brand-tagline {
    animation: none;
  }

  /* --- Main area --- */
  .main-card {
    padding: 0;
    border-radius: 0;
    background: transparent;
    width: 100%;
    max-width: 100%;
  }

  .main-title {
    display: none;
  }

  /* --- Tabs - scrollable pill row to prevent overflow --- */
  .tabs-nav {
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 8px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
  }

  .tabs-nav::-webkit-scrollbar { display: none; }

  .tab-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 0.78rem;
    white-space: nowrap;
    min-width: 0;
    gap: 6px;
  }

  .tab-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  /* --- Platform pills as chip-style row --- */
  .platform-selector-wrapper {
    margin-bottom: 0;
    padding: 12px 16px 8px;
    background: #fff;
    width: 100%;
    max-width: 100%;
  }

  .selector-label {
    display: none;
  }

  .platform-list {
    gap: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .platform-list::-webkit-scrollbar { display: none; }

  .platform-btn {
    padding: 6px 14px;
    font-size: 0.78rem;
    gap: 5px;
    border-radius: 20px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #111;
    flex-shrink: 0;
    font-weight: 500;
    white-space: nowrap;
  }

  .platform-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
  }

  .platform-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  /* --- Input - minimal YouTube-style search --- */
  .input-section {
    margin-bottom: 0;
    padding: 0 16px 12px;
    width: 100%;
    max-width: 100%;
  }

  .input-form {
    flex-direction: row;
    gap: 8px;
    background: #f2f2f2;
    border-radius: 24px;
    overflow: hidden;
    border: none;
    padding: 0;
    align-items: center;
    width: 100%;
  }

  .input-group {
    flex: 1;
    min-width: 0;
  }

  .url-input {
    height: 44px;
    padding: 0 16px;
    font-size: 0.9rem;
    border: none;
    border-radius: 24px;
    background: #f2f2f2;
    color: #111;
    width: 100%;
    box-sizing: border-box;
  }

  .url-input:focus {
    box-shadow: none;
    background: #fff;
    border: 1px solid #1a73e8;
  }

  .url-input::placeholder {
    color: #888;
    font-size: 0.85rem;
  }

  .input-label {
    display: none;
  }

  .fetch-btn {
    width: 44px;
    height: 44px;
    font-size: 0;
    font-weight: 600;
    padding: 0;
    border-radius: 50%;
    min-width: unset;
    background: #1a73e8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .fetch-btn::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    border: 2.5px solid #fff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 0.6s linear infinite;
    opacity: 0;
  }

  .fetch-btn.loading::before {
    opacity: 1;
  }

  .fetch-btn.loading .btn-text::after {
    display: none;
  }

  .fetch-btn .btn-text {
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .fetch-btn .btn-text::after {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
  }

  .btn-loader {
    display: none !important;
  }

  .clear-btn {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
  }

  .url-input:not(:placeholder-shown) ~ .clear-btn {
    display: flex;
  }

  .clear-btn svg {
    width: 16px;
    height: 16px;
  }

  /* --- Results - YouTube-style content card --- */
  .results-card {
    border-top: 1px solid #e5e5e5;
    padding: 16px;
    margin-top: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: 8px solid #f2f2f2;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .results-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
  }

  .video-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: #111;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .option-row {
    padding: 14px 12px;
    border-radius: 0;
    background: transparent;
    border: none;
    flex-direction: row;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
  }

  .option-row:last-child {
    border-bottom: none;
  }

  .option-quality {
    font-size: 0.88rem;
    font-weight: 500;
    color: #111;
    flex-shrink: 0;
  }

  .option-details {
    font-size: 0.78rem;
    color: #606060;
    margin-top: 1px;
  }

  .option-info {
    min-width: 0;
    flex: 1;
  }

  .download-option-btn {
    font-size: 0.82rem;
    padding: 8px 18px;
    border-radius: 20px;
    background: #1a73e8;
    color: #fff;
    border: none;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .options-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
  }

  .media-preview-graphic {
    border-radius: 8px;
    border: none;
    background: #f2f2f2;
    max-width: 100%;
  }

  .download-options {
    gap: 8px;
  }

  /* --- Progress --- */
  .download-progress-container {
    padding: 16px;
    margin: 0;
    border-radius: 0;
    border: none;
    background: #fff;
    border-top: 8px solid #f2f2f2;
    width: 100%;
    max-width: 100%;
  }

  /* --- Reviews - YouTube-style section --- */
  .reviews-section {
    padding: 20px 16px;
    margin: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    border: none;
    border-top: 8px solid #f2f2f2;
    width: 100%;
    max-width: 100%;
  }

  .reviews-header {
    flex-direction: row;
    text-align: left;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e5e5;
  }

  .rating-summary-card {
    text-align: center;
    min-width: 80px;
    flex-shrink: 0;
  }

  .big-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111;
  }

  .stars-display {
    font-size: 0.82rem;
    letter-spacing: 2px;
    white-space: nowrap;
  }

  .rating-count-info {
    font-size: 0.7rem;
    color: #606060;
  }

  .reviews-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
  }

  .reviews-section-subtitle {
    font-size: 0.75rem;
    color: #606060;
    margin-top: 2px;
  }

  .reviews-list {
    max-height: 320px;
    gap: 12px;
  }

  .review-card {
    padding: 14px 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f0f0f0;
  }

  .review-card:last-child {
    border-bottom: none;
  }

  .review-card-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }

  .review-user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
    background: #1a73e8;
    font-weight: 600;
    flex-shrink: 0;
  }

  .review-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
  }

  .review-card-comment {
    font-size: 0.82rem;
    line-height: 1.4;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .review-stars {
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .review-date {
    font-size: 0.68rem;
    color: #606060;
    white-space: nowrap;
  }

  /* --- Bulk section - YouTube style --- */
  .bulk-section {
    padding: 0;
    margin-top: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .bulk-inputs {
    gap: 8px;
    padding: 16px;
    width: 100%;
    max-width: 100%;
  }

  .bulk-input-row {
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    background: #f2f2f2;
    border-radius: 24px;
    padding: 2px 14px;
    border: none;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .bulk-input-row .input-group {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .bulk-url-input {
    font-size: 0.88rem !important;
    height: 44px !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #111 !important;
  }

  .bulk-url-input::placeholder {
    color: #888;
  }

  .bulk-url-input:focus {
    box-shadow: none !important;
  }

  .bulk-row-status {
    font-size: 0.65rem;
    min-width: 44px;
    text-align: center;
    font-weight: 500;
    flex-shrink: 0;
  }

  .bulk-actions {
    flex-direction: row;
    gap: 8px;
    padding: 0 16px 16px;
    width: 100%;
    max-width: 100%;
  }

  .bulk-actions .fetch-btn {
    flex: 1;
    height: 40px;
    font-size: 0.82rem;
    border-radius: 20px;
    background: #1a73e8;
    font-weight: 500;
    width: auto;
    min-width: 0;
  }

  .bulk-toggle-btn {
    padding: 8px 14px;
    font-size: 0.78rem;
    border-radius: 20px;
    background: #f2f2f2;
    border: none;
    color: #111;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .bulk-add-hint {
    font-size: 0.65rem;
    color: #606060;
    text-align: center;
    white-space: nowrap;
  }

  #bulk-results-container {
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  .bulk-result-card {
    padding: 14px 16px;
    border-radius: 0;
    overflow: hidden;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    margin-top: 0;
    background: #fff;
    width: 100%;
    max-width: 100%;
  }

  .bulk-result-body {
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
  }

  .bulk-result-thumb {
    width: 120px;
    min-width: 120px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
  }

  .bulk-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .bulk-result-info {
    min-width: 0;
    flex: 1;
  }

  .bulk-result-title {
    font-size: 0.85rem;
    white-space: normal;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    margin-bottom: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .bulk-result-meta {
    font-size: 0.72rem;
    color: #606060;
  }

  .bulk-result-options {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }

  .bulk-result-options .download-option-btn {
    width: auto;
    text-align: center;
    font-size: 0.72rem;
    padding: 5px 12px;
    background: #f2f2f2;
    color: #111;
    border: none;
    border-radius: 16px;
    font-weight: 500;
  }

  .bulk-result-url {
    font-size: 0.65rem;
    color: #606060;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* --- Error message --- */
  .error-msg {
    padding: 0 16px;
    font-size: 0.78rem;
    margin-top: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* --- Modal - bottom sheet --- */
  .review-modal-overlay {
    align-items: flex-end;
    background: rgba(0,0,0,0.5);
  }

  .review-modal {
    padding: 24px 20px 32px;
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    animation: slideUp 0.25s ease-out;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  .modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
  }

  .modal-description {
    font-size: 0.8rem;
    color: #606060;
  }

  .submit-review-btn {
    padding: 14px 18px;
    font-size: 0.9rem;
    border-radius: 24px;
    font-weight: 600;
    background: #1a73e8;
  }

  /* --- Footer --- */
  .app-footer {
    padding: 16px;
    font-size: 0.72rem;
    color: #606060;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
  }

  .footer-links {
    gap: 12px;
    flex-wrap: wrap;
  }

  .footer-links a {
    font-size: 0.72rem;
    color: #1a73e8;
  }

  /* --- Toast --- */
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .toast {
    padding: 12px 14px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    background: #323232;
    color: #fff;
  }

  .toast-content {
    font-size: 0.82rem;
  }

  .toast-close {
    color: rgba(255,255,255,0.6);
  }

  /* --- Progress bar --- */
  .progress-bar-wrapper {
    height: 4px;
    border-radius: 2px;
  }

  .progress-bar-fill {
    border-radius: 2px;
  }

  .previous-preview-area {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  .results-layout { grid-template-columns: 1fr; }
}
