/* アプリの画面（index.html）の見た目 */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #e9e9f0;
  --text: #12141a;
  --muted: #636779;
  --line: #d9dae3;
  --accent: #007aff;
  --on-accent: #ffffff;
  --discord: #5865f2;
  --on-discord: #ffffff;
  --danger: #c62828;
  --warn-bg: #fff4e0;
  --warn-text: #74480a;
  --warn-line: #f5d49a;
  --trim-over: #f2b300;
  --err-bg: #ffeceb;
  --err-text: #8b1a1a;
  --err-line: #f5c2c0;
  --fit-ok: #1b7f3b;
  --fit-over: #c25e00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #171a22;
    --surface-2: #232838;
    --text: #f2f3f7;
    --muted: #9ba0b4;
    --line: #2e3446;
    --accent: #0a84ff;
    --on-accent: #ffffff;
    --discord: #5865f2;
    --on-discord: #ffffff;
    --danger: #ff6b6b;
    --warn-bg: #3a2c12;
    --warn-text: #ffd79a;
    --warn-line: #5c4419;
    --trim-over: #ffc933;
    --err-bg: #3a1a1a;
    --err-text: #ffb4b4;
    --err-line: #5c2525;
    --fit-ok: #4cc26e;
    --fit-over: #ffa94d;
  }
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom));
}
.app > * + * {
  margin-top: 5px;
}
.hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

header h1 {
  font-size: 16px;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
header.row {
  gap: 6px;
}
header .btn-sm {
  flex: none;
  padding: 4px 8px;
}
/* 狭い画面ではタイトルを少し小さくして、ボタン2つと並べても切れないようにする */
@media (max-width: 380px) {
  header h1 {
    font-size: 15px;
  }
}
@media (max-width: 370px) {
  header h1 {
    font-size: 14px;
  }
}
/* ここまで狭いと1行に入らないので折り返す */
@media (max-width: 340px) {
  header h1 {
    white-space: normal;
    line-height: 1.25;
  }
}

/* 説明書（画面に重ねて開く） */
/* 説明書は上に少し余白を残し、下は画面の下端までいっぱいに使う */
#helpDlg {
  --dlg-top: max(16px, calc(env(safe-area-inset-top) + 8px));
  width: min(520px, calc(100vw - 32px));
  height: calc(100% - var(--dlg-top));
  max-height: calc(100% - var(--dlg-top));
  margin: var(--dlg-top) auto 0;
  padding: 0;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  color: var(--text);
}
#helpDlg::backdrop {
  background: rgba(0, 0, 0, .45);
}
#helpDlg .help-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
#helpDlg h2 {
  font-size: 16px;
  margin: 0;
}
#helpDlg .help-body {
  padding: 4px 14px calc(14px + env(safe-area-inset-bottom));
  font-size: 14px;
  line-height: 1.6;
}
#helpDlg p {
  margin: 4px 0 0;
}

