/* BoltLoad v2 — 2D Flat Architectural Design System (Clean Light & Dark Themes) */

:root,
html[data-theme="light"] {
  --bg-page: #f8f9fb;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f4f6;
  --bg-hover: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --btn-primary-bg: #111827;
  --btn-primary-fg: #ffffff;
  --btn-primary-hover: #1f2937;

  --btn-sec-bg: #ffffff;
  --btn-sec-fg: #1f2937;
  --btn-sec-hover: #f3f4f6;

  --accent-blue: #2563eb;
  --accent-blue-soft: #eff6ff;
  --accent-blue-border: #bfdbfe;

  --status-green: #059669;
  --status-green-soft: #ecfdf5;
  --status-green-border: #a7f3d0;

  --danger-fg: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --tag-mp4-bg: #f3f4f6;
  --tag-mp4-fg: #111827;
  --tag-audio-bg: #eff6ff;
  --tag-audio-fg: #1d4ed8;

  --skeleton: #e5e7eb;
  --skeleton-hi: #f3f4f6;
  --focus-ring: rgba(37, 99, 235, 0.22);
}

html[data-theme="dark"] {
  --bg-page: #0b0d10;
  --bg-surface: #12151a;
  --bg-subtle: #181c23;
  --bg-hover: #161a21;
  --border: #232832;
  --border-strong: #323946;

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --btn-primary-bg: #f3f4f6;
  --btn-primary-fg: #0b0d10;
  --btn-primary-hover: #e5e7eb;

  --btn-sec-bg: #181c23;
  --btn-sec-fg: #e5e7eb;
  --btn-sec-hover: #222731;

  --accent-blue: #3b82f6;
  --accent-blue-soft: rgba(59, 130, 246, 0.12);
  --accent-blue-border: rgba(59, 130, 246, 0.3);

  --status-green: #10b981;
  --status-green-soft: rgba(16, 185, 129, 0.12);
  --status-green-border: rgba(16, 185, 129, 0.28);

  --danger-fg: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.28);

  --tag-mp4-bg: #1e232c;
  --tag-mp4-fg: #f3f4f6;
  --tag-audio-bg: rgba(59, 130, 246, 0.14);
  --tag-audio-fg: #93c5fd;

  --skeleton: #1e232c;
  --skeleton-hi: #272d38;
  --focus-ring: rgba(59, 130, 246, 0.3);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

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

/* --- Top Header Bar --- */
.topbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

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

