:root {
  --bg-page: #0b0d13;
  --bg-card: #131722;
  --bg-card-hover: #171c2a;
  --bg-subtle: #0f131c;
  --bg-inset: #080a0f;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.25);
  --green: #10b981;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ============================================================
   Header & Navigation (Fluid, High-End Modern Studio Layout)
   ============================================================ */
.header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 19, 0.95);
  backdrop-filter: blur(16px);
  padding: 0.7rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: #1d9bf0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(29, 155, 240, 0.35);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-nav-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Polished Dark Select Dropdown (Appearance Reset for Windows/Chrome) */
.lang-selector-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #141722 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  height: 34px;
  padding: 0 28px 0 10px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-select:hover {
  background-color: #1a202c;
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.lang-select option {
  background: #141722;
  color: #f1f5f9;
  padding: 6px;
}

.header-nav-links a {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.header-nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   Main Hero Section
   ============================================================ */
.main {
  padding: 3rem 0 3.5rem;
  flex: 1;
}

.title-area {
  text-align: center;
  margin-bottom: 2rem;
}

.title-area h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.65rem;
}

.title-area p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ============================================================
   Platform Selection Tabs (Directly above input box)
   ============================================================ */
.platform-tabs-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.15rem;
  width: 100%;
}

.platform-tabs {
  display: inline-flex;
  background: rgba(18, 22, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 100%;
  box-sizing: border-box;
}

.p-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: #94a3b8;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  line-height: 1.2;
  background: transparent;
}

.p-tab svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.p-tab:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.p-tab:hover:not(.active) svg {
  opacity: 1;
  transform: scale(1.08);
}

.p-tab.active {
  background: #1d9bf0;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(29, 155, 240, 0.4);
}
.p-tab.active svg {
  opacity: 1;
}

@media (max-width: 680px) {
  .platform-tabs-wrapper {
    margin-bottom: 1rem;
  }
  .platform-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 5px;
    border-radius: 12px;
    width: 100%;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .p-tab {
    padding: 7px 2px;
    font-size: 0.7rem;
    gap: 3px;
    background: rgba(255, 255, 255, 0.03);
  }
  .p-tab svg {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 360px) {
  .p-tab {
    font-size: 0.66rem;
    padding: 6px 1px;
  }
}

/* ============================================================
   Downloader Input Box
   ============================================================ */
/* Turnstile widget renders at fixed 300px; clip the 2-3px overhang
   so it can never trigger horizontal overflow on narrow screens */
#turnstile-slot {
  overflow: hidden;
  max-width: 100%;
}

.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.input-card-mode-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.mode-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-subtle);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-mode-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  height: 28px;
  padding: 0 0.65rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: var(--border-hover);
}

.btn-mode-toggle.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

textarea.url-input.batch-textarea {
  height: auto;
  min-height: 96px;
  padding: 0.85rem 4.8rem 0.85rem 1.15rem;
  resize: vertical;
  line-height: 1.5;
  font-family: inherit;
}

/* ============================================================
   Batch Results Stream (Multiple Cards)
   ============================================================ */
