@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&family=JetBrains+Mono:wght@600&display=swap");

/* ===== DESIGN DIRECTION: "Industrial Sci-Fi Dark" =====
   Aesthetic: dark terminal + purple neon — cohesive, no decoration spam
   Differentiation: pill-based track selectors, glowing active states,
   glassmorphic panels over a textured dark canvas
   ===================================================== */

:root {
  --bg-color: #0a0a0f;
  --card-bg: #151520;
  --primary: #a855f7;          /* Vibrant purple */
  --primary-hover: #c084fc;
  --primary-dim: rgba(168, 85, 247, 0.12);
  --primary-border: rgba(168, 85, 247, 0.3);
  --text-primary: #e9d5ff;     /* Light purple tint */
  --text-secondary: #94a3b8;
  --border: #312e81;           /* Purple-tinted border */
  --border-subtle: rgba(49, 46, 129, 0.5);
  --accent: #06b6d4;           /* Cyan accent */
  --success: #10b981;
  --danger: #ef4444;
  --control-bg: rgba(10, 10, 15, 0.92);

  /* Plyr theme */
  --plyr-color-main: var(--primary);
  --plyr-video-background: #000;
  --plyr-video-controls-background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.75));
  --plyr-video-control-color: #fff;
  --plyr-video-control-color-hover: #fff;
  --plyr-video-control-background-hover: var(--primary);
  --plyr-font-family: "JetBrains Mono", monospace;
  --plyr-menu-background: rgba(28, 25, 43, 0.98);
  --plyr-menu-color: var(--text-primary);
  --plyr-badge-background: var(--primary);
  --plyr-badge-text-color: #fff;
  --plyr-range-fill-background: var(--primary);
  --plyr-tooltip-background: rgba(28, 25, 43, 0.95);
  --plyr-tooltip-color: var(--text-primary);
  --plyr-captions-background: rgba(0, 0, 0, 0.8);
  --plyr-captions-text-color: #fff;
  --plyr-control-spacing: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: "JetBrains Mono", monospace;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' version='1.1' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:svgjs='http://svgjs.dev/svgjs' width='1920' height='1080' preserveAspectRatio='none' viewBox='0 0 1920 1080'%3e%3cg mask='url(%26quot%3b%23SvgjsMask1007%26quot%3b)' fill='none'%3e%3crect width='1920' height='1080' x='0' y='0' fill='rgba(18%2c 16%2c 27%2c 1)'%3e%3c/rect%3e%3cpath d='M771.06 1266.87C980.44 1249.73 1076.9 853.92 1486.91 826.73 1896.92 799.54 2001.9 470.03 2202.76 459.53' stroke='rgba(161%2c 161%2c 170%2c 1)' stroke-width='2'%3e%3c/path%3e%3cpath d='M778.04 1166.26C927.05 1132.44 836.3 764.9 1213.76 737.62 1591.21 710.34 1851.88 408.51 2085.19 402.82' stroke='rgba(161%2c 161%2c 170%2c 1)' stroke-width='2'%3e%3c/path%3e%3cpath d='M919.23 1134.28C1101.74 1019.59 1012.23 379.07 1330.72 376.6 1649.21 374.13 1920.47 805.64 2153.7 819.4' stroke='rgba(161%2c 161%2c 170%2c 1)' stroke-width='2'%3e%3c/path%3e%3cpath d='M772.76 1265.07C985.41 1068.81 829.95 218.54 1204.43 191.09 1578.91 163.64 1838.21 499.5 2067.76 504.29' stroke='rgba(161%2c 161%2c 170%2c 1)' stroke-width='2'%3e%3c/path%3e%3cpath d='M366.79 1197.8C635.54 1177.95 787.42 669.03 1295.49 650.56 1803.56 632.09 1981.65 372.81 2224.19 369.76' stroke='rgba(161%2c 161%2c 170%2c 1)' stroke-width='2'%3e%3c/path%3e%3c/g%3e%3cdefs%3e%3cmask id='SvgjsMask1007'%3e%3crect width='1920' height='1080' fill='white'%3e%3c/rect%3e%3c/mask%3e%3c/defs%3e%3c/svg%3e");
  background-size: cover;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem;
  overflow-x: hidden;
  max-width: 100vw;
}

