/* ReelCraft AI - 100% Mobile Responsive System (Anti-Overflow & Anti-Crop) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-dark: #090B10;
  --bg-card: rgba(18, 22, 33, 0.75);
  --bg-card-hover: rgba(26, 32, 48, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glow: rgba(255, 0, 110, 0.25);
  --border-card: rgba(255, 255, 255, 0.08);
  
  --primary-pink: #FF006E;
  --primary-purple: #833AB4;
  --primary-orange: #FD1D1D;
  --accent-cyan: #06B6D4;
  --accent-green: #10B981;
  --accent-yellow: #F59E0B;
  
  --grad-instagram: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCB045 100%);
  --grad-pink-purple: linear-gradient(135deg, #FF006E 0%, #833AB4 100%);
  --grad-dark-card: linear-gradient(180deg, rgba(25, 30, 45, 0.6) 0%, rgba(14, 17, 26, 0.8) 100%);

  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(255, 0, 110, 0.2);
}

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

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  background-image: 
    radial-gradient(at 0% 0%, rgba(131, 58, 180, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(255, 0, 110, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.app-header {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 11, 16, 0.92);
  width: 100%;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--grad-instagram);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  background: linear-gradient(135deg, #FFF 30%, var(--primary-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.logo-text span {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  margin-top: 2px;
}

.header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-tag i {
  color: var(--primary-pink);
}

/* Main Input Hero Section */
.hero-section {
  padding: 28px 0 20px;
  text-align: center;
  width: 100%;
}

.hero-title {
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.8px;
}

.hero-title span {
  background: var(--grad-instagram);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(12px, 2vw, 14px);
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 20px;
  font-weight: 400;
  line-height: 1.6;
}

/* Input Form Box */
.input-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  max-width: 820px;
  margin: 0 auto 16px;
  backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  width: 100%;
}

.input-card:focus-within {
  border-color: var(--primary-pink);
  box-shadow: 0 0 35px rgba(255, 0, 110, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.input-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 18px;
  pointer-events: none;
  z-index: 2;
}

.reel-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 80px 12px 40px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.reel-input::placeholder {
  color: var(--text-dim);
  font-size: 12px;
}

.btn-paste {
  position: absolute;
  right: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #E5E7EB;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  z-index: 2;
}
.btn-paste:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-analyze {
  background: var(--grad-pink-purple);
  color: #fff;
  border: none;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(255, 0, 110, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 0, 110, 0.6);
  filter: brightness(1.1);
}

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

/* Sample Demos Bar */
.sample-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.sample-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  width: 100%;
}

.sample-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sample-btn:hover {
  background: rgba(255, 0, 110, 0.12);
  border-color: rgba(255, 0, 110, 0.3);
  color: #fff;
}

/* Loading State */
.loading-box {
  display: none;
  padding: 30px 16px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-card);
  margin-bottom: 30px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-pink);
  border-right-color: var(--primary-purple);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* Results Dashboard Grid */
.results-grid {
  display: none;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-bottom: 50px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

/* Video Column */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 16px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.player-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9/16;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video Frame: object-fit contain guarantees zero video cropping and zero text clipping */
.player-wrapper video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Player Controls Bar */
.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  gap: 6px;
  overflow: hidden;
}

.speed-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}
.speed-select option {
  background: var(--bg-dark);
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.btn-download-primary {
  width: 100%;
  max-width: 100%;
  background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  word-break: break-word;
}
.btn-download-primary i {
  flex-shrink: 0;
}
.btn-download-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

/* Profile Info Header */
.author-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  width: 100%;
  overflow: hidden;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-instagram);
  padding: 2px;
  flex-shrink: 0;
}
.author-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.author-meta {
  min-width: 0;
  flex: 1;
}

.author-meta h4 {
  font-size: 12px;
  font-weight: 700;
  word-break: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.author-meta p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Caption & Analysis Column */
.analysis-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 18px;
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.tab-btn.active {
  background: var(--grad-pink-purple);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 0, 110, 0.35);
}

