/* --- デザインシステム & 変数定義 --- */
:root {
  --bg-main: #070a13;
  --panel-bg: rgba(13, 20, 38, 0.5);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-border-focus: rgba(168, 85, 247, 0.4);
  
  --color-primary: #a855f7;    /* パープル */
  --color-secondary: #3b82f6;  /* ブルー */
  --color-accent: #6366f1;     /* インディゴ */
  
  --color-success: #10b981;    /* グリーン */
  --color-warning: #f59e0b;    /* イエロー */
  --color-danger: #ef4444;     /* レッド */
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --grad-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --grad-glow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* --- 初期化 & ベース設定 --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* --- 背景装飾：光るオーブ & アニメーション --- */
.glass-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  mix-blend-mode: screen;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--color-primary);
  top: -10%;
  left: -10%;
  animation: float-slow 20s infinite ease-in-out alternate;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--color-secondary);
  bottom: -15%;
  right: -10%;
  animation: float-slow 25s infinite ease-in-out alternate-reverse;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* --- スクリーンリーダー専用 (アクセシビリティ) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- アプリケーションコンテナ --- */
.app-container {
  width: 100%;
  max-width: 1100px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* --- ヘッダー --- */
.app-header {
  text-align: center;
  margin-bottom: 10px;
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
}

.app-header h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.app-header h1 span {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* --- メインコンテンツ & グリッドレイアウト --- */
.app-main {
  width: 100%;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

@media (max-width: 868px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

/* --- 共通カードコンポーネント (Glassmorphism) --- */
.card {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* --- パネルのヘッダー --- */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.section-icon {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
}

/* --- 左パネル：ドラッグ＆ドロップゾーン --- */
.panel-input {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 380px;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(168, 85, 247, 0.04);
  box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.1);
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  z-index: -1;
}

.dropzone-content * {
  pointer-events: none;
}

.upload-icon-wrapper {
  background: rgba(255, 255, 255, 0.03);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.dropzone:hover .upload-icon-wrapper, .dropzone.dragover .upload-icon-wrapper {
  transform: translateY(-5px);
  background: rgba(168, 85, 247, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
}

.dropzone:hover .upload-icon, .dropzone.dragover .upload-icon {
  color: var(--text-primary);
}

.dropzone-text-primary {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.dropzone-text-secondary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.dropzone-text-secondary span {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: underline;
}

.dropzone-text-info {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- 左パネル：選択ファイル詳細プレビュー --- */
.file-preview-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: scale-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scale-up {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.file-icon-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(59, 82, 246, 0.15) 100%);
  border: 1px solid rgba(168, 85, 247, 0.2);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-type-icon {
  width: 24px;
  height: 24px;
  color: #c084fc;
}

.file-meta {
  flex-grow: 1;
  min-width: 0; /* 省略三点リーダーを正しく効かせるため */
}

.file-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-type-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-remove {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--color-danger);
  color: #fca5a5;
  transform: rotate(90deg);
}

.btn-remove svg {
  width: 16px;
  height: 16px;
}

.preview-body {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.metric-row:last-child {
  margin-bottom: 0;
}

.sub-metric {
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-value {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
}

/* --- 右パネル：変換設定 --- */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.target-size-control {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.target-size-control:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.input-number {
  flex-grow: 1;
  background: transparent;
  border: none;
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  outline: none;
  width: 60%;
}

.input-number:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* スピナーを隠す */
.input-number::-webkit-outer-spin-button,
.input-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.unit-select {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 16px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.unit-select:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.unit-select option {
  background: #0d1222;
  color: var(--text-primary);
}

/* クイック選択プリセット */
.presets-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.presets-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 4px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset:not(:disabled):hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: var(--color-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

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

.btn-preset.active {
  background: var(--grad-primary);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* --- 動的インフォボックス (警告 / 状態表示) --- */
.info-box {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  transition: all 0.3s ease;
  animation: scale-up 0.25s ease-out;
}

.info-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-box-neutral {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.info-box-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

.info-box-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.info-box-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

/* --- ボタン共通 --- */
.btn-primary {
  width: 100%;
  background: var(--grad-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
}

.btn-primary:not(:disabled):active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.btn-primary:not(:disabled):hover .btn-arrow {
  transform: translateX(4px);
}

/* --- プログレスバーエリア --- */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  animation: scale-up 0.25s ease-out;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.progress-status {
  font-weight: 500;
}

.progress-percent {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary);
}

.progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 9999px;
  transition: width 0.1s ease;
}

/* --- 成功時ダウンロードエリア --- */
.success-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  animation: scale-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-success);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
}

.success-badge svg {
  width: 18px;
  height: 18px;
}

.result-details {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.result-row span {
  color: var(--text-secondary);
}

.result-row strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.text-glow-green {
  color: var(--color-success);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.success-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

.btn-success svg {
  width: 20px;
  height: 20px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 12px;
  padding: 14px 20px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* --- 解説セクション --- */
.explanatory-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sub-section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.explain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .explain-grid {
    grid-template-columns: 1fr;
  }
}

.explain-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.3s ease;
}

.explain-item:hover {
  border-color: rgba(168, 85, 247, 0.15);
  background: rgba(168, 85, 247, 0.01);
}

.explain-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.explain-item p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- フッター --- */
.app-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* --- 広告スペース（Ad Space）スタイル --- */
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* スクエア広告 (300x250) */
.ad-square {
  width: 300px;
  height: 250px;
  margin-top: 10px;
}

/* リーダーボード広告 (728x90) */
.ad-leaderboard {
  max-width: 728px;
  min-height: 90px;
  padding: 12px !important; /* cardのpaddingを上書きして広告サイズに最適化 */
  margin: 10px auto 20px auto;
}

/* プレースホルダー全体のGlassmorphism */
.ad-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  transition: all 0.3s ease;
  cursor: default;
}

.ad-placeholder:hover {
  background: rgba(168, 85, 247, 0.03);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.05);
}

/* SPONSOREDバッジ */
.ad-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: rgba(168, 85, 247, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.15);
  pointer-events: none;
}

/* プレースホルダーのテキストおよびアイコン */
.ad-placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.ad-icon {
  width: 28px;
  height: 28px;
  color: rgba(168, 85, 247, 0.3);
  transition: all 0.3s ease;
}

.ad-placeholder:hover .ad-icon {
  color: var(--color-primary);
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
}

.ad-size-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ad-guide-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .ad-leaderboard {
    min-height: 120px;
    padding: 10px !important;
  }
  
  .ad-leaderboard .ad-placeholder-content {
    padding: 20px 10px;
  }

  .ad-size-label {
    font-size: 0.8rem;
  }
  
  .ad-guide-label {
    font-size: 0.7rem;
  }
}

/* --- 複数ファイルリスト（一括処理用）スタイル --- */
.file-list-scroll, .result-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 10px;
  width: 100%;
}

/* 美しいスクロールバーのカスタマイズ */
.file-list-scroll::-webkit-scrollbar, .result-list-scroll::-webkit-scrollbar {
  width: 6px;
}

.file-list-scroll::-webkit-scrollbar-track, .result-list-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 9999px;
}

.file-list-scroll::-webkit-scrollbar-thumb, .result-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.2);
  border-radius: 9999px;
}

.file-list-scroll::-webkit-scrollbar-thumb:hover, .result-list-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.4);
}

/* アップロード時の各ファイル行 */
.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  transition: all 0.25s ease;
  animation: scale-up 0.2s ease-out forwards;
}

.file-item:hover {
  border-color: rgba(168, 85, 247, 0.15);
  background: rgba(168, 85, 247, 0.01);
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-grow: 1;
}

.file-item-icon {
  color: #c084fc;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.file-item-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-item-name {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-heading);
}

.btn-file-item-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-file-item-remove:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.1);
}

.btn-file-item-remove svg {
  width: 14px;
  height: 14px;
}

/* 変換結果の各ファイル行 */
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  transition: all 0.25s ease;
  animation: scale-up 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-item:hover {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.01);
}

.result-item-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  flex-grow: 1;
  padding-right: 10px;
}

.result-item-name {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-item-sizes {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.result-item-sizes span {
  font-family: var(--font-heading);
}

.result-item-sizes strong {
  font-family: var(--font-heading);
  color: var(--color-success);
}

.btn-download-single {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
}

.btn-download-single:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

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

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

/* --- ユーティリティ --- */
.hidden {
  display: none !important;
}

/* --- プライバシーポリシーモーダルスタイル (Glassmorphism) --- */
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-footer-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.btn-footer-link:hover {
  color: var(--color-primary);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fade-in 0.25s ease-out;
}

.modal-card {
  background: rgba(13, 20, 38, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0 4px;
}

.btn-modal-close:hover {
  color: var(--color-danger);
  transform: scale(1.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 美しいスクロールバー */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.2);
  border-radius: 9999px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.4);
}

.modal-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-section p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 500px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

