/* ============================================================
   YouTube Thumbnail Tester -- Styles
   Faithfully recreates YouTube's visual language:
   - Roboto font family
   - Exact color tokens for light/dark modes
   - 16:9 thumbnail aspect ratios
   - YouTube's spacing, border-radius, typography scale
   ============================================================ */

/* --- Reset & Base (scoped to .tt-shell for Webflow embedding) --- */
.tt-shell, .tt-shell *, .tt-shell *::before, .tt-shell *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Tool Shell + Design Tokens (Light Mode Default) --- */
.tt-shell {
  /* YouTube light mode palette */
  --yt-bg-primary: #ffffff;
  --yt-bg-secondary: #f2f2f2;
  --yt-bg-elevated: #ffffff;
  --yt-bg-hover: rgba(0, 0, 0, 0.05);
  --yt-text-primary: #0f0f0f;
  --yt-text-secondary: #606060;
  --yt-text-disabled: #909090;
  --yt-border: #e5e5e5;
  --yt-chip-bg: #f2f2f2;
  --yt-chip-bg-active: #0f0f0f;
  --yt-chip-text: #0f0f0f;
  --yt-chip-text-active: #ffffff;
  --yt-badge-bg: rgba(0, 0, 0, 0.8);
  --yt-badge-text: #ffffff;
  --yt-avatar-bg: #e0e0e0;
  --yt-link-color: #065fd4;
  --yt-red: #ff0000;
  --yt-overlay-bg: rgba(0, 0, 0, 0.6);

  /* Tool-specific */
  --tool-accent: #ff0000;
  --tool-accent-hover: #cc0000;
  --tool-success: #2e7d32;
  --tool-warning: #f57c00;
  --tool-info: #1565c0;
  --tool-upload-border: #c4c4c4;
  --tool-upload-bg: #fafafa;

  /* Scoring UI */
  --score-high: #2e7d32;
  --score-medium: #f57c00;
  --score-low: #c62828;

  /* Layout */
  --search-max-width: 1096px;
  --homepage-card-width: 360px;
  --sidebar-thumb-width: 168px;

  /* Shell layout */
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;

  /* Base typography (replaces body) */
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--yt-bg-primary);
  color: var(--yt-text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Dark Mode (scoped) --- */
.tt-shell[data-theme="dark"] {
  --yt-bg-primary: #0f0f0f;
  --yt-bg-secondary: #272727;
  --yt-bg-elevated: #212121;
  --yt-bg-hover: rgba(255, 255, 255, 0.1);
  --yt-text-primary: #f1f1f1;
  --yt-text-secondary: #aaaaaa;
  --yt-text-disabled: #717171;
  --yt-border: #3f3f3f;
  --yt-chip-bg: #3f3f3f;
  --yt-chip-bg-active: #f1f1f1;
  --yt-chip-text: #f1f1f1;
  --yt-chip-text-active: #0f0f0f;
  --yt-badge-bg: rgba(0, 0, 0, 0.8);
  --yt-badge-text: #ffffff;
  --yt-avatar-bg: #3f3f3f;
  --yt-link-color: #3ea6ff;

  --tool-upload-border: #3f3f3f;
  --tool-upload-bg: #1a1a1a;
}

.tt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--yt-border);
  margin-bottom: 24px;
}

.tt-header__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--yt-text-primary);
}

.tt-header__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Theme Toggle --- */
.theme-toggle {
  position: relative;
  width: 48px;
  height: 24px;
  background: var(--yt-chip-bg);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

/* Expand touch target to 44px without changing visible toggle size */
.theme-toggle::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -4px;
  right: -4px;
  bottom: -10px;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--yt-text-primary);
  border-radius: 50%;
  transition: transform 0.2s;
}

.tt-shell[data-theme="dark"] .theme-toggle::after {
  transform: translateX(24px);
}

.theme-toggle__label {
  font-size: 12px;
  color: var(--yt-text-secondary);
  margin-right: 4px;
}

/* --- Upload Area --- */
.tt-upload {
  margin-bottom: 32px;
}

.tt-upload__zone {
  display: block;
  border: 2px dashed var(--tool-upload-border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  background: var(--tool-upload-bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.tt-upload__zone:hover,
.tt-upload__zone.tt-dragging {
  border-color: var(--yt-red);
  background: rgba(255, 0, 0, 0.03);
}

.tt-upload__zone:focus-visible {
  outline: 3px solid var(--yt-link-color);
  outline-offset: 2px;
}

.tt-shell[data-theme="dark"] .tt-upload__zone:hover,
.tt-shell[data-theme="dark"] .tt-upload__zone.tt-dragging {
  background: rgba(255, 0, 0, 0.06);
}

.tt-upload__zone--has-image {
  padding: 16px;
  border-style: solid;
}

.tt-upload__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--yt-text-secondary);
}

.tt-upload__text {
  font-size: 14px;
  color: var(--yt-text-secondary);
  margin-bottom: 4px;
}

.tt-upload__text strong {
  color: var(--yt-link-color);
}

.tt-upload__hint {
  font-size: 12px;
  color: var(--yt-text-disabled);
}

.tt-upload__preview {
  max-width: 320px;
  max-height: 180px;
  border-radius: 8px;
  object-fit: cover;
}

.tt-upload__clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: var(--yt-badge-bg);
  color: var(--yt-badge-text);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-file-input-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(100%);
  border: 0;
  white-space: nowrap;
}

/* --- Thumbnail Library (multi-upload) --- */
.tt-thumb-manager {
  margin-bottom: 16px;
}

#thumb-empty-state {
  padding: 28px 16px;
}

.tt-thumb-library {
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 10px;
  background: var(--yt-bg-secondary);
  transition: border-color 0.2s, background 0.2s;
}

.tt-thumb-library.tt-dragging {
  border-color: var(--yt-red);
  background: rgba(255, 0, 0, 0.03);
}

.tt-shell[data-theme="dark"] .tt-thumb-library.tt-dragging {
  background: rgba(255, 0, 0, 0.06);
}

.tt-thumb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.tt-thumb-item {
  position: relative;
}

