:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1c232d; --line: #2a323d;
  --text: #e6edf3; --muted: #8b949e; --accent: #4fd1c5; --accent2: #2dd4bf;
  --ok: #56d364; --err: #ff7b72; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}
.hidden { display: none !important; }
button, select, input { font: inherit; color: inherit; }

.top { max-width: 1040px; margin: 0 auto; padding: 28px 20px 0; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; font-weight: 700;
  background: linear-gradient(135deg, #2dd4bf, #3b82f6); color: #06121a; flex: none;
}
h1 { margin: 0; font-size: 24px; letter-spacing: .02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 6px; margin-top: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  background: none; border: 0; padding: 10px 16px; cursor: pointer; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-color: var(--accent); }

main { max-width: 1040px; margin: 0 auto; padding: 22px 20px 40px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }

/* ドロップ領域 */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 36px 16px; text-align: center; cursor: pointer; transition: .15s; outline: none;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: #12201f; }
.drop-icon { font-size: 36px; }
.drop-title { font-weight: 700; margin-top: 4px; }
.drop-sub { color: var(--muted); font-size: 13px; }

/* ボタン */
.btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; transition: .12s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06231f; font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--accent2); }
.btn.ghost { background: none; color: var(--muted); }
.btn.big { padding: 10px 24px; font-size: 16px; }
.btn.dl { border-color: #2f6f68; color: var(--accent); }

select, input[type=number], input:not([type]), input[type=text] {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
}
input:focus, select:focus { outline: 1px solid var(--accent); }
input[type=range] { accent-color: var(--accent); vertical-align: middle; }
progress { width: 100%; height: 6px; accent-color: var(--accent); }

.options {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: 13.5px;
}
.options label { display: inline-flex; align-items: center; gap: 8px; }
.options b { color: var(--text); min-width: 2ch; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* 変換リスト */
.row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ficon { font-size: 26px; }
.fname { flex: 1 1 200px; min-width: 0; }
.fname b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname small { color: var(--muted); }
.arrow { color: var(--muted); }
.r-prog { margin-top: 10px; }
.r-status { font-size: 13px; color: var(--muted); margin-top: 6px; }
.r-status:empty { display: none; }
.r-status.ok { color: var(--ok); }
.r-status.err { color: var(--err); }
.r-out { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.r-out:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

.matrix { margin-top: 26px; color: var(--muted); font-size: 13.5px; }
.matrix summary { cursor: pointer; color: var(--text); }
.matrix table { border-collapse: collapse; margin: 10px 0; width: 100%; }
.matrix td, .matrix th { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.matrix th { background: var(--panel); }
.note { line-height: 1.8; }

/* エディタ共通 */
.file-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.msg { color: var(--muted); font-size: 13px; }
.export { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.export progress { width: 160px; }
.export label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }

/* 画像トリミング */
.crop-wrap { display: flex; justify-content: center; background: repeating-conic-gradient(#1a2029 0% 25%, #141a21 0% 50%) 0 0 / 20px 20px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.crop-stage { position: relative; touch-action: none; user-select: none; overflow: hidden; line-height: 0; cursor: crosshair; }
.crop-view { display: block; }
.crop-box {
  position: absolute; border: 1.5px solid #fff; cursor: move; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
  background:
    linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.25)) 33.33% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.25)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.25)) 0 33.33% / 100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.25)) 0 66.66% / 100% 1px no-repeat;
}
.crop-box i { position: absolute; width: 14px; height: 14px; background: var(--accent); border: 2px solid #06231f; border-radius: 3px; margin: -7px 0 0 -7px; }
.crop-box i[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; }
.crop-box i[data-h=n] { left: 50%; top: 0; cursor: ns-resize; }
.crop-box i[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; }
.crop-box i[data-h=e] { left: 100%; top: 50%; cursor: ew-resize; }
.crop-box i[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-box i[data-h=s] { left: 50%; top: 100%; cursor: ns-resize; }
.crop-box i[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; }
.crop-box i[data-h=w] { left: 0; top: 50%; cursor: ew-resize; }
.crop-tools { margin-top: 14px; display: grid; gap: 12px; }
.ratio, .xform, .nums { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ratio span { color: var(--muted); font-size: 13.5px; margin-right: 4px; }
.ratio button { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.ratio button.on { background: var(--accent); color: #06231f; border-color: var(--accent); font-weight: 700; }
.nums label { color: var(--muted); font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.nums input { width: 84px; }
.nums .c-outw { width: 110px; }

/* 音声・動画カット */
.video-wrap { background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; text-align: center; }
.video-wrap video { max-width: 100%; max-height: 52vh; display: block; margin: 0 auto; }
.wave-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 12.5px; }
.zoom { color: var(--muted); font-size: 13px; }
.wave-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #0d1117; }
.wave-box { position: relative; }
.wave-box canvas { position: absolute; left: 0; top: 0; display: block; }
.wave-box .ov { touch-action: none; }
.times { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 12px 0; color: var(--muted); font-size: 13.5px; }
.times label { display: inline-flex; gap: 8px; align-items: center; }
.times input { width: 120px; font-variant-numeric: tabular-nums; }
.times b { color: var(--text); font-variant-numeric: tabular-nums; }
.transport { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

@media (max-width: 640px) {
  .top { padding-top: 18px; }
  h1 { font-size: 20px; }
  .brand p { display: none; }
}
