@import url("https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Zen+Kaku+Gothic+New:wght@400;500;700;900&display=swap");

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

:root {
  --bg-top: #f4fbff;
  --bg-bottom: #fff8f0;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-hover: #eef5ff;
  --border: #d6e2ec;
  --border-strong: #c2d3e0;
  --text: #1f2d3c;
  --text-muted: #617488;
  --accent: #2f8f83;
  --accent-hover: #24786e;
  --accent-soft: rgba(47, 143, 131, 0.16);
  --warm: #ff8f60;
  --warm-soft: rgba(255, 143, 96, 0.18);
  --success: #239267;
  --warning: #c77f1c;
  --danger: #c95050;
  --shadow: 0 14px 40px rgba(45, 90, 122, 0.12);
  --shadow-strong: 0 28px 54px rgba(33, 63, 89, 0.16);
  --radius: 16px;
}

body {
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  background:
    radial-gradient(650px 320px at -5% -10%, rgba(74, 161, 206, 0.13), transparent 70%),
    radial-gradient(600px 300px at 105% 5%, rgba(255, 176, 127, 0.16), transparent 72%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.3rem 2.6rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.8rem;
  animation: fade-up 420ms ease;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(88, 126, 152, 0.16);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 26px rgba(54, 91, 118, 0.08);
  color: #5b7486;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.brand-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1.6rem 1rem;
  border: 1px solid rgba(194, 211, 224, 0.75);
  border-radius: 28px;
  background:
    radial-gradient(260px 120px at 0% 0%, rgba(84, 166, 196, 0.16), transparent 72%),
    radial-gradient(240px 140px at 100% 100%, rgba(255, 146, 102, 0.14), transparent 72%),
    rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(12px);
}

.brand-logo {
  width: 260px;
  height: auto;
  display: block;
}

.subtitle {
  color: #50677b;
  margin-top: 0.4rem;
  font-size: 0.98rem;
  font-weight: 700;
}

.hero-caption {
  margin-top: 0.18rem;
  color: #6e8598;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.loading-screen {
  text-align: center;
  padding: 4.2rem 0 3.6rem;
  color: var(--text-muted);
  animation: fade-up 350ms ease;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(47, 143, 131, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

#app > * + * {
  margin-top: 1rem;
}

.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: calc(var(--radius) + 2px);
  padding: 2.85rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
  background:
    radial-gradient(500px 220px at 10% 0%, rgba(108, 190, 217, 0.1), transparent 72%),
    radial-gradient(500px 240px at 92% 98%, rgba(255, 160, 120, 0.12), transparent 72%),
    var(--surface);
  box-shadow: var(--shadow);
  animation: fade-up 420ms ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  transform: translateY(-1px);
  border-color: #80b4c5;
  background:
    radial-gradient(500px 220px at 10% 0%, rgba(108, 190, 217, 0.16), transparent 72%),
    radial-gradient(500px 240px at 92% 98%, rgba(255, 160, 120, 0.2), transparent 72%),
    var(--surface);
  box-shadow: 0 18px 46px rgba(45, 90, 122, 0.16);
}

.drop-zone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.upload-icon {
  width: 52px;
  height: 52px;
  color: #4a8093;
  margin-bottom: 0.75rem;
}

.drop-zone p:first-of-type {
  font-weight: 700;
  color: #2d4b60;
}

.drop-zone-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.38rem 0 0.72rem;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 148px;
  padding: 0.66rem 1.35rem;
  background: linear-gradient(140deg, var(--accent), #47a69b);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(47, 143, 131, 0.26);
}

.file-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.queue-section,
.settings,
.progress-section,
.downloads-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.08rem;
  box-shadow: var(--shadow);
  animation: fade-up 420ms ease;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.queue-header h2,
.settings h2,
.progress-section h2,
.downloads-section h2 {
  font-size: 1.07rem;
  color: #37546a;
  font-weight: 800;
}

.downloads-section {
  border-color: #cfe1d9;
  background:
    radial-gradient(460px 160px at 0% 0%, rgba(47, 143, 131, 0.08), transparent 75%),
    radial-gradient(420px 160px at 100% 100%, rgba(255, 143, 96, 0.08), transparent 75%),
    var(--surface);
}

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

.downloads-summary {
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: #4f7082;
  font-weight: 700;
}

.downloads-message {
  margin-top: 0.7rem;
  font-size: 0.84rem;
  color: #607687;
}

.downloads-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.downloads-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d5e6de;
  background: rgba(255, 255, 255, 0.78);
}