/* 説明書の画像（横にスワイプして見る）。次の画像の端を見せて、横に続いていることが分かるようにする */
.help-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 2px !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: color .4s ease;
}
/* 一度スワイプしたら、矢印を止めて控えめにする */
.help-hint.is-done {
  color: var(--muted);
}
.help-hint.is-done .hint-arrow {
  animation: none;
}
.help-hint .hint-arrow {
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  animation: hintLeft 1s ease-in-out infinite alternate;
}
.help-hint .hint-arrow + span + .hint-arrow {
  animation-name: hintRight;
}
@keyframes hintLeft {
  to {
    transform: translateX(-5px);
  }
}
@keyframes hintRight {
  to {
    transform: translateX(5px);
  }
}
.help-slides {
  display: flex;
  align-items: flex-start;   /* 文字の多いカードに合わせて画像が縦に伸びないようにする */
  gap: 12px;
  margin: 0 -14px;
  padding: 4px 14px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 14px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.help-slides::-webkit-scrollbar {
  display: none;
}
.help-slides > * {
  flex: 0 0 auto;
  width: min(70vw, 32svh, 320px);
  height: auto;
  aspect-ratio: 390 / 780;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
/* 最後のカード（別のページへのリンク）。画像と同じ大きさにそろえる */
.help-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;   /* アイコンの高さをどのカードでもそろえる（上に詰める） */
  gap: 14px;
  padding: 28px 18px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
}
.help-card .card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff5f6d, #7b4dff);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 見出しは言葉のまとまりの間でだけ改行する（端末によって文字の幅が違っても崩れないように） */
.help-card .card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}
.help-card .card-title > span, .help-card .card-text > span {
  display: inline-block;
}
.help-card .card-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.help-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
}
/* よくある質問のカード（答えは長いので左寄せ） */
.help-qa {
  gap: 10px;
}
.help-qa .qa-icon {
  background: linear-gradient(135deg, #34c759, #0a84ff);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
}
/* 更新情報のカードは、質問のカードと見分けられるよう色を変える */
.help-news .qa-icon {
  background: linear-gradient(135deg, #ff9f0a, #ff375f);
}
#helpDlg .help-qa .qa-answer {
  margin: 0;
  width: 100%;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}
#helpDlg .help-qa .qa-answer b {
  white-space: nowrap;   /* 「720pで約1分56秒」などを途中で折り返さない */
}
#helpDlg .help-qa .qa-answer a {
  color: var(--accent);
}
#helpDlg .help-qa .qa-note {
  font-size: 12px;
  color: var(--muted);
}
/* 初めて開いたときに、画像を少し横に揺らしてスワイプできることを知らせる */
.help-slides.is-nudge > * {
  animation: helpNudge 1.1s ease-in-out .6s 2;
}
@keyframes helpNudge {
  0%, 100% {
    transform: translateX(0);
  }
  45% {
    transform: translateX(-40px);
  }
}
.help-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 6px;
}
.help-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: var(--line);
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.help-dots button[aria-current="true"] {
  width: 22px;
  background: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .help-hint .hint-arrow, .help-slides.is-nudge > * {
    animation: none;
  }
}

/* ボタン */
.btn {
  display: block;
  width: 100%;
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.btn:disabled {
  opacity: .45;
  cursor: default;
}
.btn-sm {
  width: auto;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  padding: 11px 12px;
  font-size: 17px;
}
.btn-primary.is-cancel {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-discord {
  background: var(--discord);
  color: var(--on-discord);
  border-color: transparent;
  line-height: 1.25;
  padding: 7px 12px;
}
.btn-discord span {
  display: block;
}
/* iOS: 共有シートに「ビデオを保存」があるので保存ボタンは出さず、共有ボタンを横いっぱいにする */
.app.is-ios #saveBtn {
  display: none;
}
.app.is-ios #shareBtn {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
}
.app.is-ios #shareBtn svg {
  flex: none;
}

/* 二択のセグメント切り替え（上段: 解像度、下段: 圧縮方法）。
   1つの枠の中に2つの選択肢を並べ、選ばれた側に色の付いたつまみを置く（切り替えるとつまみが滑る） */