.tt-thumb-item__select {
  width: 100%;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: var(--yt-bg-primary);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.tt-thumb-item--active .tt-thumb-item__select {
  border-color: var(--yt-red);
}

.tt-thumb-item__select img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tt-thumb-item__index {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: var(--yt-badge-bg);
  color: var(--yt-badge-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
}

.tt-thumb-item__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--yt-badge-bg);
  color: var(--yt-badge-text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.tt-thumb-add-btn {
  width: 100%;
  min-height: 36px;
  border: 1px dashed var(--tool-upload-border);
  border-radius: 8px;
  background: var(--yt-bg-primary);
  color: var(--yt-text-secondary);
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.tt-thumb-add-btn:hover {
  border-color: var(--yt-red);
  color: var(--yt-text-primary);
}

/* --- Input Fields --- */
.tt-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.tt-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-input-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--yt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tt-input {
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--yt-bg-primary);
  color: var(--yt-text-primary);
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.tt-input:focus {
  border-color: var(--yt-link-color);
}

.tt-input::placeholder {
  color: var(--yt-text-disabled);
}

/* --- Primary Input Modifier --- */
.tt-input-group--primary {
  grid-column: 1 / -1;
}

.tt-section-toggle,
.tt-collapsible {
  grid-column: 1 / -1;
}

/* --- Section Toggle (Progressive Disclosure) --- */
.tt-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--yt-bg-secondary);
  border: 1px solid var(--yt-border);
  color: var(--yt-text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.2s;
}

.tt-section-toggle:hover {
  background: var(--yt-bg-hover);
}

.tt-section-toggle--active {
  /* Visual indicator that section is expanded */
}

.tt-section-toggle__icon {
  font-size: 18px;
  transition: transform 0.2s;
}

.tt-section-toggle--active .tt-section-toggle__icon {
  transform: rotate(45deg);
}

/* --- Collapsible Container --- */
.tt-collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.tt-collapsible--expanded {
  max-height: 500px;
}

.tt-collapsible--advanced.tt-collapsible--expanded {
  max-height: 800px;
}

.tt-collapsible__content {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tt-collapsible__content--advanced {
  grid-template-columns: 1fr;
  gap: 16px;
}

.tt-collapsible__content--advanced .tt-actions {
  margin-bottom: 0;
}

.tt-collapsible--advanced .tt-collapsible__content {
  grid-template-columns: 1fr;
}

.tt-collapsible--advanced .tt-collapsible,
.tt-collapsible--advanced .tt-section-toggle,
.tt-collapsible--advanced .tt-input-group {
  min-width: 0;
  max-width: 100%;
}

.tt-collapsible--advanced .tt-input {
  min-width: 0;
  width: 100%;
}

/* --- Prompt Teaser --- */
.tt-prompt-teaser {
  padding: 16px 20px;
  background: var(--yt-bg-secondary);
  border: 1px solid var(--yt-border);
  margin-top: 16px;
  text-align: center;
  color: var(--yt-text-secondary);
  font-size: 14px;
}

/* --- Analyze Action (after thumbnail library) --- */
.tt-analyze-action {
  margin: 12px 0 16px;
}

.tt-analyze-action .tt-btn {
  width: 100%;
}

/* --- Action Buttons --- */
.tt-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tt-status-message {
  margin: -16px 0 20px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--yt-border);
  font-size: 13px;
}

.tt-status-message--error {
  background: rgba(198, 40, 40, 0.08);
  border-color: rgba(198, 40, 40, 0.35);
  color: var(--score-low);
}

.tt-status-message--info {
  background: rgba(21, 101, 192, 0.08);
  border-color: rgba(21, 101, 192, 0.35);
  color: var(--tool-info);
}

.tt-btn {
  padding: 10px 20px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Roboto', Arial, sans-serif;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tt-btn--primary {
  background: var(--yt-red);
  color: #ffffff;
}

.tt-btn--primary:hover:not(:disabled) {
  background: var(--tool-accent-hover);
}

.tt-btn--secondary {
  background: var(--yt-chip-bg);
  color: var(--yt-chip-text);
}

.tt-btn--secondary:hover:not(:disabled) {
  background: var(--yt-bg-hover);
}

.tt-btn--active {
  background: var(--yt-chip-bg-active);
  color: var(--yt-chip-text-active);
}

/* --- View Switcher (Chip Bar) --- */
.tt-view-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--yt-border);
  overflow-x: auto;
}

.tt-view-chip {
  padding: 8px 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--yt-chip-bg);
  color: var(--yt-chip-text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.tt-view-chip:hover {
  background: var(--yt-bg-hover);
}

.tt-view-chip--active {
  background: var(--yt-chip-bg-active);
  color: var(--yt-chip-text-active);
}

/* --- Mobile Preview Toggle --- */
.tt-mobile-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tt-mobile-toggle__btn {
  padding: 6px 12px;
  min-height: 44px;
  min-width: 44px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--yt-chip-bg);
  color: var(--yt-chip-text);
  border: 1px solid var(--yt-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.tt-mobile-toggle__btn--active {
  background: var(--yt-chip-bg-active);
  color: var(--yt-chip-text-active);
  border-color: transparent;
}

/* --- Mockup Container --- */
.tt-mockup-container {
  background: var(--yt-bg-primary);
  overflow: hidden;
  transition: max-width 0.3s;
}

.tt-mockup-container--mobile {
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  border: 3px solid #1a1a1a;
  border-radius: 40px;
  padding-top: 32px;
  padding-bottom: 20px;
  box-shadow: 0 0 0 2px #333, 0 8px 40px rgba(0, 0, 0, 0.25);
}

/* Notch indicator */
.tt-mockup-container--mobile::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
}

/* Home bar indicator */
.tt-mockup-container--mobile::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--yt-text-disabled);
  border-radius: 2px;
}

/* Dark mode bezel adjustments */
.tt-shell[data-theme="dark"] .tt-mockup-container--mobile {
  border-color: #555;
  box-shadow: 0 0 0 2px #444, 0 8px 40px rgba(0, 0, 0, 0.5);
}

.tt-shell[data-theme="dark"] .tt-mockup-container--mobile::before {
  background: #555;
}

.tt-mockup-container--desktop {
  max-width: 100%;
}

/* ============================================================
   YOUTUBE PAGE CHROME -- Header bar, search, category chips
   Static elements inside mockup-container, above mockup-content.
   All colors use --yt-* tokens for automatic dark mode switching.
   ============================================================ */

.yt-chrome {
  border-bottom: 1px solid var(--yt-border);
}

/* Header bar */
.yt-chrome__header {
  height: 56px;
  background: var(--yt-bg-primary);
  border-bottom: 1px solid var(--yt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}

.yt-chrome__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--yt-text-primary);
}

.yt-chrome__logo-mark {
  width: 36px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yt-chrome__logo-mark svg {
  width: 100%;
  height: 100%;
}

.yt-chrome__logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1;
}

.yt-chrome__logo-locale {
  font-size: 10px;
  color: var(--yt-text-secondary);
  align-self: flex-start;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* Search bar (decorative, not interactive) */
.yt-chrome__search {
  flex: 1;
  max-width: 600px;
  height: 40px;
  display: flex;
  align-items: center;
}

.yt-chrome__search-box {
  flex: 1;
  height: 40px;
  border: 1px solid var(--yt-border);
  border-right: none;
  border-radius: 20px 0 0 20px;
  padding: 0 16px;
  background: var(--yt-bg-primary);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.yt-chrome__search-text {
  font-size: 16px;
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--yt-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* When search text has real content (not placeholder), use primary color */
.yt-chrome__search-text--has-value {
  color: var(--yt-text-primary);
}

.yt-chrome__search-btn {
  flex-shrink: 0;
  width: 64px;
  height: 40px;
  background: var(--yt-bg-secondary);
  border: 1px solid var(--yt-border);
  border-radius: 0 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yt-text-primary);
}

/* Right-side actions */
.yt-chrome__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.yt-chrome__icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--yt-text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.yt-chrome__icon-btn svg {
  width: 20px;
  height: 20px;
}

.yt-chrome__mic {
  display: flex;
  align-items: center;
  color: var(--yt-text-primary);
}

.yt-chrome__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--yt-avatar-bg);
}

/* Category chips bar */
.yt-chrome__chips {
  height: 48px;
  background: var(--yt-bg-primary);
  border-bottom: 1px solid var(--yt-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.yt-chrome__chips::-webkit-scrollbar {
  display: none;
}

.yt-chrome__chip {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--yt-chip-bg);
  color: var(--yt-chip-text);
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.yt-chrome__chip--active {
  background: var(--yt-chip-bg-active);
  color: var(--yt-chip-text-active);
  border-color: transparent;
}

/* --- Chrome responsive: mobile viewport simulation --- */
.tt-mockup-container--mobile .yt-chrome__search {
  display: none;
}

.tt-mockup-container--mobile .yt-chrome__mic {
  display: none;
}

/* --- Chrome responsive: real viewport breakpoints --- */
@media (max-width: 767px) {
  .yt-chrome__search {
    display: none;
  }

  .yt-chrome__mic {
    display: none;
  }

  .yt-chrome__logo-text {
    font-size: 18px;
  }

  .yt-chrome__logo-locale {
    display: none;
  }
}

/* ============================================================
   YOUTUBE SEARCH RESULTS MOCKUP
   Layout: Horizontal -- thumbnail left (360x202), metadata right
   Matches YouTube's actual search result cards
   ============================================================ */

.yt-search {
  padding: 16px 24px;
}

.yt-search__result {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.yt-search__result:hover .yt-search__title {
  color: var(--yt-text-primary);
}

/* Thumbnail wrapper: fixed 360x202 (16:9) with rounded corners */
.yt-search__thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 360px;
  height: 202px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--yt-bg-secondary);
}

.yt-search__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.yt-search__thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 45%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Duration badge -- bottom-right overlay */
.yt-search__duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--yt-badge-bg);
  color: var(--yt-badge-text);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.3;
  z-index: 1;
}