.download-item-main {
  min-width: 0;
}

.download-item-name {
  display: block;
  width: 100%;
  font-weight: 700;
  font-family: inherit;
  font-size: inherit;
  color: #244d4b;
  background: transparent;
  border: none;
  border-bottom: 1.5px dashed transparent;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  transition: border-color 0.15s;
}
.download-item-name:hover,
.download-item-name:focus {
  border-bottom-color: var(--accent);
  outline: none;
  white-space: normal;
  overflow: visible;
}

.download-item-meta {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  color: #628177;
}

.queue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.queue-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 0.72rem;
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 0.62rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.queue-item:hover {
  border-color: #b8cddd;
}

.queue-item.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.queue-fmt-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 5px;
  padding: 0.05em 0.42em;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.queue-item.is-selected .queue-fmt-badge {
  background: var(--accent);
  color: #fff;
}

.thumb {
  width: 120px;
  height: 68px;
  border-radius: 10px;
  object-fit: cover;
  background: #edf3f8;
  border: 1px solid var(--border);
}

.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  color: #5f7385;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-main {
  min-width: 0;
}

.queue-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.queue-name {
  font-weight: 700;
  color: #2f4a5f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(232, 241, 249, 0.95);
  border: 1px solid rgba(173, 194, 210, 0.45);
  font-size: 0.75rem;
  color: #5f7a90;
  flex-shrink: 0;
  font-weight: 700;
}

.queue-meta {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.queue-message {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #5d7388;
}

.queue-progress {
  height: 6px;
  border-radius: 999px;
  background: #eaf1f8;
  border: 1px solid #d9e5ef;
  margin-top: 0.45rem;
  overflow: hidden;
}

.queue-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #66b4ab);
  transition: width 0.24s linear;
}

.queue-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-done {
  border-left: 4px solid rgba(35, 146, 103, 0.4);
}

.status-failed {
  border-left: 4px solid rgba(201, 80, 80, 0.4);
}

.status-canceled {
  border-left: 4px solid rgba(199, 127, 28, 0.4);
}

.status-done .queue-state,
.status-done .queue-message {
  color: var(--success);
}

.status-failed .queue-state,
.status-failed .queue-message {
  color: var(--danger);
}

.status-canceled .queue-state,
.status-canceled .queue-message {
  color: var(--warning);
}

.queue-empty {
  padding: 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: #667b8f;
  text-align: center;
  background: linear-gradient(180deg, #fbfdff, #f6fbff);
}

.settings h2 {
  margin-bottom: 0.9rem;
}

.format-picker-group {
  margin-bottom: 0.9rem;
}

.format-picker-header {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  margin-bottom: 0.7rem;
}

.format-picker-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.advanced-toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
}

.advanced-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.advanced-toggle {
  min-width: 0;
  padding: 0.48rem 0.78rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #345269;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.16s ease;
}

.advanced-toggle:hover {
  transform: translateY(-1px);
  background: #fff;
}

.advanced-toggle.is-active {
  border-color: rgba(47, 143, 131, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.advanced-toggle:focus-visible {
  outline: 2px solid #4a93a6;
  outline-offset: 2px;
}

.format-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.format-card-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.format-card-group-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: #6b8193;
}

.format-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0.48rem;
}