.segs {
  display: grid;
  gap: 8px;
}
.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}
.seg-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg-opt {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  padding: 5px 6px;
  border-radius: 9px;
  color: var(--text);
  transition: color .25s ease;
}
.seg-thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 9px;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .25s ease;
}
.seg-input:nth-of-type(2):checked ~ .seg-thumb {
  transform: translateX(100%);
}
/* 3つ目の選択肢（元の解像度）は、出すときだけ3列にする */
.seg:not(.is-three) .seg-opt-source {
  display: none;
}
.seg.is-three {
  grid-template-columns: 1fr 1fr 1fr;
}
.seg.is-three .seg-thumb {
  width: calc(33.333% - 2px);
}
.seg-input:nth-of-type(3):checked ~ .seg-thumb {
  transform: translateX(200%);
}
/* 4つの選択肢（3ステップの画面の解像度：480p・720p・1080p・元の解像度。元の解像度はいつも出す） */
.seg.is-four {
  grid-template-columns: repeat(4, 1fr);
}
.seg.is-four .seg-thumb {
  width: calc(25% - 1.5px);
}
.seg.is-four .seg-opt-source {
  display: flex;
}
.seg.is-four .seg-opt {
  padding-left: 2px;
  padding-right: 2px;
  font-size: 15px;
  white-space: nowrap;
}
.seg-input:nth-of-type(4):checked ~ .seg-thumb {
  transform: translateX(300%);
}
.seg-input:checked + .seg-opt {
  color: var(--on-accent);
}
/* 選択肢の下の小さな補足（先行圧縮が済んだとき「なるべく圧縮」の下に出す） */
.seg-sub {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  opacity: .85;
}
.seg-input:focus-visible + .seg-opt {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.seg-input:disabled + .seg-opt {
  cursor: default;
}
/* 720p以下の動画のときの 1080p など、その選択肢だけ選べないとき */
.seg-input.is-locked:disabled + .seg-opt {
  opacity: .35;
}
.seg:has(.seg-input:disabled:not(.is-locked)) {
  opacity: .45;
}

/* 動画の表示枠（縦画面で1画面に収まるよう高さを抑える） */
.media-box {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  transition: height .25s ease, width .25s ease;
}
/* 圧縮前は元動画を幅いっぱいに大きく、圧縮が終わったら圧縮後の動画を幅いっぱいに大きく（2つの合計の高さは変えない）。
   小さいほうは16:9の小窓にして中央に置く */
.media-box.is-large {
  width: 100%;
  height: 25vh;
  height: 25svh;
  min-height: 150px;
}
.media-box.is-small {
  height: 12vh;
  height: 12svh;
  min-height: 64px;
  width: min(100%, max(114px, 12vh * 16 / 9));
  width: min(100%, max(114px, 12svh * 16 / 9));
}
/* 圧縮中は進捗バーの分だけ、小さいほうの枠をさらに小さくする */
.app.is-running .media-box.is-small {
  height: 7vh;
  height: 7svh;
  min-height: 46px;
  width: min(100%, max(82px, 7vh * 16 / 9));
  width: min(100%, max(82px, 7svh * 16 / 9));
}
.media-box.is-small .media-empty {
  font-size: 12px;
  padding: 4px;
  text-align: center;
}
.media-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.media-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface-2);
  border: 2px dashed var(--line);
  border-radius: 12px;
}
button.media-empty {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
button.media-empty small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.meta-line {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  min-height: 1.2em;
  line-height: 1.35;
}
#planInfo, #outInfo { white-space: pre-line; }   /* 予想の行・圧縮結果は複数行で出す */

/* トリミング（2本のレンジを重ね、つまみの部分だけ触れるようにする） */
/* つまみを画面の端から離す（iPhoneの「端からスワイプで戻る」と重ならないように）。
   --thumb-w はつまみの触れる範囲の幅。バーの両端はその半分だけ内側になる */
.trim {
  --thumb-w: 44px;
  --trim-h: 40px;
  position: relative;
  height: var(--trim-h);
  margin: 0 12px;
  touch-action: none;
}
.trim-track, .trim-fill {
  position: absolute;
  top: 17px;
  height: 6px;
  border-radius: 3px;
}
.trim-track {
  left: calc(var(--thumb-w) / 2);
  right: calc(var(--thumb-w) / 2);
  background: var(--surface-2);
}
.trim-fill {
  background: var(--accent);
  opacity: .4;
}
/* 先行圧縮の結果、範囲が目標サイズに収まる長さの目安を超えているとき（範囲を縮める必要がある） */
.trim.is-over .trim-fill {
  background: var(--trim-over);
  opacity: .9;
}
/* 目盛り（5秒・10秒などの間隔で縦線を引く） */
.trim-ticks {
  position: absolute;
  left: calc(var(--thumb-w) / 2);
  right: calc(var(--thumb-w) / 2);
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.trim-ticks i {
  position: absolute;
  top: 13px;
  width: 1px;
  height: 14px;
  margin-left: -0.5px;
  background: var(--muted);
  opacity: .55;
}
.trim input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: var(--trim-h);
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}
.trim input[type="range"]::-webkit-slider-runnable-track {
  height: var(--trim-h);
  background: transparent;
}
.trim input[type="range"]::-moz-range-track {
  height: var(--trim-h);
  background: transparent;
}
/* つまみは縦線。見た目は幅6px・高さ30pxだが、指で掴みやすいよう触れる範囲は幅44px・高さ40pxにしてある */
.trim input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  margin-top: 0;
  cursor: ew-resize;
  width: var(--thumb-w);
  height: var(--trim-h);
  border: none;
  border-radius: 3px;
  box-shadow: none;
  background: linear-gradient(90deg, transparent 19px, var(--accent) 19px, var(--accent) 25px, transparent 25px) center / 100% 30px no-repeat;
}
.trim input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  cursor: ew-resize;
  width: var(--thumb-w);
  height: var(--trim-h);
  border: none;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent 19px, var(--accent) 19px, var(--accent) 25px, transparent 25px) center / 100% 30px no-repeat;
}
.trim input[type="range"]:disabled::-webkit-slider-thumb {
  background: linear-gradient(90deg, transparent 19px, var(--line) 19px, var(--line) 25px, transparent 25px) center / 100% 30px no-repeat;
  cursor: default;
}
/* 元動画の再生位置（シークバー）。つまみと区別できるよう文字色の細い線にし、触れる範囲はつまみと同じ幅にする。
   トリミングのつまみより下に重ねるので、重なった所ではトリミングが優先される */