/* Metadata column */
.yt-search__meta {
  display: flex;
  flex-direction: column;
  padding-top: 2px;
  min-width: 0;
}

.yt-search__title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.yt-search__title {
  flex: 1;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--yt-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yt-search__stats {
  font-size: 12px;
  color: var(--yt-text-secondary);
  margin-bottom: 8px;
}

.yt-search__channel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.yt-search__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--yt-avatar-bg);
  flex-shrink: 0;
  overflow: hidden;
}

.yt-search__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-search__channel-name {
  font-size: 12px;
  color: var(--yt-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.yt-search__description {
  font-size: 12px;
  color: var(--yt-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* User's thumbnail highlight */
.yt-search__result--user .yt-search__thumb-wrap {
  outline: 3px solid var(--yt-red);
  outline-offset: -3px;
}

.yt-search__result--user .yt-search__title::before {
  content: 'YOUR THUMBNAIL';
  font-size: 10px;
  font-weight: 700;
  color: var(--yt-red);
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

/* ============================================================
   YOUTUBE HOMEPAGE FEED MOCKUP
   Layout: Card grid -- thumbnail on top (16:9), metadata below
   Matches YouTube's homepage video card grid
   ============================================================ */

.yt-home {
  padding: 16px;
}

.yt-home-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
}

.yt-nav-rail {
  border-right: 1px solid var(--yt-border);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yt-nav-rail__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  padding: 8px 4px;
  color: var(--yt-text-primary);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
}

.yt-nav-rail__item svg {
  width: 20px;
  height: 20px;
}

.yt-nav-rail__item--active {
  background: var(--yt-bg-secondary);
}

@media (max-width: 1050px) {
  .yt-home-shell {
    grid-template-columns: 1fr;
  }

  .yt-nav-rail {
    display: none;
  }
}

.yt-home__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 12px;
}

.yt-home__card {
  cursor: pointer;
  transition: transform 0.18s ease;
}

.yt-home__card:hover .yt-home__title {
  color: var(--yt-text-primary);
}

/* Thumbnail: 16:9 aspect ratio, rounded corners */
.yt-home__thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--yt-bg-secondary);
  margin-bottom: 12px;
}

.yt-home__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.yt-home__thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0) 45%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.yt-home__duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--yt-badge-bg);
  color: var(--yt-badge-text);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.3;
  z-index: 1;
}

/* Metadata row: avatar left, text right */
.yt-home__info {
  display: flex;
  gap: 12px;
}

.yt-home__meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.yt-home__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--yt-avatar-bg);
  flex-shrink: 0;
  overflow: hidden;
}

.yt-home__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-home__text {
  min-width: 0;
}

.yt-home__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--yt-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.yt-home__channel-name {
  font-size: 12px;
  color: var(--yt-text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.yt-home__stats {
  font-size: 12px;
  color: var(--yt-text-secondary);
}

/* User's thumbnail highlight */
.yt-home__card--user .yt-home__thumb-wrap {
  outline: 3px solid var(--yt-red);
  outline-offset: -3px;
}

.yt-home__card--user .yt-home__title::before {
  content: 'YOUR THUMBNAIL';
  font-size: 10px;
  font-weight: 700;
  color: var(--yt-red);
  display: block;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

/* ============================================================
   YOUTUBE SUGGESTED SIDEBAR MOCKUP
   Layout: Compact horizontal -- small thumbnail left (168x94),
   stacked metadata right. Matches YouTube's watch page sidebar.
   ============================================================ */

.yt-sidebar {
  padding: 0;
  max-width: 426px;
}

.yt-sidebar__item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.yt-sidebar__item:hover .yt-sidebar__title {
  color: var(--yt-text-primary);
}

/* Compact thumbnail: 168x94 (16:9) */
.yt-sidebar__thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 168px;
  height: 94px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--yt-bg-secondary);
}

.yt-sidebar__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.yt-sidebar__thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 45%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.yt-sidebar__duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--yt-badge-bg);
  color: var(--yt-badge-text);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.3;
  z-index: 1;
}

.yt-sidebar__meta {
  min-width: 0;
  padding-top: 1px;
}

.yt-sidebar__title-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.yt-sidebar__title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--yt-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

.yt-sidebar__channel-name {
  font-size: 12px;
  color: var(--yt-text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.yt-sidebar__stats {
  font-size: 12px;
  color: var(--yt-text-secondary);
}

/* User's thumbnail highlight */
.yt-sidebar__item--user .yt-sidebar__thumb-wrap {
  outline: 2px solid var(--yt-red);
  outline-offset: -2px;
}

.yt-sidebar__item--user .yt-sidebar__title::before {
  content: 'YOUR THUMBNAIL';
  font-size: 9px;
  font-weight: 700;
  color: var(--yt-red);
  display: block;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

/* Shared YouTube-style overflow menu (three vertical dots) */
.yt-overflow-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--yt-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: default;
}

.yt-overflow-btn svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .yt-search__result:hover .yt-search__thumb,
  .yt-home__card:hover .yt-home__thumb,
  .yt-sidebar__item:hover .yt-sidebar__thumb {
    transform: scale(1.02);
    filter: saturate(1.06);
  }

  .yt-search__result:hover .yt-search__thumb-wrap::after,
  .yt-home__card:hover .yt-home__thumb-wrap::after,
  .yt-sidebar__item:hover .yt-sidebar__thumb-wrap::after {
    opacity: 1;
  }

  .yt-overflow-btn:hover,
  .yt-chrome__icon-btn:hover {
    background: var(--yt-bg-hover);
    color: var(--yt-text-primary);
  }
}

/* ============================================================
   YOUTUBE WATCH PAGE LAYOUT
   Player left + suggested sidebar right (desktop),
   stacked vertically (mobile / narrow)
   ============================================================ */

.yt-watch {
  display: grid;
  grid-template-columns: 1fr 426px;
  gap: 24px;
  padding: 24px;
}

.yt-watch__player {
  min-width: 0;
}

.yt-watch__sidebar {
  min-width: 0;
}

/* Stack vertically on narrow viewports / mobile sim */
.tt-mockup-container--mobile .yt-watch {
  grid-template-columns: 1fr;
}

@media (max-width: 991px) {
  .yt-watch {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MOCK VIDEO PLAYER -- Static frame with play button
   Black 16:9 area, centered play icon, bottom controls bar
   ============================================================ */

.yt-player {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.yt-player__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-player__play-btn {
  width: 68px;
  height: 48px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.yt-player__play-btn svg {
  width: 32px;
  height: 32px;
}

.yt-player__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #181818;
}

.yt-player__progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.yt-player__progress-fill {
  width: 0%;
  height: 100%;
  background: var(--yt-red);
  border-radius: 2px;
}

.yt-player__time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Roboto', Arial, sans-serif;
  white-space: nowrap;
}

/* ============================================================
   Verified Badge Icon (inline SVG via CSS)
   ============================================================ */

.yt-verified {
  display: inline-flex;
  align-items: center;
  width: 14px;
  height: 14px;
  color: var(--yt-text-secondary);
}

/* ============================================================
   Placeholder Thumbnails (Skeleton Loaders)
   ============================================================ */

.yt-skeleton {
  background: var(--yt-bg-secondary);
  animation: yt-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes yt-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.yt-skeleton-text {
  height: 14px;
  border-radius: 2px;
  background: var(--yt-bg-secondary);
  animation: yt-skeleton-pulse 1.5s ease-in-out infinite;
}

.yt-skeleton-text--short { width: 60%; }
.yt-skeleton-text--medium { width: 80%; }
.yt-skeleton-text--long { width: 95%; }

/* ============================================================
   Empty State / Loading
   ============================================================ */

.tt-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--yt-text-secondary);
}

.tt-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.5;
}

.tt-empty__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--yt-text-primary);
  margin-bottom: 8px;
}