.app-container {
  width: 100%;
  max-width: min(900px, calc(100vw - 4rem));
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== HEADER ===== */
header {
  text-align: center;
  margin-bottom: 0.5rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

header p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ===== HOW TO USE ===== */
.how-to-use {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.how-to-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.how-to-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.info-icon {
  width: 22px;
  height: 22px;
  fill: var(--primary);
  flex-shrink: 0;
}

.how-to-header span {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.chevron-icon {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.how-to-header.active .chevron-icon {
  transform: rotate(180deg);
}

.how-to-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.how-to-content.open {
  max-height: 600px;
}

.format-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0 1.25rem 1rem;
}

.format-section {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.format-section.supported  { border-left: 3px solid var(--success); }
.format-section.unsupported { border-left: 3px solid var(--danger); }

.format-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.check-icon { width: 18px; height: 18px; fill: var(--success); }
.cross-icon { width: 18px; height: 18px; fill: var(--danger); }

.format-section strong {
  color: var(--text-primary);
  font-size: 14px;
}

.format-section ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.format-section li {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.format-section li:last-child { margin-bottom: 0; }

.tip-box {
  margin: 0 1.25rem 1rem;
  padding: 0.85rem 1rem;
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.tip-box strong { color: var(--text-primary); }

.tip-box code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
  color: var(--primary);
  word-break: break-all;
}

/* ===== INPUT SECTION ===== */
.input-section {
  display: flex;
  gap: 1rem;
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-sizing: border-box;
}

input[type="text"] {
  flex: 1;
  background: #111318;
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

button:hover  { background: var(--primary-hover); }
button:active { transform: scale(0.98); }

/* ===== PLAYER ===== */
.player-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
  box-sizing: border-box;
}

.player-container .plyr {
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px;
}

.player-container .plyr video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-container .plyr__video-wrapper { height: 100%; }

.status-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 50;
  backdrop-filter: blur(4px);
}

/* Plyr menu dark-theme override */
.plyr__menu__container {
  background: rgba(28, 25, 43, 0.98) !important;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.plyr__menu__container label,
.plyr__menu__container .plyr__menu__value {
  color: var(--text-primary) !important;
}

/* ===== UNIFIED CONTROL PANEL ===== */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

/* ===== STATS BAR (top row of control panel) ===== */
.stats-compact {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.stat-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 13px;
}

.stat-icon {
  width: 16px;
  height: 16px;
  fill: var(--primary);
  flex-shrink: 0;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.stat-value {
  font-weight: 600;
  font-family: monospace;
  color: var(--text-primary);
  white-space: nowrap;
}

.stat-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

/* Download button — inline with stats, right-aligned via margin-left:auto */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--primary-border);
  color: var(--primary);
  padding: 0.4rem 0.9rem;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
  margin-left: auto;  /* Push to right side of stats bar */
  font-family: inherit;
  white-space: nowrap;
}

.download-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.download-btn:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.download-btn:active {
  transform: scale(0.97);
}

/* ===== MEDIA SECTION (Audio / Subtitles) ===== */
.media-section {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;            /* header ↔ pills breathing room */
  animation: sectionFadeIn 0.3s ease;
}

.media-section:last-child {
  border-bottom: none;
}

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

.media-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.media-section-header svg {
  width: 15px;
  height: 15px;
  fill: var(--primary);
  flex-shrink: 0;
  opacity: 0.85;
}

.media-section-header span:first-of-type {
  color: var(--text-secondary);
}

/* Badge showing track count */
.track-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

/* ===== TRACK PILLS ===== */
.track-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.6rem;    /* row-gap col-gap */
  align-items: center;
  min-height: 2rem;        /* prevents layout collapse when loading */
  margin-top: 0.4rem;      /* pulls it away from the section heading */
}

/* Audio-specific: allow pills to fill width evenly on narrow screens */
#audioTrackList {
  row-gap: 0.6rem;
  column-gap: 0.6rem;
}

/* Inline state label used when no interactive pills are available (Chrome/FF) */
.audio-state-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 0.25rem 0;
}

.track-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;            /* space between icon, label text, and badges */
  padding: 0.42rem 0.9rem; /* taller hit area, more horizontal breathing room */
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
  font-family: inherit;
  position: relative;
  white-space: nowrap;     /* prevent pill text from wrapping mid-label */
  flex-shrink: 0;          /* pills never get squished narrower than their content */
  width: auto;             /* CRITICAL: prevents pills from stretching full row width */
  align-self: flex-start;  /* don't stretch to match tallest sibling */
  max-width: 280px;        /* cap long labels — text will truncate gracefully */
}

/* Force Safari/Chrome to properly truncate the text node without breaking flex bounds */
.track-pill > span:not([class]) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-pill:hover {
  background: var(--primary-dim);
  border-color: var(--primary-border);
  color: var(--text-primary);
}

.track-pill.active {
  background: rgba(168, 85, 247, 0.18);
  border-color: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.12), 0 0 12px rgba(168, 85, 247, 0.1);
}

.track-lang-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  background: rgba(168, 85, 247, 0.2);
  color: var(--primary);
  border-radius: 4px;
  line-height: 1.5;
}

/* Codec badge — cyan tint to distinguish from language badge */
.track-codec-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-radius: 4px;
  line-height: 1.5;
}

/* Remove button inside pill */
.pill-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  margin-left: 2px;
}