.trim input[type="range"].trim-seek {
  z-index: 1;
}
.trim input[type="range"].trim-seek::-webkit-slider-thumb {
  background: linear-gradient(90deg, transparent 21px, var(--text) 21px, var(--text) 23px, transparent 23px) center / 100% 22px no-repeat;
}
.trim input[type="range"].trim-seek::-moz-range-thumb {
  background: linear-gradient(90deg, transparent 21px, var(--text) 21px, var(--text) 23px, transparent 23px) center / 100% 22px no-repeat;
}
.trim input[type="range"].trim-seek:disabled::-webkit-slider-thumb {
  background: linear-gradient(90deg, transparent 21px, var(--muted) 21px, var(--muted) 23px, transparent 23px) center / 100% 22px no-repeat;
}
.trim-times {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
#trimLabel {
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 注意書き・進捗 */
.alert {
  font-size: 12px;
  line-height: 1.45;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-line);
}
.alert.danger {
  background: var(--err-bg);
  color: var(--err-text);
  border-color: var(--err-line);
}
.alert p {
  margin: 0;
}
.alert p + p {
  margin-top: 3px;
}
.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
}

/* 詳細設定 */
details.settings summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
details.settings[open] {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 10px 8px;
}
details.settings label {
  font-size: 13px;
}
details.settings .check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
/* 書き出す動画のファイル名 */
.name-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.name-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.name-list li > label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  font-size: 13px;
}
.name-list .name-move {
  width: 34px;
  padding: 2px 0;
}
.name-list input[type="text"] {
  flex: 1 0 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
}
.name-preview {
  word-break: break-all;
  color: var(--text);
}
details.settings input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  flex: none;
}
details.settings input[type="number"] {
  width: 5em;
  font: inherit;
  font-size: 16px;
  text-align: right;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
}
details.settings .hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}
footer {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
/* 使っているライブラリの表示（注意書きと同じく目立たせない） */
footer .credit {
  margin: 4px 0 0;
}
footer .credit > span {
  display: inline-block;   /* 文の途中で折り返さない */
}
footer .credit a {
  color: inherit;
}
.contact {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 14px 0 0;
}
.contact a {
  color: var(--accent);
}

#urlStatus {
  word-break: break-all;
}
#urlStatus:empty {
  display: none;
}
/* 診断情報（うまく動かないときの報告用） */
#diagBox {
  margin-top: 14px;
}
#diagOut {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  resize: vertical;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}

a.btn {
  text-decoration: none;
}

/* ---------------------------------------------------------------- 3ステップの画面
   3つのステップ（1. 圧縮の仕方を選ぶ → 2. 動画を選んでトリミング → 3. 共有・保存）を1つずつ出す */