.tt-empty__text {
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

.tt-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px;
  color: var(--yt-text-secondary);
  font-size: 14px;
}

.tt-loading__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--yt-border);
  border-top-color: var(--yt-red);
  border-radius: 50%;
  animation: tt-spin 0.8s linear infinite;
}

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

/* ============================================================
   RESPONSIVE -- Mobile
   ============================================================ */

/* Mobile viewport simulation */
.tt-mockup-container--mobile .yt-search__result {
  flex-direction: column;
  gap: 12px;
}

.tt-mockup-container--mobile .yt-search__thumb-wrap {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.tt-mockup-container--mobile .yt-home__grid {
  grid-template-columns: 1fr;
}

.tt-mockup-container--mobile .yt-home-shell {
  grid-template-columns: 1fr;
}

.tt-mockup-container--mobile .yt-nav-rail {
  display: none;
}

.tt-mockup-container--mobile .yt-sidebar {
  max-width: 100%;
}

@media (max-width: 767px) {
  .tt-shell {
    padding: 16px 12px;
  }

  .tt-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  .tt-header__title {
    font-size: 18px;
  }

  .tt-header__controls {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tt-standout-toggle {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 11px;
    padding: 6px 10px;
  }

  .theme-toggle__label {
    display: none;
  }

  .tt-mode-toggle {
    width: 100%;
    margin-bottom: 12px;
  }

  .tt-mode-toggle__btn {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tt-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
  }

  .tt-actions .tt-btn {
    width: 100%;
    justify-content: center;
    font-size: 13px;
    padding: 10px 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tt-actions .tt-btn svg {
    flex-shrink: 0;
  }


  .tt-thumb-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tt-status-message {
    margin: -8px 0 16px;
  }

  .tt-inputs {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .tt-upload-row {
    margin-bottom: 12px;
  }

  .tt-upload {
    margin-bottom: 12px;
  }

  .tt-view-switcher {
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .tt-view-chip {
    max-width: 44vw;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 12px;
    font-size: 13px;
  }

  .yt-search__result {
    flex-direction: column;
    gap: 12px;
  }

  .yt-search__thumb-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .yt-search__title {
    font-size: 14px;
  }

  .yt-home__grid {
    grid-template-columns: 1fr;
  }

  .yt-sidebar {
    max-width: 100%;
  }

  .yt-sidebar__thumb-wrap {
    width: 120px;
    height: 68px;
  }

  .tt-collapsible__content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 478px) {
  .tt-thumb-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tt-upload__zone {
    padding: 24px 16px;
  }

  .tt-upload-row {
    margin-bottom: 10px;
  }

  .tt-inputs {
    gap: 10px;
    margin-bottom: 14px;
  }

  .tt-view-switcher {
    margin-bottom: 14px;
  }

  .tt-view-chip {
    max-width: 58vw;
    font-size: 12px;
    padding: 8px 10px;
  }

  .tt-view-chip svg {
    display: none;
  }

  .tt-actions {
    grid-template-columns: 1fr;
  }

  .tt-actions .tt-btn {
    font-size: 12px;
  }

  .tt-standout-toggle {
    flex: 1 1 100%;
  }

  .theme-toggle {
    margin-left: auto;
  }
}

/* ============================================================
   SCORING UI -- Score Panel, Composite Ring, Sub-Scores
   ============================================================ */

.tt-score-panel {
  background: var(--yt-bg-elevated);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 24px;
}

.tt-score-panel--empty {
  text-align: center;
  padding: 32px 24px;
}

.tt-score-panel__placeholder {
  font-size: 14px;
  color: var(--yt-text-secondary);
}

.tt-score-panel__composite {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

/* Composite score ring */
.tt-composite-score {
  position: relative;
  width: 120px;
  text-align: center;
}

.tt-composite-score__ring {
  width: 120px;
  height: 120px;
}

.tt-composite-score__value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 32px;
  font-weight: 700;
  color: var(--score-color, var(--yt-text-primary));
}

.tt-composite-score__label {
  font-size: 12px;
  color: var(--yt-text-secondary);
  margin-top: 4px;
}

/* Sub-score breakdown */
.tt-score-panel__breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.tt-sub-score {
  min-width: 0;
}

.tt-sub-score__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tt-sub-score__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--yt-text-primary);
}

.tt-sub-score__value {
  font-size: 14px;
  font-weight: 700;
}

.tt-sub-score__bar {
  height: 6px;
  background: var(--yt-bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.tt-sub-score__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

/* Suggestions */
.tt-suggestions {
  border-top: 1px solid var(--yt-border);
  padding-top: 16px;
}

.tt-suggestions__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text-primary);
  margin-bottom: 10px;
}

.tt-suggestions__list {
  list-style: none;
  padding: 0;
}

.tt-suggestions__item {
  font-size: 13px;
  color: var(--yt-text-secondary);
  padding: 6px 0 6px 20px;
  position: relative;
  line-height: 1.5;
}

.tt-suggestions__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tool-warning);
}

/* ============================================================
   MODE TOGGLE (Single / A vs B)
   ============================================================ */

.tt-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.tt-mode-toggle__btn {
  padding: 8px 20px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--yt-bg-primary);
  color: var(--yt-text-secondary);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tt-mode-toggle__btn:not(:last-child) {
  border-right: 1px solid var(--yt-border);
}

.tt-mode-toggle__btn--active {
  background: var(--yt-chip-bg-active);
  color: var(--yt-chip-text-active);
}

.tt-mode-toggle__btn:hover:not(.tt-mode-toggle__btn--active) {
  background: var(--yt-bg-hover);
}

/* ============================================================
   UPLOAD ROW -- Side-by-side in A/B mode
   ============================================================ */

.tt-upload-row {
  margin-bottom: 16px;
}

.tt-upload-row--ab {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 767px) {
  .tt-upload-row--ab {
    grid-template-columns: 1fr;
  }
}

.tt-upload__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--yt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.tt-upload {
  margin-bottom: 16px;
}

/* ============================================================
   A/B SPLIT MOCKUP -- Side-by-side YouTube mockups
   ============================================================ */

.tt-ab-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr);
  gap: 0;
  min-height: 300px;
  width: 100%;
  overflow: hidden;
}

.tt-ab-split__panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.tt-ab-split__label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--yt-badge-bg);
  color: var(--yt-badge-text);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  z-index: 2;
  letter-spacing: 0.5px;
}

.tt-ab-split__divider {
  width: 2px;
  background: var(--yt-border);
}

/* Constrain heavy mockup layouts so one panel cannot bleed into the other in A/B mode */
.tt-ab-split__panel .yt-search,
.tt-ab-split__panel .yt-home-shell,
.tt-ab-split__panel .yt-home,
.tt-ab-split__panel .yt-watch,
.tt-ab-split__panel .yt-sidebar {
  max-width: 100%;
}

.tt-ab-split__panel .yt-home-shell {
  grid-template-columns: 1fr;
}

.tt-ab-split__panel .yt-nav-rail {
  display: none;
}

.tt-ab-split__panel .yt-search {
  padding: 12px;
}

.tt-ab-split__panel .yt-home {
  padding: 12px;
}

.tt-ab-split__panel .yt-home__grid {
  grid-template-columns: 1fr;
}

.tt-ab-split__panel .yt-search__result {
  flex-direction: column;
  gap: 10px;
}