.format-card {
  min-height: 86px;
  padding: 0.72rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    radial-gradient(220px 120px at 0% 0%, rgba(87, 168, 198, 0.08), transparent 75%),
    linear-gradient(180deg, #ffffff, #f7fbff);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.format-card:hover {
  transform: translateY(-1px);
  border-color: #a8c0d1;
  box-shadow: 0 12px 26px rgba(45, 90, 122, 0.1);
}

.format-card:focus-visible {
  outline: 2px solid #4a93a6;
  outline-offset: 2px;
}

.format-card.is-selected {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(47, 143, 131, 0.15), 0 14px 28px rgba(47, 143, 131, 0.14);
  background:
    radial-gradient(220px 120px at 0% 0%, rgba(87, 168, 198, 0.15), transparent 75%),
    linear-gradient(180deg, #f4fdfb, #e6f7f4);
}

.format-card.is-selected .format-card-title {
  color: var(--accent);
}

.format-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #29475c;
  line-height: 1.1;
}

.format-card-ext {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: rgba(47, 143, 131, 0.08);
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
}

.format-card-description {
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.advanced-settings {
  margin-bottom: 0.9rem;
  padding: 0.82rem 0.88rem;
  border: 1px solid #d8e4ec;
  border-radius: 12px;
  background:
    radial-gradient(280px 120px at 0% 0%, rgba(47, 143, 131, 0.06), transparent 75%),
    radial-gradient(260px 120px at 100% 100%, rgba(255, 143, 96, 0.08), transparent 75%),
    #fbfdff;
}

.advanced-settings .setting-group:last-child {
  margin-bottom: 0;
}

.setting-group {
  margin-bottom: 0.72rem;
}

.setting-label,
.setting-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  font-size: 0.83rem;
  color: #5f7386;
  margin-bottom: 0.28rem;
  font-weight: 700;
}

.setting-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  background-color: #4b8191;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.icon-format {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5a2 2 0 0 1 2-2h6v18H5a2 2 0 0 1-2-2V5Zm10-2h6a2 2 0 0 1 2 2v6h-8V3Zm0 10h8v6a2 2 0 0 1-2 2h-6v-8Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5a2 2 0 0 1 2-2h6v18H5a2 2 0 0 1-2-2V5Zm10-2h6a2 2 0 0 1 2 2v6h-8V3Zm0 10h8v6a2 2 0 0 1-2 2h-6v-8Z'/%3E%3C/svg%3E");
}

.icon-preset {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 2.3 4.7 5.2.8-3.8 3.7.9 5.2-4.6-2.4-4.6 2.4.9-5.2L4.5 7.5l5.2-.8L12 2Zm-7 15h14v2H5v-2Zm2 3h10v2H7v-2Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 2.3 4.7 5.2.8-3.8 3.7.9 5.2-4.6-2.4-4.6 2.4.9-5.2L4.5 7.5l5.2-.8L12 2Zm-7 15h14v2H5v-2Zm2 3h10v2H7v-2Z'/%3E%3C/svg%3E");
}

.icon-parallel {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6Zm11-2h-2v16h2V4Zm3 0a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-3a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h3Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6Zm11-2h-2v16h2V4Zm3 0a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-3a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h3Z'/%3E%3C/svg%3E");
}

.icon-trim {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 4a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm12 0v2h-3.2l-2.9 4 2.9 4H18v2h-4.2l-3-4.1L8.2 16H12v2H6a2 2 0 0 1-2-2v-3.2l3.8-2.8L4 7.2V4a2 2 0 0 1 2-2h6v2H8.2l2.6 3.6L13.8 4H18Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 4a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm12 0v2h-3.2l-2.9 4 2.9 4H18v2h-4.2l-3-4.1L8.2 16H12v2H6a2 2 0 0 1-2-2v-3.2l3.8-2.8L4 7.2V4a2 2 0 0 1 2-2h6v2H8.2l2.6 3.6L13.8 4H18Z'/%3E%3C/svg%3E");
}

.icon-video {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1h2V4h2v2h1v3h-1v2h1v3h-1v2h1v2h-2v-2h-2v1a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5Zm2 1v12h8V6H6Zm12 2h1v1h-1V8Zm0 5h1v1h-1v-1Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1h2V4h2v2h1v3h-1v2h1v3h-1v2h1v2h-2v-2h-2v1a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5Zm2 1v12h8V6H6Zm12 2h1v1h-1V8Zm0 5h1v1h-1v-1Z'/%3E%3C/svg%3E");
}

.icon-audio {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 9h4l5-4v14l-5-4H5V9Zm11.5-2.5 1.4 1.4A6 6 0 0 1 20 12a6 6 0 0 1-2.1 4.6l-1.4-1.4A4 4 0 0 0 18 12a4 4 0 0 0-1.5-3.1Zm-2.8 2.8 1.4 1.4A2 2 0 0 1 16 12a2 2 0 0 1-.9 1.7l-1.4-1.4c.2-.1.3-.2.3-.3s-.1-.2-.3-.3Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 9h4l5-4v14l-5-4H5V9Zm11.5-2.5 1.4 1.4A6 6 0 0 1 20 12a6 6 0 0 1-2.1 4.6l-1.4-1.4A4 4 0 0 0 18 12a4 4 0 0 0-1.5-3.1Zm-2.8 2.8 1.4 1.4A2 2 0 0 1 16 12a2 2 0 0 1-.9 1.7l-1.4-1.4c.2-.1.3-.2.3-.3s-.1-.2-.3-.3Z'/%3E%3C/svg%3E");
}