.steps {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.steps li {
  flex: 1 1 0;
}
.steps button {
  width: 100%;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 0;
  border-top: 4px solid var(--line);
  padding: 4px 0 0;
  text-align: left;
  cursor: pointer;
}
.steps button:disabled {
  cursor: default;
}
.steps b {
  margin-right: 4px;
}
.steps .is-done button {
  border-top-color: var(--accent);
}
.steps .is-current button {
  border-top-color: var(--accent);
  color: var(--text);
  font-weight: 700;
}
.easy-step:not(.is-current) {
  display: none !important;
}
.easy-step > * + * {
  margin-top: 8px;
}
.step-title {
  font-size: 19px;
  line-height: 1.35;
  margin: 14px 0 4px;
}
.step-lead {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
/* 1. 圧縮の仕方：大きな2つの選択肢 */
.choice {
  display: block;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 18px 16px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.choice[aria-pressed="true"] {
  border-color: var(--accent);
}
.choice:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.choice-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
}
.choice-title::after {
  content: "›";
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
}
.choice-text {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
/* 2. 動画とトリミング */
.easy-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.easy-mode b {
  color: var(--text);
}
.easy-mode-name {
  flex: 1;
  min-width: 0;
}
.easy-mode > .btn {
  flex: none;
}
/* 動画の枠は 16:9 に固定する（画面の高さで決めると、Safari のバーの状態で高さが変わり、16:9 の動画に黒い帯が出ていた） */
.app.easy-app .media-box.is-large,
.app.easy-app .media-box.is-small,
.app.easy-app.is-running .media-box.is-small {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  min-height: 0;
}
/* 2. 予想の行（現在の設定・予想の大きさ・収まる秒数）は、ほかの補足より1段大きくする */
.app.easy-app #planInfo {
  font-size: 14px;
}
/* 設定変更簡易メニューのファイル名 */
.adj-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.adj-name label {
  flex: none;
  font-weight: 600;
}
.adj-name input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
/* 予想の大きさ：大きな太字にし、目標サイズに収まるなら緑、超えるならオレンジ（超えるときは、次の行と下の注意でも知らせる） */
#planInfo .plan-size {
  font-weight: 700;
}
.app.easy-app #planInfo .plan-size {
  font-size: 20px;
}
#planInfo .plan-size.is-fit {
  color: var(--fit-ok);
}
/* 圧縮結果の2行目（元の大きさ → 書き出した大きさ）も、予想の大きさと同じく大きく */
#outInfo .out-size {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
#outInfo .out-size.is-fit {
  color: var(--fit-ok);
}
#outInfo .out-size.is-over {
  color: var(--fit-over);
}
#planInfo .plan-size.is-over {
  color: var(--fit-over);
}
/* 「圧縮する」は高さを固定する。2行目（◯MBで即出力します）が出ても大きくせず、「圧縮する」が少し上に寄る */
.app.easy-app #runBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 12px;
  font-size: 19px;
  line-height: 1.25;
}
.app.easy-app #runBtn .run-sub {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  opacity: .9;
}
/* 3. 共有・保存：ボタンを大きく目立たせる */
.app.easy-app #shareBtn,
.app.easy-app #saveBtn {
  padding: 16px 12px;
  font-size: 18px;
}
.app.easy-app.is-ios #shareBtn {
  padding: 18px 12px;
}
.easy-mode-btns {
  display: flex;
  flex: none;
  gap: 6px;
}
/* 「詳しく設定する」は2択より控えめに */
.choice.choice-sub {
  padding: 12px 16px;
}
.choice.choice-sub .choice-title {
  font-size: 16px;
}
/* 「詳しく設定する」の設定のステップ：詳細設定は開いたまま（見出しは出さない） */
details.settings.easy-settings > summary {
  display: none;
}
/* 2. 設定変更簡易メニュー：その動画だけの解像度・fps・圧縮方法（設定のステップと同じ見た目）。初めは閉じておく */
.adj-menu summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.adj-menu[open] summary {
  margin-bottom: 8px;
}
.adj-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  white-space: pre-line;
}