.tt-ab-split__panel .yt-search__thumb-wrap {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.tt-ab-split__panel .yt-watch {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}

@media (max-width: 767px) {
  .tt-ab-split {
    grid-template-columns: 1fr;
  }

  .tt-ab-split__divider {
    width: 100%;
    height: 2px;
  }
}

/* ============================================================
   A/B COMPARISON SCORES -- Side-by-side score panels
   ============================================================ */

.tt-comparison {
  background: var(--yt-bg-elevated);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 24px;
}

.tt-comparison__verdict {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--score-high);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--yt-border);
}

.tt-comparison__panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

@media (max-width: 767px) {
  .tt-comparison__panels {
    grid-template-columns: 1fr;
  }
}

.tt-comparison__panel {
  padding: 16px;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  background: var(--yt-bg-primary);
}

.tt-comparison__panel--winner {
  border-color: var(--score-high);
  box-shadow: 0 0 0 1px var(--score-high);
}

.tt-comparison__panel-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--yt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center;
}

.tt-comparison__scores .tt-score-panel__breakdown {
  grid-template-columns: 1fr;
}

/* ============================================================
   CTA SECTION
   ============================================================ */

.tt-cta {
  margin-top: 24px;
  background: linear-gradient(135deg, #ff000010, #ff000005);
  border: 1px solid var(--yt-red);
  border-radius: 12px;
  padding: 24px;
}

.tt-shell[data-theme="dark"] .tt-cta {
  background: linear-gradient(135deg, #ff000015, #ff000008);
}

.tt-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 600px) {
  .tt-cta__inner {
    flex-direction: column;
    text-align: center;
  }
}

.tt-cta__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--yt-text-primary);
  margin-bottom: 4px;
}

.tt-cta__subtitle {
  font-size: 14px;
  color: var(--yt-text-secondary);
}

.tt-cta__btn {
  white-space: nowrap;
  text-decoration: none;
  padding: 12px 24px;
  font-size: 15px;
}

/* ============================================================
   PHASE 2 -- F1: STAND-OUT MODE
   Blurs/dims competitor cards so user's thumbnail pops.
   ============================================================ */

.tt-standout-toggle {
  padding: 6px 12px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--yt-chip-bg);
  color: var(--yt-chip-text);
  border: 1px solid var(--yt-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tt-standout-toggle:hover {
  background: var(--yt-bg-hover);
}

.tt-standout-toggle--active {
  background: var(--yt-chip-bg-active);
  color: var(--yt-chip-text-active);
  border-color: transparent;
}

/* Stand-Out blur on competitor cards (search view) */
.tt-mockup-container--standout .yt-search__result:not(.yt-search__result--user) {
  filter: blur(3px) brightness(0.7);
  transition: filter 0.3s ease;
}

/* Stand-Out blur on competitor cards (homepage view) */
.tt-mockup-container--standout .yt-home__card:not(.yt-home__card--user) {
  filter: blur(3px) brightness(0.7);
  transition: filter 0.3s ease;
}

/* Stand-Out blur on competitor cards (sidebar view) */
.tt-mockup-container--standout .yt-sidebar__item:not(.yt-sidebar__item--user) {
  filter: blur(3px) brightness(0.7);
  transition: filter 0.3s ease;
}

/* Ensure user's card stays sharp */
.tt-mockup-container--standout .yt-search__result--user,
.tt-mockup-container--standout .yt-home__card--user,
.tt-mockup-container--standout .yt-sidebar__item--user {
  filter: none;
  transition: filter 0.3s ease;
}

/* ============================================================
   PHASE 2 -- TITLE GENERATOR
   AI-powered YouTube title suggestions panel.
   ============================================================ */

.tt-title-gen {
  margin-top: 24px;
  background: var(--yt-bg-elevated);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 24px;
}

.tt-title-gen__header {
  margin-bottom: 16px;
}

.tt-title-gen__heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--yt-text-primary);
  margin-bottom: 4px;
}

.tt-title-gen__subtext {
  font-size: 13px;
  color: var(--yt-text-secondary);
}

.tt-title-gen__btn {
  margin-bottom: 16px;
}

.tt-title-gen__results {
  border-top: 1px solid var(--yt-border);
  padding-top: 16px;
}

.tt-title-gen__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tt-title-gen__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.tt-title-gen__item:hover {
  background: var(--yt-bg-hover);
}

.tt-title-gen__item--error {
  color: var(--score-low);
}

.tt-title-gen__text {
  font-size: 14px;
  color: var(--yt-text-primary);
  line-height: 1.4;
  min-width: 0;
}

.tt-title-gen__copy {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--yt-border);
  border-radius: 6px;
  color: var(--yt-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tt-title-gen__copy:hover {
  background: var(--yt-bg-hover);
  color: var(--yt-text-primary);
}

/* ============================================================
   PHASE 2 -- PROMPT GENERATOR
   AI-powered thumbnail prompt generation panel.
   Appears inside the score panel after analysis.
   ============================================================ */

.tt-prompt-gen {
  border-top: 1px solid var(--yt-border);
  padding-top: 16px;
  margin-top: 16px;
}

.tt-prompt-gen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tt-prompt-gen__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--yt-text-primary);
}

.tt-prompt-gen__btn {
  font-size: 13px;
  padding: 8px 16px;
}

.tt-prompt-gen__result {
  margin-top: 12px;
}

.tt-prompt-gen__prompt-box {
  background: var(--yt-bg-secondary);
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.tt-prompt-gen__prompt-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--yt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.tt-prompt-gen__prompt-text {
  font-size: 14px;
  color: var(--yt-text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
}

.tt-prompt-gen__copy {
  font-size: 12px;
  padding: 6px 12px;
}

.tt-prompt-gen__tips {
  margin-bottom: 16px;
}

.tt-prompt-gen__tips-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--yt-text-primary);
  margin-bottom: 8px;
}

.tt-prompt-gen__tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tt-prompt-gen__tip {
  font-size: 13px;
  color: var(--yt-text-secondary);
  padding: 4px 0 4px 20px;
  position: relative;
  line-height: 1.5;
}

.tt-prompt-gen__tip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tool-info);
}

.tt-prompt-gen__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 20px;
  white-space: nowrap;
}

.tt-prompt-gen__error {
  font-size: 13px;
  color: var(--score-low);
  padding: 12px;
  text-align: center;
}