.pill-remove-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

/* ===== BROWSER AUDIO NOTICE ===== */
.browser-notice {
  display: flex;
  align-items: flex-start;
  margin-top: 0.8rem;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: rgba(6, 182, 212, 0.07);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.browser-notice svg {
  width: 16px;
  height: 16px;
  fill: #22d3ee;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.flag-details {
  cursor: pointer;
  margin-top: 0.2rem;
}

.flag-details summary {
  font-weight: 600;
  color: var(--primary);
  font-size: 11.5px;
  user-select: none;
  transition: color 0.15s;
}

.flag-details summary:hover {
  color: var(--primary-hover);
}

.flag-details ol {
  margin: 0.6rem 0 0;
  padding-left: 1.25rem;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.flag-details code {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: #c4b5fd;
  font-family: monospace;
}

/* ===== SUBTITLE ADD CONTROLS ===== */
.subtitle-add-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.subtitle-url-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.subtitle-url-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.subtitle-url-input::placeholder { color: var(--text-secondary); opacity: 0.6; }

.subtitle-url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.08);
}

/* Subtitle action buttons */
.sub-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  font-family: inherit;
  white-space: nowrap;
}

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

.sub-action-btn:hover {
  background: var(--primary-dim);
  border-color: var(--primary-border);
  color: var(--text-primary);
}

.sub-action-btn.accent {
  background: var(--primary-dim);
  border-color: var(--primary-border);
  color: var(--primary);
}

.sub-action-btn.accent:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--primary);
  color: var(--primary-hover);
}

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

/* Spinning icon for loading state */
.spin-icon {
  animation: spinAnim 0.8s linear infinite;
}

@keyframes spinAnim {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===== DISCLAIMER FOOTER ===== */
.disclaimer {
  padding: 1rem 1.25rem;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 10px;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.disclaimer-icon {
  width: 20px;
  height: 20px;
  fill: var(--danger);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.disclaimer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.disclaimer strong {
  color: var(--danger);
  font-weight: 600;
}

/* ===== TOAST NOTIFICATIONS ===== */
.streamit-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: white;
  z-index: 10002;
  max-width: min(360px, calc(100vw - 3rem));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-family: inherit;
  pointer-events: none;
}

.streamit-toast.toast-success {
  background: linear-gradient(135deg, #059669, #10b981);
}

.streamit-toast.toast-error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.streamit-toast.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 768px) {
  body {
    padding: 1rem;
    overflow-x: hidden;
  }

  .app-container {
    max-width: calc(100vw - 2rem);
    gap: 1.25rem;
  }

  header h1  { font-size: 2rem; }
  header p   { font-size: 0.9rem; }

  .input-section {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Only the main load button goes full-width on mobile */
  #loadButton {
    width: 100%;
    padding: 0.75rem;
  }

  .how-to-header { padding: 0.85rem 1rem; }

  .format-info {
    grid-template-columns: 1fr;
    padding: 0 1rem 1rem;
  }

  .format-section { padding: 0.85rem; }

  .tip-box {
    margin: 0 1rem 1rem;
    padding: 0.75rem 0.85rem;
    font-size: 12px;
  }

  .tip-box code { font-size: 10px; }

  .stats-compact {
    gap: 0.85rem;
    padding: 0.75rem 1rem;
  }

  .media-section { padding: 0.875rem 1rem; }

  .download-btn {
    margin-left: 0; /* On mobile, don't push to right — let it wrap naturally */
  }

  .subtitle-url-row { flex-direction: column; }

  .sub-action-btn.accent {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
    overflow-x: hidden !important;
  }

  .app-container {
    max-width: calc(100vw - 1rem) !important;
    gap: 1rem;
    overflow-x: hidden;
  }

  .app-container > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  header { margin-bottom: 0; }
  header h1 { font-size: 1.75rem; }
  header p  { font-size: 0.85rem; margin-top: 0.25rem; }

  .stats-compact {
    padding: 0.6rem 0.85rem;
    gap: 0.6rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-divider { display: none; }

  .stat-inline { font-size: 12px; gap: 0.4rem; }
  .stat-icon   { width: 14px; height: 14px; }

  .download-btn {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .track-pill { font-size: 11.5px; padding: 0.32rem 0.6rem; }

  input[type="text"] { padding: 0.65rem 0.85rem; font-size: 0.9rem; }
  #loadButton { padding: 0.65rem; font-size: 0.9rem; }

  .streamit-toast {
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  header h1 { font-size: 1.5rem; }
  header p  { font-size: 0.8rem; }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  body { padding: 0.5rem; }

  .app-container { gap: 0.75rem; }

  header { margin-bottom: 0; }
  header h1 { font-size: 1.5rem; }
  header p  { font-size: 0.8rem; margin-top: 0.2rem; }
}