.icon-quality {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 4a9 9 0 0 1 9 9h-2a7 7 0 1 0-14 0H3a9 9 0 0 1 9-9Zm0 4a5 5 0 0 1 5 5h-2a3 3 0 1 0-6 0H7a5 5 0 0 1 5-5Zm1 3 4.8-3.1-3.1 4.8a2 2 0 1 1-1.7-1.7Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 4a9 9 0 0 1 9 9h-2a7 7 0 1 0-14 0H3a9 9 0 0 1 9-9Zm0 4a5 5 0 0 1 5 5h-2a3 3 0 1 0-6 0H7a5 5 0 0 1 5-5Zm1 3 4.8-3.1-3.1 4.8a2 2 0 1 1-1.7-1.7Z'/%3E%3C/svg%3E");
}

.icon-resolution {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM4 14h2v4h4v2H4v-6Zm14 0h2v6h-6v-2h4v-4ZM8 8h8v8H8V8Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM4 14h2v4h4v2H4v-6Zm14 0h2v6h-6v-2h4v-4ZM8 8h8v8H8V8Z'/%3E%3C/svg%3E");
}

.setting-group select,
.setting-group input[type="text"] {
  width: 100%;
  padding: 0.58rem 0.78rem;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 0.86rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23617488' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.setting-group input[type="text"] {
  background-image: none;
  cursor: text;
  font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
}

.setting-group select:hover,
.setting-group input[type="text"]:hover {
  background-color: #f3f8fd;
}

.setting-group select:focus,
.setting-group input[type="text"]:focus {
  outline: none;
  border-color: #70a6ba;
  box-shadow: 0 0 0 4px rgba(112, 166, 186, 0.2);
}

.setting-group input[type="text"].is-invalid {
  border-color: #df8f8f;
  background: #fff8f8;
  box-shadow: 0 0 0 4px rgba(201, 80, 80, 0.12);
}

.trim-setting-group {
  padding: 0.78rem 0.82rem;
  border: 1px solid #d7e4ed;
  border-radius: 16px;
  background:
    radial-gradient(300px 150px at 0% 0%, rgba(85, 170, 199, 0.06), transparent 74%),
    radial-gradient(280px 150px at 100% 100%, rgba(255, 150, 108, 0.06), transparent 74%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(249, 252, 255, 0.92));
}

.trim-disclosure {
  min-width: 0;
}

.trim-disclosure-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
}

.trim-disclosure-toggle::-webkit-details-marker {
  display: none;
}

.trim-toggle-copy {
  min-width: 0;
}

.trim-lead {
  margin-top: 0.2rem;
  color: #698196;
  font-size: 0.77rem;
  line-height: 1.45;
}

.trim-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.34rem 0.68rem;
  border: 1px solid rgba(121, 153, 174, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #37546a;
  font-size: 0.72rem;
  font-weight: 800;
}

.trim-toggle-chip.is-active {
  border-color: rgba(47, 143, 131, 0.28);
  background: rgba(47, 143, 131, 0.1);
  color: var(--accent);
}

.trim-toggle-chip::before {
  content: "+";
  font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
}

.trim-disclosure[open] .trim-toggle-chip::before {
  content: "-";
}

.trim-disclosure-body {
  padding-top: 0.72rem;
}

.trim-grid {
  display: none;
}

.setting-group .trim-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  align-items: stretch;
  margin-bottom: 0;
}

.trim-field span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.trim-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.trim-icon-btn {
  display: inline-flex;
  align-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  justify-content: center;
}