@media (max-width: 767px) {
  .tt-score-panel {
    padding: 18px;
    border-radius: 10px;
  }

  .tt-score-panel__composite {
    margin-bottom: 16px;
  }

  .tt-composite-score {
    width: 108px;
  }

  .tt-composite-score__ring {
    width: 108px;
    height: 108px;
  }

  .tt-composite-score__value {
    font-size: 28px;
  }

  .tt-composite-score__label {
    font-size: 11px;
  }

  .tt-score-panel__breakdown {
    gap: 12px;
    margin-bottom: 16px;
  }

  .tt-sub-score__label {
    font-size: 12px;
  }

  .tt-sub-score__value {
    font-size: 13px;
  }

  .tt-suggestions {
    padding-top: 12px;
  }

  .tt-suggestions__title {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .tt-suggestions__item {
    font-size: 12px;
    line-height: 1.45;
    padding: 4px 0 4px 16px;
  }

  .tt-suggestions__item::before {
    top: 10px;
    width: 6px;
    height: 6px;
  }

  .tt-comparison {
    padding: 16px;
  }

  .tt-comparison__verdict {
    font-size: 15px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .tt-comparison__panels {
    gap: 12px;
    margin-bottom: 14px;
  }

  .tt-comparison__panel {
    padding: 12px;
  }

  .tt-comparison__panel-label {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .tt-prompt-gen {
    padding-top: 12px;
    margin-top: 12px;
  }

  .tt-prompt-gen__header {
    gap: 8px;
    margin-bottom: 10px;
  }

  .tt-prompt-gen__title {
    font-size: 13px;
  }

  .tt-prompt-gen__btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  .tt-prompt-gen__prompt-box {
    padding: 12px;
  }

  .tt-prompt-gen__prompt-text {
    font-size: 13px;
    line-height: 1.5;
  }

  .tt-prompt-gen__tips-label {
    font-size: 12px;
  }

  .tt-prompt-gen__tip {
    font-size: 12px;
    line-height: 1.4;
    padding: 3px 0 3px 16px;
  }

  .tt-prompt-gen__tip::before {
    top: 9px;
    width: 6px;
    height: 6px;
  }

  .tt-prompt-gen__cta {
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
    font-size: 13px;
    padding: 9px 14px;
  }
}

@media (max-width: 478px) {
  .tt-score-panel {
    padding: 14px;
  }

  .tt-score-panel__placeholder {
    font-size: 12px;
  }

  .tt-score-panel__composite {
    margin-bottom: 12px;
  }

  .tt-composite-score {
    width: 96px;
  }

  .tt-composite-score__ring {
    width: 96px;
    height: 96px;
  }

  .tt-composite-score__value {
    font-size: 24px;
  }

  .tt-composite-score__label {
    font-size: 10px;
  }

  .tt-score-panel__breakdown {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .tt-sub-score__label {
    font-size: 11px;
  }

  .tt-sub-score__value {
    font-size: 12px;
  }

  .tt-suggestions__title {
    font-size: 12px;
  }

  .tt-suggestions__item {
    font-size: 11px;
  }

  .tt-comparison {
    padding: 12px;
  }

  .tt-comparison__verdict {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .tt-comparison__panel {
    padding: 10px;
  }

  .tt-prompt-gen__header {
    flex-direction: column;
    align-items: stretch;
  }

  .tt-prompt-gen__btn {
    width: 100%;
    justify-content: center;
  }

  .tt-prompt-gen__prompt-box {
    padding: 10px;
  }

  .tt-prompt-gen__prompt-text {
    font-size: 12px;
  }

  .tt-prompt-gen__cta {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* ============================================================
   WORKSPACE LAYOUT -- Setup + Preview Split
   ============================================================ */

.tt-stepper {
  display: none;
}

.tt-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.tt-setup-pane,
.tt-preview-pane {
  min-width: 0;
}

.tt-pane-card {
  background: var(--yt-bg-elevated);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 18px;
}

.tt-pane-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--yt-text-primary);
  margin-bottom: 4px;
}

.tt-pane-card__subtitle {
  font-size: 13px;
  color: var(--yt-text-secondary);
  margin-bottom: 14px;
}

.tt-setup-section__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--yt-text-secondary);
  margin: 12px 0 4px;
}

.tt-setup-section__hint {
  font-size: 12px;
  color: var(--yt-text-disabled);
  margin-bottom: 10px;
  line-height: 1.4;
}

.tt-setup-actions-hint {
  font-size: 12px;
  color: var(--yt-text-secondary);
  margin-top: 2px;
}

.tt-preview-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tt-preview-main .tt-pane-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.tt-preview-main .tt-pane-card__title,
.tt-preview-main .tt-pane-card__subtitle {
  display: none;
}

.tt-preview-controls {
  position: sticky;
  top: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 10px;
  margin-bottom: 6px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.tt-preview-controls .tt-view-switcher {
  flex: 1;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.tt-preview-controls .tt-view-chip {
  border: 1px solid var(--yt-border);
}

.tt-preview-controls .tt-view-chip--active {
  border-color: transparent;
}

.tt-preview-controls .tt-standout-toggle {
  flex-shrink: 0;
}

.tt-preview-controls .tt-mobile-toggle {
  flex-shrink: 0;
}

.tt-preview-main .tt-mockup-container {
  border: 1px solid var(--yt-border);
  border-radius: 0;
}

.tt-setup-pane .tt-status-message {
  margin: 8px 0 0;
}

@media (min-width: 992px) {
  .tt-setup-pane {
    position: sticky;
    top: 20px;
  }
}

/* ============================================================
   MOBILE WORKFLOW -- Setup / Preview / Improve
   ============================================================ */

@media (max-width: 991px) {
  .tt-stepper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    border: 1px solid var(--yt-border);
    border-radius: 10px;
    background: var(--yt-bg-secondary);
  }

  .tt-stepper__btn {
    min-height: 38px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--yt-text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  .tt-stepper__btn--active {
    background: var(--yt-chip-bg-active);
    color: var(--yt-chip-text-active);
  }

  .tt-workspace {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tt-pane-card {
    padding: 14px;
  }

  .tt-pane-card__subtitle {
    margin-bottom: 10px;
  }

  .tt-setup-section__title {
    margin-top: 8px;
  }

  .tt-preview-controls {
    position: static;
    padding: 0;
    margin-bottom: 10px;
    border: none;
    background: transparent;
    backdrop-filter: none;
    display: block;
  }

  .tt-preview-controls .tt-view-switcher {
    margin-bottom: 8px;
  }

  .tt-shell.tt-shell--step-setup .tt-preview-pane {
    display: none;
  }

  .tt-shell.tt-shell--step-preview .tt-setup-pane {
    display: none;
  }

}

/* ============================================================
   LAYOUT REFRESH -- Setup / Preview / Analysis
   ============================================================ */

.tt-shell {
  --score-strong: #1e8e3e;
  --score-decent: #1a73e8;
  --score-moderate: #f9ab00;
  --score-weak: #d93025;
  --analysis-glow: rgba(217, 48, 37, 0.2);
}

.tt-shell[data-theme="dark"] {
  --analysis-glow: rgba(255, 82, 82, 0.24);
}

/* --- Pre-Upload Progressive Disclosure ---
   Before any thumbnail is uploaded, hide the preview pane, analysis pane,
   YouTube chrome, and view controls. The workspace collapses to a single
   centered column so the setup pane is prominent. */

.tt-shell--pre-upload .tt-preview-pane,
.tt-shell--pre-upload .tt-analysis-pane {
  display: none;
}

.tt-shell--pre-upload .tt-workspace {
  grid-template-columns: 1fr;
  justify-content: center;
  align-items: start;
}

.tt-shell--pre-upload .tt-pane-card {
  padding: 24px;
}

.tt-shell--pre-upload .tt-upload__zone,
.tt-shell--pre-upload #thumb-empty-state {
  padding: 100px 64px;
}

.tt-shell--pre-upload .tt-upload__icon {
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
}

.tt-shell--pre-upload .tt-upload__text {
  font-size: 20px;
}

.tt-shell--pre-upload .tt-upload__hint {
  font-size: 15px;
  margin-top: 8px;
}

/* Hide the mobile stepper, advanced settings, title, and theme toggle before upload */
.tt-shell--pre-upload .tt-stepper,
.tt-shell--pre-upload .tt-header,
.tt-shell--pre-upload #toggle-advanced-settings,
.tt-shell--pre-upload #advanced-settings-group,
.tt-shell--pre-upload .tt-input-group--primary,
.tt-shell--pre-upload .tt-analyze-action {
  display: none;
}

.tt-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(340px, 420px);
  gap: 24px;
  align-items: start;
}

@media (min-width: 992px) {
  .tt-shell {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 24px clamp(8px, 1vw, 16px);
  }

  .tt-shell.tt-shell--pre-upload {
    width: calc(100vw - 32px);
    max-width: 1440px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding-left: 8px;
    padding-right: 8px;
  }
}

.tt-setup-pane,
.tt-preview-pane,
.tt-analysis-pane {
  min-width: 0;
}

.tt-preview-pane {
  display: flex;
  flex-direction: column;
}

.tt-analysis-pane .tt-pane-card {
  background: var(--yt-bg-elevated);
}

.tt-preview-main .tt-mockup-container {
  overflow: hidden;
  border-radius: 12px;
}

.tt-setup-pane .tt-status-message {
  margin-top: 10px;
}

@media (min-width: 992px) {
  .tt-setup-pane,
  .tt-analysis-pane {
    position: sticky;
    top: 20px;
  }

  .tt-setup-pane {
    padding-left: 12px;
  }

  .tt-analysis-pane {
    padding-right: 12px;
  }
}

/* Thumbnail library as compact horizontal strip on desktop, larger cards on mobile */
.tt-thumb-library {
  padding: 10px;
}

.tt-thumb-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 10px;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.tt-thumb-item {
  flex: 0 0 120px;
}

.tt-thumb-item__select {
  min-height: 46px;
}

.tt-thumb-item__remove {
  width: 22px;
  height: 22px;
}

.tt-thumb-add-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* YouTube desktop feed should read as homepage (3-4 columns in this canvas) */
.tt-preview-pane .yt-home-shell {
  grid-template-columns: 1fr;
}

.tt-preview-pane .yt-nav-rail {
  display: none;
}

.tt-preview-pane .yt-home {
  padding: 14px;
}

.tt-preview-pane .yt-home__grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px 14px;
}

/* Analysis panel sections */
.tt-score-panel {
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 12px;
}

.tt-score-panel--empty {
  border: 1px dashed var(--yt-border);
  border-radius: 12px;
  background: var(--yt-bg-primary);
  padding: 22px 18px;
  text-align: center;
}

.tt-score-panel__placeholder {
  font-size: 13px;
  color: var(--yt-text-secondary);
}

/* Score panel empty state -- descriptive preview */
.tt-score-empty {
  text-align: center;
  padding: 8px 0;
}

.tt-score-empty__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--yt-text-secondary);
  margin-bottom: 12px;
}

.tt-score-empty__header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--yt-text-primary);
}