.brand-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-green);
  flex-shrink: 0;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--btn-sec-bg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.theme-btn:hover {
  background-color: var(--btn-sec-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.theme-btn svg {
  width: 15px;
  height: 15px;
}

html[data-theme="light"] .icon-sun {
  display: none;
}
html[data-theme="dark"] .icon-moon {
  display: none;
}

/* --- Main Layout --- */
.main-wrap {
  flex: 1;
  padding-top: 36px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Intro & Flat Command Input --- */
.intro-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intro-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 700px;
}

.input-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.input-field-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input-field-wrap:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.url-input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.93rem;
}

.url-input::placeholder {
  color: var(--text-muted);
}

.clear-input-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 6px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.clear-input-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

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

.input-buttons {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Flat Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

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

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

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border: 1px solid var(--btn-primary-bg);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

.btn-secondary {
  background-color: var(--btn-sec-bg);
  color: var(--btn-sec-fg);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--btn-sec-hover);
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* --- Quick Test Samples --- */
.sample-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sample-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.sample-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sample-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.sample-btn:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* --- Error Alert --- */
.alert-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--danger-border);
  background-color: var(--danger-bg);
  color: var(--danger-fg);
  font-size: 0.87rem;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alert-dismiss {
  background: transparent;
  border: 1px solid var(--danger-border);
  color: var(--danger-fg);
  padding: 4px 10px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* --- Flat Panels --- */
.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.panel-topbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-heading-sm {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Media Summary Header --- */
.media-header {
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.media-thumb-box {
  width: 224px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

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

.thumb-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background-color: rgba(11, 13, 16, 0.86);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}

.thumb-preview-btn {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(11, 13, 16, 0.82);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}

.thumb-preview-btn:hover {
  background-color: #0b0d10;
}

.thumb-preview-btn svg {
  width: 13px;
  height: 13px;
}

/* --- Expandable Inline Player --- */
.player-drawer {
  border-bottom: 1px solid var(--border);
  background-color: #000000;
}

.player-drawer-bar {
  padding: 10px 20px;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-drawer-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.embed-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 460px;
}

.embed-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --- Media Info Right Column --- */
.media-info-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-meta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-author {
  font-weight: 600;
  color: var(--text-secondary);
}

.meta-sep {
  color: var(--border-strong);
}

.media-title {
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spec-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
}

.spec-tag.accent {
  border-color: var(--accent-blue-border);
  background-color: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.media-controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.audio-select-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.flat-select {
  appearance: none;
  -webkit-appearance: none;
  height: 32px;
  padding: 0 30px 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  max-width: 100%;
}

.flat-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

/* --- Segmented Mode Toolbar --- */
.stream-toolbar {
  padding: 12px 20px;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.segmented-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background-color: var(--bg-page);
  gap: 2px;
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.seg-tab:hover {
  color: var(--text-primary);
}

.seg-tab.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.seg-count {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
}

.stream-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Structured Format Table --- */
.table-head {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(200px, 1.8fr) 105px 136px;
  gap: 12px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.text-right {
  text-align: right;
}

.format-list {
  display: flex;
  flex-direction: column;
}

.format-row {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.1s ease;
}

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

.format-row:hover {
  background-color: var(--bg-hover);
}

.format-row-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(200px, 1.8fr) 105px 136px;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
}

.col-quality {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ext-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background-color: var(--tag-mp4-bg);
  color: var(--tag-mp4-fg);
  flex-shrink: 0;
}

.ext-badge.m4a,
.ext-badge.mp3,
.ext-badge.webm,
.ext-badge.aac,
.ext-badge.wav {
  background-color: var(--tag-audio-bg);
  color: var(--tag-audio-fg);
  border-color: var(--accent-blue-border);
}

.quality-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.tier-pill {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tier-pill.recommended {
  border-color: var(--status-green-border);
  background-color: var(--status-green-soft);
  color: var(--status-green);
}

.col-specs {
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-size {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}

.col-action {
  display: flex;
  justify-content: flex-end;
}

.dl-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  min-width: 118px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background-color: var(--btn-sec-bg);
  color: var(--btn-sec-fg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

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

.dl-action-btn:hover:not(:disabled),
.dl-action-btn.primary {
  background-color: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

.dl-action-btn.primary:hover:not(:disabled) {
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

.dl-action-btn.active-stream {
  border-color: var(--status-green-border);
  background-color: var(--status-green-soft);
  color: var(--status-green);
}

.row-status-bar {
  padding: 0 20px 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.77rem;
  color: var(--status-green);
}

/* --- Loading Skeletons --- */
.loading-table {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loading-status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-bottom: 4px;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text-primary);
  animation: spin 0.7s linear infinite;
}

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

.sk-bar,
.sk-row {
  border-radius: 5px;
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-hi) 50%, var(--skeleton) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.sk-bar {
  height: 13px;
}
.sk-bar.h-lg {
  height: 20px;
}
.w-35 {
  width: 35%;
}
.w-55 {
  width: 55%;
}
.w-80 {
  width: 80%;
}
.sk-row {
  height: 44px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --- Search Results Grid --- */
.search-grid {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.search-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-surface);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.search-card:hover {
  border-color: var(--text-muted);
  background-color: var(--bg-hover);
}

.search-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-subtle);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

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

.search-card-body {
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Recent History --- */
.text-action-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.text-action-btn:hover {
  color: var(--text-primary);
}

.history-list {
  display: flex;
  flex-direction: column;
}

.history-item {
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-item:last-child {
  border-bottom: none;
}

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

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

.history-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Architecture Strip --- */
.arch-section {
  padding-top: 8px;
}

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

.arch-item {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arch-index {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.arch-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.arch-desc {
  font-size: 0.81rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg-surface);
  margin-top: auto;
}

.footer-inner {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Responsive Design (Tablet & Mobile) --- */
@media (max-width: 820px) {
  .search-grid,
  .arch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-head {
    display: none;
  }

  .format-row-grid {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "quality action"
      "specs   size";
    row-gap: 4px;
    padding: 13px 16px;
  }

  .col-quality {
    grid-area: quality;
  }
  .col-specs {
    grid-area: specs;
    font-size: 0.78rem;
  }
  .col-size {
    grid-area: size;
    font-size: 0.78rem;
  }
  .col-action {
    grid-area: action;
  }

  .row-status-bar {
    padding: 0 16px 11px 16px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }

  .main-wrap {
    padding-top: 22px;
    padding-bottom: 36px;
    gap: 18px;
  }

  .status-pill {
    display: none;
  }

  .page-title {
    font-size: 1.32rem;
  }

  .input-bar {
    flex-direction: column;
  }

  .input-buttons {
    width: 100%;
  }

  .input-buttons .btn-secondary {
    flex: 1;
  }

  .input-buttons .btn-primary {
    flex: 2;
  }

  .media-header {
    flex-direction: column;
    padding: 16px;
    gap: 14px;
  }

  .media-thumb-box {
    width: 100%;
  }

  .stream-toolbar {
    padding: 12px 16px;
  }

  .segmented-tabs {
    width: 100%;
  }

  .seg-tab {
    flex: 1;
    justify-content: center;
  }

  .stream-note {
    display: none;
  }

  .search-grid,
  .arch-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    height: auto;
    padding: 14px;
    text-align: center;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .seg-tab {
    padding: 0 8px;
    font-size: 0.76rem;
    gap: 5px;
  }

  .dl-action-btn {
    min-width: 98px;
    height: 32px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .quality-name {
    font-size: 0.85rem;
    white-space: normal;
  }

  .audio-select-group,
  .flat-select {
    width: 100%;
  }
}

/* ==========================================================================
   BoltLoad Modular Platform Switcher & Instagram 2D Flat Components
   ========================================================================== */

.platform-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 100%;
}

.platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.platform-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.platform-tab:hover {
  color: var(--text-primary);
}

.platform-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.ext-badge.jpg,
.ext-badge.jpeg,
.ext-badge.png,
.ext-badge.gif,
.ext-badge.webp {
  background: var(--status-green-soft);
  color: var(--status-green);
}

.ig-caption-snippet {
  margin-top: 10px;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.ig-preview-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  max-height: 520px;
  overflow: hidden;
}

.ig-inline-video,
.ig-inline-image {
  max-width: 100%;
  max-height: 510px;
  display: block;
  object-fit: contain;
}

.ig-collection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

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

.ig-collection-actions {
  flex-shrink: 0;
}

.ig-slides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  padding: 18px 22px 22px;
}

.ig-slide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ig-slide-card.ig-slide-focused {
  border-color: var(--accent-blue);
}

.ig-slide-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--bg-subtle);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.ig-slide-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ig-slide-num {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(17, 24, 39, 0.84);
  color: #ffffff;
  border-radius: 4px;
}

.ig-slide-kind {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(17, 24, 39, 0.84);
  color: #ffffff;
  border-radius: 4px;
}

.ig-slide-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
}

.ig-slide-specs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.ig-slide-res {
  font-weight: 500;
  color: var(--text-primary);
}

.ig-slide-select {
  width: 100%;
  height: 32px;
  font-size: 0.78rem;
}

.ig-slide-single-tag {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 9px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.ig-slide-dl-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 640px) {
  .platform-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .platform-tab {
    width: 100%;
    justify-content: center;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  .ig-collection-header {
    flex-direction: column;
    padding: 16px;
  }

  .ig-collection-actions,
  .ig-collection-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .ig-slides-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }
}

@media (max-width: 400px) {
  .ig-slides-grid {
    grid-template-columns: 1fr;
  }
}