/* Tab Panels */
.tab-panel {
  display: none;
  width: 100%;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Caption Action Topbar */
.caption-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.caption-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-copy-lg {
  background: var(--grad-pink-purple);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-copy-lg:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 0, 110, 0.5);
}
.btn-copy-lg.copied {
  background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Caption Box */
.caption-box {
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #E5E7EB;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin-bottom: 16px;
  width: 100%;
}

/* Hashtags Grid */
.hashtags-section {
  margin-top: 14px;
  width: 100%;
}
.hashtags-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.hashtags-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.btn-copy-tags {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.tag-pill {
  background: rgba(131, 58, 180, 0.15);
  border: 1px solid rgba(131, 58, 180, 0.3);
  color: #C084FC;
  padding: 4px 8px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  word-break: break-all;
}

/* Marketing Insights Grid */
.marketing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.insight-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px;
  width: 100%;
}

.insight-card.hook { border-left: 4px solid var(--primary-pink); }
.insight-card.cta { border-left: 4px solid var(--accent-cyan); }
.insight-card.metrics { border-left: 4px solid var(--accent-yellow); }

.insight-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.insight-card.hook .insight-header { color: var(--primary-pink); }
.insight-card.cta .insight-header { color: var(--accent-cyan); }
.insight-card.metrics .insight-header { color: var(--accent-yellow); }

.insight-body {
  font-size: 12px;
  color: #F3F4F6;
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
}

/* Stats Counter Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
}

.stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
}

.stat-val {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.stat-lbl {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Framework Breakdown */
.framework-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px;
  width: 100%;
}
.framework-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.step-item:last-child {
  margin-bottom: 0;
}
.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-pink-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}
.step-content h5 {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.step-content p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-word;
}

/* History Section */
.history-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-card);
  width: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-clear-history {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #F87171;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  width: 100%;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #000;
  object-fit: cover;
  flex-shrink: 0;
}

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

.history-info h5 {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-info p {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 28px);
}

.toast {
  background: rgba(18, 22, 33, 0.95);
  border: 1px solid var(--accent-green);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(12px);
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.app-footer {
  margin-top: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--border-card);
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (100% Zero-Cutoff Mobile Layout)
   ========================================================================== */

@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .video-card {
    max-width: 100% !important;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .container {
    padding: 0 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .header-badges {
    display: none !important;
  }

  .hero-section {
    padding: 16px 0 12px !important;
  }

  .input-card {
    padding: 6px !important;
    border-radius: var(--radius-lg) !important;
    width: 100% !important;
  }

  .input-form {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .input-wrapper {
    width: 100% !important;
  }

  .reel-input {
    width: 100% !important;
    padding: 12px 75px 12px 36px !important;
    font-size: 12px !important;
  }

  .input-icon {
    left: 10px !important;
    font-size: 16px !important;
  }

  .btn-paste {
    right: 5px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
  }

  .btn-analyze {
    width: 100% !important;
    padding: 12px !important;
    border-radius: var(--radius-md) !important;
    font-size: 13px !important;
    justify-content: center !important;
  }

  .results-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
  }

  .video-card, .analysis-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Player Wrapper on Mobile: Adaptive Height with ZERO Wasted Black Space & NO Cropping */
  .player-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 52vh !important;
    aspect-ratio: unset !important;
    background: #000 !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .player-wrapper video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 52vh !important;
    object-fit: contain !important;
    background: #000 !important;
    display: block !important;
  }

  .player-toolbar {
    padding: 6px 8px !important;
    width: 100% !important;
  }

  .speed-select {
    padding: 3px 6px !important;
    font-size: 11px !important;
  }

  .btn-download-primary {
    font-size: 12px !important;
    padding: 10px 8px !important;
    width: 100% !important;
    justify-content: center !important;
  }

  .caption-topbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .btn-copy-lg {
    width: 100% !important;
    justify-content: center !important;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .toast-container {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    max-width: calc(100vw - 20px) !important;
  }
}

@media (max-width: 480px) {
  .logo-text h1 {
    font-size: 15px !important;
  }

  .logo-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 15px !important;
  }

  .hero-title {
    font-size: 19px !important;
  }

  .caption-box {
    padding: 10px !important;
    font-size: 12px !important;
    max-height: 220px !important;
  }

  .history-grid {
    grid-template-columns: 1fr !important;
  }
}