.tt-score-empty__desc {
  font-size: 13px;
  color: var(--yt-text-secondary);
  margin-bottom: 10px;
}

.tt-score-empty__list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  text-align: left;
}

.tt-score-empty__list li {
  font-size: 13px;
  color: var(--yt-text-secondary);
  padding: 4px 0;
  line-height: 1.4;
}

.tt-score-empty__list li strong {
  color: var(--yt-text-primary);
}

.tt-score-empty__cta {
  font-size: 12px;
  color: var(--yt-red);
}

.analysis-section {
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  background: var(--yt-bg-primary);
  padding: 14px;
}

.analysis-section__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--yt-text-primary);
  margin-bottom: 12px;
}

.analysis-overall {
  text-align: center;
}

.analysis-ring-wrap {
  position: relative;
  width: 124px;
  margin: 0 auto 10px;
}

.analysis-ring-glow {
  position: absolute;
  inset: 12px;
  background: radial-gradient(circle, var(--analysis-glow) 0%, transparent 75%);
  filter: blur(4px);
}

.analysis-ring {
  position: relative;
  width: 124px;
  height: 124px;
}

.analysis-ring__svg {
  width: 124px;
  height: 124px;
}

.analysis-ring__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--yt-text-primary);
}

.analysis-ring__value span {
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
  color: var(--yt-text-secondary);
}

.analysis-overall__summary {
  font-size: 12px;
  color: var(--yt-text-secondary);
  line-height: 1.4;
}

.analysis-breakdown {
  display: grid;
  gap: 10px;
}

.analysis-breakdown__row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.analysis-breakdown__label {
  font-size: 12px;
  color: var(--yt-text-secondary);
}

.analysis-breakdown__track {
  height: 8px;
  border-radius: 999px;
  background: var(--yt-bg-secondary);
  overflow: hidden;
}

.analysis-breakdown__fill {
  height: 100%;
  border-radius: 999px;
}

.analysis-breakdown__value {
  font-family: "Roboto Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

.analysis-suggestions {
  display: grid;
  gap: 10px;
}

.analysis-suggestions__item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  background: var(--yt-bg-secondary);
}

.analysis-suggestions__icon {
  width: 18px;
  min-width: 18px;
  font-size: 13px;
  line-height: 1;
  margin-top: 2px;
  text-align: center;
}

.analysis-suggestions__icon--positive {
  color: var(--score-strong);
}

.analysis-suggestions__icon--critical {
  color: var(--score-weak);
}

.analysis-suggestions__icon--warning {
  color: var(--score-moderate);
}

.analysis-suggestions__headline {
  font-size: 12px;
  font-weight: 700;
  color: var(--yt-text-primary);
  margin-bottom: 2px;
}

.analysis-suggestions__body {
  font-size: 12px;
  line-height: 1.4;
  color: var(--yt-text-secondary);
}

.analysis-tools {
  display: grid;
  gap: 10px;
}

.analysis-tool {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--yt-border);
  border-radius: 10px;
  background: var(--yt-bg-elevated);
  color: var(--yt-text-primary);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.analysis-tool:hover:not(:disabled) {
  border-color: var(--yt-text-secondary);
  background: var(--yt-bg-secondary);
  transform: translateY(-1px);
}

.analysis-tool:disabled {
  opacity: 0.7;
  cursor: wait;
}

.analysis-tool__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  margin-top: 1px;
}

.analysis-tool__icon--prompt {
  background: linear-gradient(135deg, #f96f3c, #d93025);
}

.analysis-tool__icon--titles {
  background: linear-gradient(135deg, #1a73e8, #6a3df0);
}

.analysis-tool__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.analysis-tool__label {
  font-size: 13px;
  font-weight: 700;
}

.analysis-tool__desc {
  font-size: 12px;
  color: var(--yt-text-secondary);
  line-height: 1.35;
}

.analysis-tool-result {
  border: 1px solid var(--yt-border);
  border-radius: 10px;
  background: var(--yt-bg-secondary);
  padding: 10px;
}

.analysis-tool-result__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--yt-text-primary);
  margin-bottom: 8px;
}

.analysis-tool-result__text {
  font-size: 12px;
  color: var(--yt-text-secondary);
  line-height: 1.45;
  white-space: pre-wrap;
}

.analysis-tool-result__list {
  display: grid;
  gap: 8px;
  list-style: none;
}

.analysis-tool-result__list-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.analysis-tool-result__list-item > span {
  min-width: 0;
  font-size: 12px;
  color: var(--yt-text-secondary);
  line-height: 1.4;
}

.analysis-tool-result__copy {
  flex-shrink: 0;
  min-height: 32px;
  border: 1px solid var(--yt-border);
  border-radius: 8px;
  background: var(--yt-bg-primary);
  color: var(--yt-text-primary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 0 10px;
  cursor: pointer;
}

.analysis-tool-result__copy:hover {
  background: var(--yt-bg-hover);
}

/* --- Prompt result actions row --- */
.analysis-tool-result__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* --- ThumbMagic CTA in prompt result --- */
.analysis-tool-result__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--yt-red);
  color: #ffffff;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.analysis-tool-result__cta:hover {
  background: var(--tool-accent-hover);
}

.analysis-tool-result__loading,
.analysis-tool-result__error {
  font-size: 12px;
  color: var(--yt-text-secondary);
}

.analysis-tool-result__error {
  color: var(--score-weak);
}

/* --- ThumbMagic CTA banner in score panel --- */
.analysis-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--yt-red);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}

.analysis-cta:hover {
  background: var(--tool-accent-hover);
}

.analysis-cta__arrow {
  font-size: 18px;
}

/* --- Daily limit popup (replaces score panel when 429 daily_limit_exceeded) --- */
.tt-score-panel--limit {
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  background: var(--yt-bg-primary);
  padding: 0;
}

.tt-limit-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  gap: 12px;
}

.tt-limit-popup__icon {
  color: var(--score-weak);
  opacity: 0.8;
}

.tt-limit-popup__title {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--yt-text-primary);
  margin: 0;
}

.tt-limit-popup__desc {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--yt-text-secondary);
  max-width: 320px;
  margin: 0;
}