.trim-mini-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.trim-mini-icon-back {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.2 12 18 4.2 16.6 2.8 7.4 12l9.2 9.2L18 19.8 10.2 12Zm-4.6 0 5.8-5.8v11.6L5.6 12Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.2 12 18 4.2 16.6 2.8 7.4 12l9.2 9.2L18 19.8 10.2 12Zm-4.6 0 5.8-5.8v11.6L5.6 12Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-forward {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m13.8 12-7.8-7.8 1.4-1.4 9.2 9.2-9.2 9.2-1.4-1.4 7.8-7.8Zm4.6 0-5.8 5.8V6.2l5.8 5.8Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m13.8 12-7.8-7.8 1.4-1.4 9.2 9.2-9.2 9.2-1.4-1.4 7.8-7.8Zm4.6 0-5.8 5.8V6.2l5.8 5.8Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-start {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 4h2v16H5V4Zm3 8 9-6v12l-9-6Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 4h2v16H5V4Zm3 8 9-6v12l-9-6Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-mark-start {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 4h2v16H6V4Zm3 1h8l-2 3 2 3H9V5Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 4h2v16H6V4Zm3 1h8l-2 3 2 3H9V5Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-play {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m8 5 11 7-11 7V5Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m8 5 11 7-11 7V5Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-pause {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 5h4v14H6V5Zm8 0h4v14h-4V5Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 5h4v14H6V5Zm8 0h4v14h-4V5Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-end {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17 4h2v16h-2V4ZM7 6l9 6-9 6V6Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17 4h2v16h-2V4ZM7 6l9 6-9 6V6Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-mark-end {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16 4h2v16h-2V4ZM8 5h8v6H8l2-3-2-3Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16 4h2v16h-2V4ZM8 5h8v6H8l2-3-2-3Z'/%3E%3C/svg%3E");
}

.trim-mini-icon-reset {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3 4v5h5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3 4v5h5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.trim-preview {
  margin-top: 0.7rem;
  padding: 0.72rem 0.75rem;
  border: 1px solid #d6e5ee;
  border-radius: 14px;
  background:
    radial-gradient(240px 120px at 0% 0%, rgba(87, 168, 198, 0.08), transparent 75%),
    radial-gradient(240px 120px at 100% 100%, rgba(47, 143, 131, 0.06), transparent 75%),
    #fdfefe;
}

.trim-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.trim-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 162, 184, 0.2);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(64, 97, 121, 0.05);
}

.trim-summary-label {
  color: #688095;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

#trim-selection-summary {
  color: #1f3f56;
  font-size: 0.92rem;
}

#trim-selection-detail {
  color: #6c8498;
  font-size: 0.75rem;
}

.trim-preview-picker {
  min-width: 180px;
}

.trim-preview-picker label {
  display: block;
  margin-bottom: 0.28rem;
}

.trim-preview-media {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 72px;
  margin-top: 0.65rem;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(220px 140px at 0% 0%, rgba(34, 91, 118, 0.25), transparent 70%),
    linear-gradient(180deg, #07151d, #102431);
  border: 1px solid rgba(40, 78, 98, 0.45);
}

.trim-media,
.trim-audio {
  width: 100%;
}

.trim-media {
  max-height: 260px;
  background: transparent;
}

.trim-timeline,
.trim-selection {
  margin-top: 0.65rem;
  padding: 0.56rem 0.6rem;
  border: 1px solid rgba(126, 162, 182, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.trim-time-row,
.trim-range-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.28rem;
  color: #5c7285;
  font-size: 0.74rem;
  font-weight: 700;
}

.trim-time-row {
  flex-wrap: wrap;
}

#trim-playhead {
  display: none;
}

.trim-time-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.62rem;
  border: 1px solid rgba(121, 153, 174, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #31536b;
  font-size: 0.74rem;
  font-weight: 800;
  font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
  white-space: nowrap;
}

.trim-selection-topline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  margin-bottom: 0.34rem;
}

.trim-selection-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
}

.trim-quick-actions-start {
  justify-content: flex-end;
}

.trim-quick-actions-end {
  justify-content: flex-start;
}

.chip-btn {
  min-height: 32px;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 153, 174, 0.28);
  background: rgba(255, 255, 255, 0.82);
  color: #2f5066;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}

.chip-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(74, 128, 147, 0.34);
  background: #fff;
}

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

.trim-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: rgba(25, 97, 126, 0.42);
  background: linear-gradient(135deg, #1c6f8f, #2a998d);
  color: #f7ffff;
  box-shadow: 0 10px 22px rgba(30, 102, 128, 0.18);
}

.trim-play-btn:hover:not(:disabled) {
  border-color: rgba(18, 83, 108, 0.5);
  background: linear-gradient(135deg, #175d78, #25887e);
}

.trim-play-btn .trim-mini-icon {
  width: 16px;
  height: 16px;
}

.trim-play-btn[data-state="pause"] {
  background: linear-gradient(135deg, #31536b, #496b82);
  border-color: rgba(49, 83, 107, 0.5);
}

.trim-range-values {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.38rem;
  color: #5c7285;
  font-size: 0.74rem;
  font-weight: 700;
}

.trim-range-values strong {
  color: #31536b;
  font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
}

.setting-error {
  margin-top: 0.45rem;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
}

.trim-preview input[type="range"] {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.trim-selection-slider {
  position: relative;
  height: 52px;
  margin-top: 0.1rem;
  border-radius: 14px;
  cursor: pointer;
}

.trim-waveform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.trim-waveform.is-empty {
  opacity: 0;
}

.trim-waveform.is-loading {
  opacity: 0.55;
}

.trim-preview.is-audio-only .trim-preview-media {
  display: none;
}

.trim-preview.is-audio-only .trim-selection-slider {
  height: 96px;
  border-radius: 16px;
  background:
    radial-gradient(300px 160px at 50% 50%, rgba(34, 91, 118, 0.1), transparent 80%),
    linear-gradient(180deg, #f0f8ff, #e6f2f8);
  border: 1px solid rgba(100, 160, 190, 0.2);
}

.trim-preview.is-audio-only .trim-waveform {
  filter: saturate(1.4);
}


.trim-selection-track,
.trim-selection-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 14px;
  border-radius: 999px;
}

.trim-selection-track {
  inset-inline: 0;
  z-index: 1;
  background: rgba(219, 231, 239, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.trim-selection-fill {
  left: 0;
  width: 0;
  z-index: 3;
  border: 1px solid rgba(65, 136, 128, 0.34);
  background: linear-gradient(90deg, rgba(47, 143, 131, 0.34), rgba(102, 180, 171, 0.44));
  box-shadow: 0 10px 18px rgba(47, 143, 131, 0.16);
  pointer-events: auto;
  cursor: grab;
}

.trim-selection-fill.is-dragging {
  cursor: grabbing;
}

.trim-current-marker {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  left: 0;
  border-radius: 999px;
  background: var(--warm);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  z-index: 4;
}

.trim-handle {
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 18px;
  height: 18px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(47, 143, 131, 0.25);
  cursor: grab;
  z-index: 5;
  touch-action: none;
  user-select: none;
}

.trim-handle::before {
  content: "▼";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--accent);
  line-height: 1;
  pointer-events: none;
}

.trim-handle.is-dragging {
  cursor: grabbing;
  box-shadow: 0 4px 16px rgba(47, 143, 131, 0.4);
  z-index: 7;
}

.trim-handle-end {
  border-color: var(--warm);
  z-index: 6;
}

.trim-handle-end::before {
  color: var(--warm);
}

.trim-handle.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

.trim-preview input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.estimate-box {
  margin: 0.98rem 0 1.05rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid #d5e4ee;
  border-radius: 12px;
  background:
    radial-gradient(380px 130px at 0% 0%, rgba(100, 176, 203, 0.08), transparent 75%),
    radial-gradient(380px 120px at 100% 100%, rgba(255, 162, 120, 0.12), transparent 75%),
    #fbfdff;
  color: #557084;
  font-size: 0.83rem;
  line-height: 1.48;
}

.estimate-box.warning {
  border-color: #edcfaa;
  background:
    radial-gradient(380px 130px at 0% 0%, rgba(255, 182, 120, 0.18), transparent 75%),
    radial-gradient(380px 120px at 100% 100%, rgba(255, 141, 96, 0.14), transparent 75%),
    #fff8f0;
}

.action-row {
  display: flex;
  gap: 0.65rem;
}

.convert-btn {
  flex: 1;
  padding: 0.86rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(130deg, var(--accent), #46a79b);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.2s ease, box-shadow 0.22s ease;
  box-shadow: 0 12px 24px rgba(47, 143, 131, 0.24);
}

.convert-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.convert-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.cancel-btn,
.secondary-btn,
.ghost-btn,
.inline-btn {
  padding: 0.72rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: #2c465d;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.cancel-btn {
  width: 130px;
  border-color: #efc3c3;
  color: #b64d4d;
  background: #fff8f8;
}

.cancel-btn:hover:not(:disabled),
.secondary-btn:hover,
.ghost-btn:hover,
.inline-btn:hover {
  background: var(--surface-hover);
  border-color: #bcd0df;
}

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

.secondary-btn {
  margin-top: 0.65rem;
  width: 100%;
}

.download-all-btn,
.download-zip-btn {
  padding: 0.78rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.2s ease, box-shadow 0.22s ease, opacity 0.2s ease;
}

.download-all-btn {
  color: #fff;
  background: linear-gradient(130deg, var(--accent), #46a79b);
  box-shadow: 0 12px 24px rgba(47, 143, 131, 0.2);
}

.download-zip-btn {
  color: #25465d;
  background: linear-gradient(140deg, #eef8f2, #fff3ea);
  border: 1px solid #d7e4de;
}

.download-all-btn:hover:not(:disabled),
.download-zip-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.download-all-btn:disabled,
.download-zip-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn {
  padding: 0.38rem 0.82rem;
  font-size: 0.78rem;
  background: #f8fbff;
}

.inline-btn {
  padding: 0.36rem 0.68rem;
  font-size: 0.75rem;
  text-decoration: none;
}

.inline-btn.danger {
  border-color: #e8c2c2;
  background: #fff9f9;
  color: #b55656;
}

.inline-btn.success {
  border-color: #badfcf;
  background: #f5fdf9;
  color: #1d7f5b;
}

.cancel-btn:focus-visible,
.secondary-btn:focus-visible,
.ghost-btn:focus-visible,
.inline-btn:focus-visible,
.chip-btn:focus-visible,
.trim-disclosure-toggle:focus-visible,
.download-all-btn:focus-visible,
.download-zip-btn:focus-visible,
.convert-btn:focus-visible,
.file-btn:focus-visible {
  outline: 2px solid #4a93a6;
  outline-offset: 2px;
}

.progress-bar {
  height: 9px;
  background: #eef4fb;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #d9e6f0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2f8f83, #66b4ab);
  border-radius: 999px;
  transition: width 0.28s ease;
}

.progress-text {
  color: #506c83;
  font-size: 0.86rem;
  margin-top: 0.48rem;
  font-weight: 700;
}

.progress-current {
  color: #637b90;
  font-size: 0.82rem;
  margin-top: 0.14rem;
}

.log-output {
  margin-top: 1rem;
  padding: 0.78rem 0.92rem;
  background: #eff4f9;
  border: 1px solid #d5e2ee;
  border-radius: 12px;
  font-size: 0.75rem;
  font-family: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
  color: #4f667a;
  max-height: 170px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

footer {
  margin-top: 2.8rem;
  text-align: center;
  color: #647b90;
  font-size: 0.81rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-privacy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  padding: 0.8rem 1.4rem;
  border-radius: 16px;
  background: rgba(47, 143, 131, 0.07);
  border: 1px solid rgba(47, 143, 131, 0.15);
  max-width: 440px;
}

.footer-privacy-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.footer-privacy p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #4a6478;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.36rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 140, 168, 0.22);
  background: rgba(255, 255, 255, 0.7);
  color: #3d5a70;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.footer-link:hover {
  border-color: var(--accent);
  background: rgba(47, 143, 131, 0.07);
  color: var(--accent);
}

.footer-icon {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

.footer-copy {
  margin: 0;
  font-size: 0.75rem;
  color: #8fa5b8;
}

@media (max-width: 680px) {
  .container {
    padding: 1.7rem 1rem 2.2rem;
  }

  .trim-preview-header,
  .trim-disclosure-toggle {
    flex-direction: column;
    align-items: stretch;
  }

  .trim-lead {
    text-align: left;
  }

  .trim-preview-picker {
    min-width: 0;
  }

  #trim-playhead {
    flex-basis: 100%;
  }

  .drop-zone {
    padding: 2.1rem 1rem;
  }

  .queue-item {
    grid-template-columns: 1fr;
  }

  .thumb {
    width: 100%;
    height: 145px;
  }

  .queue-actions {
    justify-content: flex-start;
  }

  .downloads-header,
  .download-item {
    flex-direction: column;
    align-items: stretch;
  }

  .downloads-actions {
    justify-content: flex-start;
  }

  .format-picker-header,
  .advanced-toggle-group {
    flex-direction: column;
  }

  .trim-grid {
    grid-template-columns: 1fr;
  }

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

  .trim-quick-actions-start,
  .trim-quick-actions-end {
    justify-content: center;
  }

  .trim-play-btn {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .brand-lockup {
    padding: 0.9rem 1.1rem;
  }

  .brand-logo {
    width: 200px;
  }

  .trim-quick-actions {
    justify-content: center;
  }

  .action-row {
    flex-direction: column;
  }

  .cancel-btn {
    width: 100%;
  }
}
