:root {
  --bg: #0c0d16;
  --panel: #151725;
  --panel2: #1d2033;
  --line: #2b2f47;
  --text: #eceef8;
  --muted: #9aa0bd;
  --accent: #ffd23f;
  --accent2: #ff5d8f;
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { line-height: 1.6; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: .04em; }
.tagline { margin: 0; color: var(--muted); font-size: .9rem; }
.tagline span { margin-left: 12px; color: var(--accent); font-size: .8rem; }
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 0 20px 20px; align-items: start; }
.work { min-width: 0; position: sticky; top: 8px; }
.filebar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; min-width: 0; }
.filename { margin: 0; color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.btn { display: inline-block; font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; text-decoration: none; text-align: center; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #17140a; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.wide { display: block; width: calc(100% - 32px); margin-top: 12px; padding: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage-wrap { display: flex; justify-content: center; background: #07080e; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.stage { position: relative; overflow: hidden; border-radius: 6px; line-height: 0; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage.drop { outline: 3px dashed var(--accent); outline-offset: -6px; }
.checker, .stage.checker {
  background-color: #3a3d4f;
  background-image: linear-gradient(45deg, #5b5f75 25%, transparent 25%, transparent 75%, #5b5f75 75%), linear-gradient(45deg, #5b5f75 25%, transparent 25%, transparent 75%, #5b5f75 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}
.transport { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--text); cursor: pointer; display: grid; place-items: center; padding: 0; }
.play svg { width: 22px; height: 22px; fill: #101120; }
.transport > input[type=range] { flex: 1; min-width: 0; }
.time { flex: none; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; }
.vol { flex: none; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.vol input { width: 84px; }
.error { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: #3b1525; border: 1px solid #7c2a4a; color: #ffd6e2; font-size: .9rem; line-height: 1.6; }
input[type=range] { accent-color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel details + details { border-top: 1px solid var(--line); }
.panel summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style-position: inside; }
.panel details > *:not(summary) { margin-left: 16px; margin-right: 16px; }
.panel details > *:last-child { margin-bottom: 16px; }
.group-label { margin: 4px 0 6px; color: var(--muted); font-size: .76rem; }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.style-btn { padding: 4px 2px 4px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); border-radius: 8px; font: inherit; font-size: .68rem; cursor: pointer; line-height: 1.3; }
.style-btn canvas { display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 2px; border-radius: 4px; }
.style-btn:hover { border-color: var(--muted); }
.style-btn[aria-pressed=true] { border-color: var(--accent); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 46px; align-items: center; gap: 8px; margin-top: 6px; margin-bottom: 6px; font-size: .84rem; }
.row input { width: 100%; }
.row output { color: var(--muted); font-size: .76rem; text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 8px; font-size: .84rem; margin-top: 6px; margin-bottom: 6px; cursor: pointer; }
.seg { display: flex; margin-top: 8px; margin-bottom: 8px; background: var(--panel2); border-radius: 9px; padding: 3px; }
.seg label { flex: 1; text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 4px; border-radius: 7px; font-size: .8rem; color: var(--muted); }
.seg input:checked + span { background: var(--accent); color: #17140a; font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; margin-bottom: 8px; }
input[type=color] { width: 44px; height: 32px; padding: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.colors .check { margin: 0 0 0 4px; }
.presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 8px; }
.preset { aspect-ratio: 1; border: 2px solid transparent; border-radius: 8px; cursor: pointer; padding: 0; }
.preset:hover { border-color: var(--text); }
.field { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; margin-bottom: 8px; font-size: .84rem; }
select { width: 100%; font: inherit; font-size: .84rem; padding: 6px 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 7px; }
.range-field { grid-template-columns: 78px minmax(0, 1fr) auto minmax(0, 1fr); }
.range-field input { width: 100%; min-width: 0; font: inherit; font-size: .84rem; padding: 6px 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 7px; text-align: center; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: .76rem; margin-top: 6px; margin-bottom: 6px; line-height: 1.6; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(4, 5, 12, .72); }
dialog h2 { margin: 0 0 12px; font-size: 1.1rem; }
.bar { height: 10px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
#progress p { font-variant-numeric: tabular-nums; font-size: .9rem; }
.result-view { border-radius: 8px; overflow: hidden; line-height: 0; background-color: #07080e; display: flex; justify-content: center; }
.result-view.checker { background-color: #3a3d4f; }
.no-preview { margin: 0; padding: 26px 16px; line-height: 1.7; color: var(--muted); font-size: .88rem; text-align: center; }
.result-view video { max-width: 100%; max-height: 50vh; }
#resultInfo { font-size: .86rem; color: var(--muted); margin: 10px 0 14px; word-break: break-all; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.guide { max-width: 860px; margin: 24px auto 0; padding: 0 20px 24px; }
.guide h2 { font-size: 1.2rem; margin: 34px 0 10px; }
.guide p, .guide li span, .guide dd { color: #c9cde0; font-size: .95rem; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 12px 52px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #17140a; font-weight: 800; display: grid; place-items: center; font-size: .86rem; }
.steps b { display: block; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td:first-child, th:first-child { white-space: nowrap; }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; }
.foot { border-top: 1px solid var(--line); padding: 20px; text-align: center; color: var(--muted); font-size: .84rem; }
.foot nav { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.foot a { color: var(--muted); }
.foot p { margin: 0; }
.doc { max-width: 760px; margin: 0 auto; padding: 10px 20px 40px; }
.doc h1 { font-size: 1.5rem; }
.doc h2 { font-size: 1.05rem; margin-top: 28px; }
.doc p { color: #c9cde0; font-size: .95rem; }
.doc .date { color: var(--muted); font-size: .85rem; margin-top: 28px; }
@media (max-width: 960px) {
  .studio { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .work { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0 8px; }
  .stage-wrap { padding: 6px; }
  .vol { display: none; }
  .top { padding: 10px 16px; }
  .tagline span { display: block; margin-left: 0; }
  .guide { padding: 0 16px 24px; }
}
@media (max-width: 960px) and (max-height: 700px) {
  .work { position: static; }
}