.tt-limit-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 20px;
  background: var(--yt-red);
  color: #fff;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 4px;
}

.tt-limit-popup__cta:hover {
  background: var(--tool-accent-hover);
}

.tt-limit-popup__reset {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 11px;
  color: var(--yt-text-disabled);
  margin: 0;
}

/* Touch target baseline */
.tt-stepper__btn,
.tt-btn,
.tt-view-chip,
.tt-standout-toggle,
.tt-mobile-toggle__btn,
.tt-section-toggle {
  min-height: 44px;
}

/* Mobile flow: one section at a time + sticky bottom step tabs */
@media (max-width: 991px) {
  .tt-shell {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  /* Remove bottom stepper padding before upload since stepper is hidden */
  .tt-shell.tt-shell--pre-upload {
    padding-bottom: 24px;
  }

  /* Pre-upload: full-width single column on mobile */
  .tt-shell--pre-upload .tt-workspace {
    grid-template-columns: 1fr;
  }

  .tt-shell--pre-upload {
    width: 100%;
    left: auto;
    transform: none;
  }

  .tt-shell--pre-upload .tt-upload__zone,
  .tt-shell--pre-upload #thumb-empty-state {
    padding: 120px 24px;
  }

  .tt-workspace {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tt-stepper {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--yt-border);
    border-radius: 12px;
    background: var(--yt-bg-elevated);
    backdrop-filter: blur(10px);
  }

  .tt-stepper__btn {
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--yt-text-secondary);
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
  }

  .tt-stepper__btn--active {
    background: var(--yt-chip-bg-active);
    color: var(--yt-chip-text-active);
  }

  .tt-thumb-list {
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 4px;
  }

  .tt-thumb-item {
    flex-basis: 144px;
  }

  .tt-thumb-item__select {
    min-height: 78px;
  }

  .tt-preview-controls {
    position: static;
    margin-bottom: 10px;
  }

  .tt-preview-controls .tt-view-switcher {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tt-preview-controls .tt-view-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .tt-preview-pane .yt-search {
    padding: 12px;
  }

  .tt-preview-pane .yt-search__result {
    flex-direction: column;
    gap: 10px;
  }

  .tt-preview-pane .yt-search__thumb-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .tt-preview-pane .yt-home-shell {
    grid-template-columns: 1fr;
  }

  .tt-preview-pane .yt-nav-rail {
    display: none;
  }

  .tt-preview-pane .yt-home {
    padding: 0;
  }

  .tt-preview-pane .yt-home__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .tt-preview-pane .yt-sidebar {
    max-width: 100%;
  }

  .tt-preview-pane .yt-watch {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .tt-shell.tt-shell--step-setup .tt-preview-pane,
  .tt-shell.tt-shell--step-setup .tt-analysis-pane {
    display: none;
  }

  .tt-shell.tt-shell--step-preview .tt-setup-pane,
  .tt-shell.tt-shell--step-preview .tt-analysis-pane {
    display: none;
  }

  .tt-shell.tt-shell--step-score .tt-setup-pane,
  .tt-shell.tt-shell--step-score .tt-preview-pane {
    display: none;
  }
}

/* ============================================================
   SEO CONTENT -- Below-tool landing sections
   ============================================================ */

.tt-seo {
  margin-top: 26px;
  margin-left: auto;
  margin-right: auto;
  max-width: 1120px;
  border-top: 1px solid var(--yt-border);
  padding-top: 26px;
  display: grid;
  gap: 18px;
}

.tt-seo__hero {
  background: linear-gradient(135deg, var(--yt-bg-secondary), var(--yt-bg-primary));
  border: 1px solid var(--yt-border);
  border-radius: 14px;
  padding: 18px;
}

.tt-seo__eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--yt-red);
  margin-bottom: 8px;
}

.tt-seo__title {
  font-size: 28px;
  line-height: 1.15;
  color: var(--yt-text-primary);
  margin-bottom: 10px;
}

.tt-seo__lead {
  font-size: 14px;
  line-height: 1.55;
  color: var(--yt-text-secondary);
  max-width: 950px;
}

.tt-seo__section {
  border: 1px solid var(--yt-border);
  border-radius: 14px;
  background: var(--yt-bg-primary);
  padding: 16px;
}

.tt-seo__section-title {
  font-size: 20px;
  line-height: 1.2;
  color: var(--yt-text-primary);
  margin-bottom: 12px;
}

.tt-seo__section-lead {
  font-size: 14px;
  color: var(--yt-text-secondary);
  margin-bottom: 10px;
}

/* --- SEO details accordion --- */
.tt-seo__details {
  border: 1px solid var(--yt-border);
  border-radius: 14px;
  background: var(--yt-bg-primary);
  overflow: hidden;
}

.tt-seo__details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--yt-text-primary);
  cursor: pointer;
  list-style: none;
}

.tt-seo__details-toggle::-webkit-details-marker {
  display: none;
}

.tt-seo__details-toggle::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--yt-text-secondary);
  transition: transform 0.2s ease;
}

.tt-seo__details[open] .tt-seo__details-toggle::after {
  content: '-';
}

.tt-seo__details > .tt-seo__section {
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--yt-border);
}

.tt-seo__details > .tt-seo__section:last-child {
  border-bottom: none;
}

.tt-seo__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tt-seo-card {
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  background: var(--yt-bg-secondary);
  padding: 12px;
}

.tt-seo-card__title {
  font-size: 15px;
  color: var(--yt-text-primary);
  margin-bottom: 6px;
}

.tt-seo-card__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--yt-text-secondary);
}

.tt-seo-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tt-seo-feature {
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  background: var(--yt-bg-secondary);
  padding: 12px;
}

.tt-seo-feature__title {
  font-size: 14px;
  color: var(--yt-text-primary);
  margin-bottom: 6px;
}

.tt-seo-feature__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--yt-text-secondary);
}

.tt-seo-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tt-seo-steps__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 12px;
  background: var(--yt-bg-secondary);
}

.tt-seo-steps__index {
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--yt-chip-bg-active);
  color: var(--yt-chip-text-active);
  font-size: 12px;
  font-weight: 700;
}

.tt-seo-steps__title {
  font-size: 14px;
  color: var(--yt-text-primary);
  margin-bottom: 4px;
}

.tt-seo-steps__text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--yt-text-secondary);
}

.tt-seo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tt-seo-tag {
  min-height: 34px;
  border: 1px solid var(--yt-border);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--yt-bg-secondary);
  color: var(--yt-text-primary);
  font-size: 12px;
  font-weight: 500;
}

.tt-seo-faq {
  display: grid;
  gap: 8px;
}

.tt-seo-faq__item {
  border: 1px solid var(--yt-border);
  border-radius: 10px;
  background: var(--yt-bg-secondary);
  padding: 0 12px;
}

.tt-seo-faq__item summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--yt-text-primary);
  font-size: 14px;
  font-weight: 600;
}

.tt-seo-faq__item p {
  padding: 0 0 12px;
  color: var(--yt-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.tt-seo-cta {
  border: 1px solid var(--yt-border);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.07), rgba(26, 115, 232, 0.05));
}

.tt-seo-cta__title {
  font-size: 20px;
  line-height: 1.2;
  color: var(--yt-text-primary);
  margin-bottom: 8px;
}

.tt-seo-cta__text {
  font-size: 14px;
  color: var(--yt-text-secondary);
  margin-bottom: 12px;
}

.tt-seo-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1024px) {
  .tt-seo__grid {
    grid-template-columns: 1fr;
  }

  .tt-seo-features {
    grid-template-columns: 1fr;
  }

  .tt-seo-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .tt-seo {
    margin-top: 10px;
    padding-top: 14px;
  }

  .tt-seo__title {
    font-size: 22px;
  }

  .tt-seo__section-title {
    font-size: 18px;
  }
}