.batch-summary-header {
  margin: 1.5rem 0 1rem;
  padding: 0.9rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.batch-summary-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.batch-cards-stream {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.batch-card-single {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.batch-fail-card {
  background: rgba(239, 68, 68, 0.06);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.82rem;
  color: #f87171;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.input-form {
  display: flex;
  gap: 0.65rem;
}

.input-box-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.url-input {
  width: 100%;
  height: 50px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 4.8rem 0 1.15rem;
  font-size: 16px; /* Lock 16px to prevent iOS Safari auto-zoom */
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.url-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.url-input::placeholder {
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.btn-paste {
  position: absolute;
  right: 8px;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-submit {
  height: 50px;
  padding: 0 1.8rem;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quick-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
}

.quick-hints span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ============================================================
   Loading Status Box
   ============================================================ */
.status-box {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: none;
  text-align: center;
}

.loading-bar {
  height: 3px;
  width: 100%;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.8rem;
}

.loading-line {
  height: 100%;
  width: 40%;
  background: var(--primary);
  border-radius: 999px;
  animation: moveBar 1.2s infinite ease-in-out;
}

@keyframes moveBar {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); width: 60%; }
  100% { transform: translateX(250%); }
}

/* ============================================================
   Result Card
   ============================================================ */
.result-box {
  margin-top: 1.75rem;
  scroll-margin-top: 74px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.tweet-info {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.85rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.015);
  position: relative;
}

.tweet-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-tweet-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.btn-tweet-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Bulk ZIP Download Bar */
.zip-download-bar {
  margin: 0.85rem 1.25rem 0.25rem;
  padding: 0.85rem 1rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.zip-bar-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.zip-bar-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.zip-bar-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.btn-zip-download {
  height: 36px;
  padding: 0 1.1rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-zip-download:hover:not(:disabled) {
  background: #1d4ed8;
}

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

.tweet-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-inset);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.tweet-meta {
  overflow: hidden;
}

.tweet-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.tweet-handle {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.tweet-content {
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--text-main);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
  word-break: break-word;
}

/* Format Selector Tabs (Pill style) */
.format-selector {
  display: flex;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin: 1.1rem 1.25rem 0.5rem;
}

.format-tab {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.format-tab:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.format-tab.active {
  color: #fff;
  background: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Downloads List */
.downloads-list {
  padding: 0.8rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  gap: 0.8rem;
  transition: all 0.15s ease;
}

.download-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.item-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.item-title {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 0.72rem;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-weight: 600;
}

.tag-hd {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
}

.item-desc {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.btn-action {
  height: 38px;
  padding: 0 1.2rem;
  background: var(--primary);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-action:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-action:active {
  transform: translateY(0);
}

.btn-action.audio-btn {
  background: #059669;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-action.audio-btn:hover {
  background: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* ============================================================
   Video Trimmer, GIF & Frame Studio (Phase 2 Suite)
   ============================================================ */
.tool-panel {
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-panel-header h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-panel-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.preview-video-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.preview-video {
  width: 100%;
  max-height: 250px;
  background: #000;
  display: block;
  object-fit: contain;
}

.trim-timeline-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trim-markers-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.trim-time-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

.trim-duration-indicator {
  font-size: 0.75rem;
  color: var(--border-focus);
  font-weight: 600;
}

.range-slider-pair {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.trim-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.trim-slider-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-subtle);
  width: 38px;
  flex-shrink: 0;
}

.timeline-controller {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.timeline-label {
  color: var(--text-muted);
}

.timeline-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
}

.range-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-inset);
  border-radius: 999px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.range-slider.slider-end::-webkit-slider-thumb {
  background: #10b981;
}

.tool-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.btn-tool {
  flex: 1;
  min-width: 130px;
  height: 38px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-trim {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-trim:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-preview-loop {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-preview-loop:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn-gif {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.25);
}

.btn-gif:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
}

.btn-frame {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-frame:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.gif-result-box {
  margin-top: 0.5rem;
  padding: 1.1rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  display: none;
}

.gif-preview-img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   History Drawer (Browser LocalStorage Suite)
   ============================================================ */
.btn-history-trigger {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  padding: 0 0.85rem;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-history-trigger:hover {
  background-color: #1a202c;
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: #0e111a;
  border-left: 1px solid var(--border);
  z-index: 100;
  display: none;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
}

.history-drawer.open {
  display: flex !important;
}

.drawer-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
}

.drawer-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.drawer-actions-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-clear-history {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.btn-clear-history:hover {
  color: #f87171;
}

.btn-close-drawer {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-close-drawer:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-history {
  margin: auto;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-subtle);
}

.empty-history-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem;
  color: var(--text-subtle);
  opacity: 0.5;
}

.empty-history p {
  font-size: 0.85rem;
  line-height: 1.5;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  transition: border-color 0.15s;
  position: relative;
}

.history-item:hover {
  border-color: var(--border-hover);
}

.history-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.history-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.history-author {
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.history-text {
  font-size: 0.82rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.history-time {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.btn-history-reopen {
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-history-reopen:hover {
  background: var(--primary-hover);
}

.btn-history-del {
  padding: 0.25rem 0.45rem;
  font-size: 0.72rem;
  background: transparent;
  color: var(--text-subtle);
  border: none;
  cursor: pointer;
}

.btn-history-del:hover {
  color: #f87171;
}

/* ============================================================
   Simple How-To Guide
   ============================================================ */
.simple-guide {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
}

.simple-guide h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-main);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.step-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.15s;
}

.step-item:hover {
  border-color: var(--border-hover);
}

.step-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.step-item h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #fff;
}

.step-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Footer: Enterprise-Grade Clean Layout (Houses all SEO links)
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  background: #080a0f;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.footer-desc {
  font-size: 0.82rem;
  color: var(--text-subtle);
  line-height: 1.55;
  max-width: 260px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ============================================================
   Modal (Countdown Waiting)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.1rem;
}

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

.modal-box h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: #fff;
}

.modal-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================
   Next-Step Guidance Suite (High-Conversion Post-Download Modal)
   ============================================================ */
.modal-box.success-mode {
  max-width: 440px;
  padding: 1.6rem 1.4rem;
  text-align: left;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.95); opacity: 0.8; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header-success {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.modal-check-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10b981;
  flex-shrink: 0;
}

.modal-header-success h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.modal-desc-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1.15rem;
}

.modal-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.modal-action-btn {
  width: 100%;
  padding: 0.7rem 0.95rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.modal-action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: #fff;
}

.modal-action-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-action-btn .arrow {
  color: var(--text-subtle);
  font-size: 0.9rem;
  transition: transform 0.15s ease;
}

.modal-action-btn:hover .arrow {
  color: #fff;
  transform: translateX(3px);
}

.modal-action-btn.featured {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(59, 130, 246, 0.35);
}

.modal-action-btn.featured:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
}

.modal-action-btn.vpn-link {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.modal-action-btn.vpn-link:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
}

.modal-btn-close {
  width: 100%;
  padding: 0.55rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-subtle);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.modal-btn-close:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================================
   Mobile Queries (< 640px)
   ============================================================ */
@media (max-width: 640px) {
  .container {
    padding: 0 0.9rem;
  }

  .header-container {
    padding: 0 0.9rem;
  }

  /* Keep mobile header razor-sharp: logo on left, language & history on right */
  .header-nav-links {
    gap: 0.4rem;
  }

  .header-nav-links a {
    display: none; /* Secondary links stay in footer */
  }

  .lang-select {
    height: 32px;
    font-size: 0.74rem;
    padding: 0 24px 0 7px;
  }

  .btn-history-trigger {
    height: 32px;
    font-size: 0.74rem;
    padding: 0 0.6rem;
  }

  /* platform-tabs/p-tab mobile layout is fully handled by the
     680px grid rules above — do not re-introduce legacy row styles */

  .history-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
    max-height: 82vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    display: none;
  }

  .history-drawer.open {
    display: flex !important;
  }

  .main {
    padding: 2rem 0 2.5rem;
  }

  .title-area h1 {
    font-size: 1.6rem;
  }

  .input-card {
    padding: 1rem;
  }

  .input-form {
    flex-direction: column;
    gap: 0.6rem;
  }

  .url-input {
    height: 48px;
    padding: 0 4.2rem 0 0.95rem;
  }

  .btn-submit {
    height: 48px;
    width: 100%;
  }

  .quick-hints {
    gap: 0.85rem;
    font-size: 0.78rem;
  }

  .format-selector {
    margin: 1rem 0.85rem 0.5rem;
    gap: 2px;
    padding: 3px;
  }

  .format-tab {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

  .downloads-list {
    padding: 0.65rem 0.85rem 1rem;
  }

  .download-item {
    padding: 0.75rem 0.9rem;
  }

  .tool-actions {
    flex-direction: column;
  }

  .btn-tool {
    width: 100%;
  }

  .steps-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .step-item {
    padding: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .footer-col:first-child {
    grid-column: span 2;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }
}

/* ============================================================
   PWA Native Install Banner & iOS Add to Home Screen Sheet
   ============================================================ */
.pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: rgba(19, 23, 34, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.2);
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-banner.show {
  transform: translateX(-50%) translateY(0);
}

.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #1d9bf0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(29, 155, 240, 0.4);
}

.pwa-banner-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.pwa-banner-content {
  flex: 1;
  min-width: 0;
}

.pwa-banner-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pwa-banner-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-pwa-install {
  background: #1d9bf0;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-pwa-install:hover {
  background: #1a8cd8;
  transform: translateY(-1px);
}

.btn-pwa-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.btn-pwa-dismiss:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* iOS Safari Instruction Modal */
.ios-pwa-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 24, 35, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px 20px 0 0;
  padding: 20px 24px calc(24px + env(safe-area-inset-bottom));
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.7);
}

.ios-pwa-sheet.show {
  transform: translateY(0);
}

.ios-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ios-sheet-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ios-sheet-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.ios-sheet-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ios-sheet-step svg {
  flex-shrink: 0;
  color: #1d9bf0;
}

.ios-sheet-close {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* ============================================================
   Theater Mode (Ambient Fullscreen Video Cinema)
   ============================================================ */
.theater-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 6, 11, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.theater-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.theater-topbar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.theater-post-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.theater-badge {
  background: #1d9bf0;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.theater-author {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.theater-title-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.theater-controls-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.theater-speed-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.theater-select {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.theater-select option {
  background: #131722;
  color: #fff;
}

.theater-btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theater-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

.theater-btn-close {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.theater-btn-close:hover {
  background: #ef4444;
  color: #fff;
}

.theater-viewport {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  padding: 1rem 0;
}

.theater-ambient-glow {
  position: absolute;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(29, 155, 240, 0.15) 0%, rgba(139, 92, 246, 0.08) 50%, transparent 80%);
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
  transition: all 0.5s ease;
}

.theater-video-wrapper {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.theater-video {
  max-width: 100%;
  max-height: calc(80vh - 120px);
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: #000;
  outline: none;
}

.theater-bottombar {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.theater-bottom-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-theater-dl {
  background: #1d9bf0;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-theater-dl:hover {
  background: #1a8cd8;
  transform: translateY(-1px);
}

.btn-theater-dl-audio {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-theater-dl-audio:hover {
  background: #10b981;
  color: #fff;
}

.theater-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   Social Share Card Generator Modal
   ============================================================ */
.card-export-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.card-export-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.card-export-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-export-dialog {
  position: relative;
  z-index: 1;
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(29, 155, 240, 0.2);
  overflow-y: auto;
}

.card-export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-export-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-card-modal {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-card-modal:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.card-theme-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.theme-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-right: 0.2rem;
  font-weight: 500;
}

.theme-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.theme-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.theme-chip.active {
  background: #1d9bf0;
  border-color: #1d9bf0;
  color: #fff;
  box-shadow: 0 2px 8px rgba(29, 155, 240, 0.35);
}

.card-canvas-container {
  width: 100%;
  background: #080a10;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-sizing: border-box;
}

#share-card-canvas {
  width: 100% !important;
  max-width: 580px;
  height: auto !important;
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-export-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.btn-card-action {
  flex: 1;
  background: #1d9bf0;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-action:hover {
  background: #1a8cd8;
  transform: translateY(-1px);
}

.btn-card-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-card-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Header Trigger Buttons */
.btn-theater-trigger {
  background: rgba(29, 155, 240, 0.12);
  border-color: rgba(29, 155, 240, 0.3);
  color: #60a5fa;
}
.btn-theater-trigger:hover {
  background: #1d9bf0;
  color: #fff;
}

.btn-card-trigger {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: #a78bfa;
}
.btn-card-trigger:hover {
  background: #8b5cf6;
  color: #fff;
}

@media (max-width: 640px) {
  .theater-topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .theater-title-text {
    display: none;
  }
  .theater-video {
    max-height: 60vh;
  }
  .card-export-dialog {
    padding: 1rem;
  }
  .card-export-actions {
    flex-direction: column;
  }
}

/* Competitor comparison table (alternative pages) */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.88rem;
}
.compare-table th,
.compare-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.compare-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare-table td:first-child { color: var(--text-muted); }
.compare-table .yes { color: #22c55e; font-weight: 600; }
.compare-table .no { color: #ef4444; }

/* FAQ section (alternative pages) */
.faq-section { margin-top: 2.2rem; }
.faq-section h2 { font-size: 1.25rem; margin-bottom: 0.8rem; }
.faq-item { border-bottom: 1px solid rgba(255, 255, 255, 0.07); padding: 0.85rem 0; }
.faq-item h3 { font-size: 0.95rem; margin: 0 0 0.35rem; color: #fff; }
.faq-item p { font-size: 0.87rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* Related tools chips (matrix pages internal linking) */
.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.related-chip {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--bg-card, #141722);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  transition: all 0.15s ease;
}
.related-chip:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
