/* ============================================================================
   Audio cut editor (2026-10-12) - shared by /mp3-cutter/ and /audio-trimmer/.
   Everything scoped to .ace / ace- classes. Light default, dark via [data-theme="dark"].
   Accent: audio blue #3399cc.
   ========================================================================== */
/* ---------- base (shared look of the W10 audio / video tools, prefixed ace-) ---------- */
.ace {
    --ace-accent: #3399cc;
    --ace-accent-strong: #1f78a8;
    --ace-accent-soft: rgba(51, 153, 204, 0.12);
    --ace-accent-line: rgba(51, 153, 204, 0.38);
    --ace-btn: #2a87b8;
    --ace-btn-hover: #1f6f99;
    --ace-ok: #339966;
    --ace-ok-soft: rgba(51, 153, 102, 0.12);
    --ace-bad: #e64e4e;
    --ace-bad-soft: rgba(230, 78, 78, 0.10);
    --ace-warn: #b7791f;
    --ace-warn-soft: rgba(245, 158, 11, 0.12);
    --ace-card: var(--bg-elevated, #fff);
    --ace-bg2: var(--card-tertiary, #f1f5f9);
    --ace-text: var(--text-primary, #1e293b);
    --ace-text2: var(--text-secondary, #475569);
    --ace-muted: var(--text-muted, #64748b);
    --ace-line: var(--border-color, #e2e8f0);
    --ace-line2: #cbd5e1;
    --ace-wave-bg: #f4f8fb;
    --ace-switch-off: #cbd5e1;
    --tool-accent: #3399cc;
    color: var(--ace-text);
}
[data-theme="dark"] .ace {
    --ace-accent: #4db8e8;
    --ace-accent-strong: #7cccf0;
    --ace-accent-soft: rgba(77, 184, 232, 0.15);
    --ace-accent-line: rgba(77, 184, 232, 0.42);
    --ace-ok: #4ade80;
    --ace-ok-soft: rgba(74, 222, 128, 0.14);
    --ace-bad: #f87171;
    --ace-bad-soft: rgba(248, 113, 113, 0.14);
    --ace-warn: #fbbf24;
    --ace-warn-soft: rgba(251, 191, 36, 0.14);
    --ace-card: var(--bg-elevated, #1e293b);
    --ace-bg2: #273449;
    --ace-text: var(--text-primary, #f1f5f9);
    --ace-text2: var(--text-secondary, #cbd5e1);
    --ace-muted: var(--text-muted, #94a3b8);
    --ace-line: var(--border-color, #334155);
    --ace-line2: #475569;
    --ace-wave-bg: #142033;
    --ace-switch-off: #475569;
}
.ace *, .ace *::before, .ace *::after { box-sizing: border-box; }
.ace [hidden] { display: none !important; }
.ace button { width: auto; }
.ace a { color: var(--ace-accent-strong); }
.ace i[data-lucide], .ace svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }

/* header */
.ace .ace-header { text-align: center; margin-bottom: 1.5rem; }
.ace .ace-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: 0.82rem; color: var(--ace-muted); }
.ace .ace-crumbs li + li::before { content: "/"; margin-right: 0.35rem; color: var(--ace-line2); }
.ace .ace-crumbs a { color: var(--ace-muted); text-decoration: none; }
.ace .ace-crumbs a:hover { color: var(--ace-accent-strong); text-decoration: underline; }
.ace .ace-title-row { display: flex; align-items: center; justify-content: center; gap: 0.85rem; margin-bottom: 0.85rem; }
.ace .ace-title-icon { width: 56px; height: 56px; border-radius: 12px; background: var(--ace-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ace .ace-title-icon svg { width: 28px; height: 28px; }
.ace .ace-title { margin: 0; color: var(--ace-accent-strong); font-size: clamp(1.7rem, 4vw, 2.35rem); font-weight: 700; letter-spacing: -0.02em; }
.ace .ace-desc { margin: 0 auto; color: var(--ace-text2); font-size: 1.04rem; line-height: 1.7; }

/* alerts */
.ace .ace-error, .ace .ace-note {
    display: flex; gap: 0.75rem; align-items: flex-start; border-radius: 12px; padding: 0.85rem 1rem; margin: 0 0 1rem;
    background: var(--ace-bad-soft); border: 1px solid var(--ace-bad); color: var(--ace-text);
}
.ace .ace-note { background: var(--ace-accent-soft); border-color: var(--ace-accent-line); }
.ace .ace-error > svg { color: var(--ace-bad); margin-top: 2px; }
.ace .ace-note > svg { color: var(--ace-accent-strong); margin-top: 2px; }
.ace .ace-error p, .ace .ace-note p { margin: 0; line-height: 1.55; }
.ace .ace-alert-body { flex: 1; min-width: 0; }
.ace .ace-x { background: none; border: 0; color: var(--ace-muted); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; }
.ace .ace-x:hover { color: var(--ace-text); background: var(--ace-bg2); }

/* cards + layout */
.ace .ace-card { background: var(--ace-card); border: 1px solid var(--ace-line); border-radius: 16px; padding: 1.15rem; min-width: 0; }
.ace .ace-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ace .ace-grid > * { min-width: 0; }
.ace .ace-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ace .ace-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; min-width: 0; flex-wrap: wrap; }
.ace .ace-head h2 { display: flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 1rem; font-weight: 700; color: var(--ace-text); }
.ace .ace-head h2 svg { color: var(--ace-accent); }
.ace .ace-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; color: var(--ace-accent-strong); background: var(--ace-accent-soft); border-radius: 6px; padding: 0.18rem 0.55rem; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ace .ace-caption { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ace-muted); }
.ace .ace-caption svg { width: 14px; height: 14px; }
.ace .ace-hint { font-size: 0.8rem; color: var(--ace-muted); margin: 0.4rem 0 0; line-height: 1.5; }

/* drop zone */
.ace .ace-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem;
    min-height: 240px; padding: 2.1rem 1.25rem; text-align: center; cursor: pointer;
    border: 2px dashed var(--ace-line2); border-radius: 16px; background: var(--ace-card);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.ace .ace-drop:hover, .ace .ace-drop.ace-over, .ace .ace-drop:focus-within { border-color: var(--ace-accent); background: var(--ace-accent-soft); }
.ace .ace-drop-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ace-accent-soft); color: var(--ace-accent-strong); display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem; }
.ace .ace-drop-icon svg { width: 30px; height: 30px; }
.ace .ace-drop strong { font-size: 1.2rem; color: var(--ace-text); }
.ace .ace-drop-link { color: var(--ace-accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.ace .ace-drop-sub { color: var(--ace-muted); font-size: 0.92rem; }
.ace .ace-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.6rem; }
.ace .ace-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--ace-bg2); color: var(--ace-text2); font-size: 0.8rem; font-weight: 600; }
.ace .ace-badge svg { width: 14px; height: 14px; color: var(--ace-ok); }
.ace .ace-reading { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.75rem; color: var(--ace-muted); font-size: 0.92rem; }

/* ConvertICO ring loader */
.ace .ace-loader { display: block; width: 32px; height: 32px; overflow: visible; flex-shrink: 0;
    --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb; }
[data-theme="dark"] .ace .ace-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.ace .ace-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.ace .ace-loader .bp { stroke: var(--cico-outer-soft); }
.ace .ace-loader .gp { stroke: var(--cico-mid-soft); }
.ace .ace-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: aceSpinL 1.3s linear infinite; }
.ace .ace-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: aceSpinR 2.1s linear infinite; }
.ace .ace-loader .r { stroke: var(--cico-inner); animation: aceBreathe 1.3s ease-in-out infinite; }
.ace .ace-loader-lg { width: 56px; height: 56px; }
@keyframes aceSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes aceSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes aceBreathe { 50% { transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) {
    .ace .ace-loader .b { animation-duration: 4s; }
    .ace .ace-loader .g { animation-duration: 6s; }
    .ace .ace-loader .r { animation: none; }
}

/* buttons */
.ace .ace-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 44px; padding: 0.6rem 1.15rem;
    border-radius: 12px; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none;
    border: 1px solid transparent; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ace .ace-btn:focus-visible { outline: 2px solid var(--ace-accent); outline-offset: 2px; }
.ace .ace-btn-primary { background: var(--ace-btn); color: #fff; }
.ace .ace-btn-primary:hover { background: var(--ace-btn-hover); color: #fff; }
.ace .ace-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.ace .ace-btn-ghost { background: var(--ace-card); color: var(--ace-text); border-color: var(--ace-line2); }
.ace .ace-btn-ghost:hover:not(:disabled) { border-color: var(--ace-accent); color: var(--ace-accent-strong); }
.ace .ace-btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.ace .ace-btn-ok { background: var(--ace-ok); color: #fff; }
.ace .ace-btn-ok:hover { filter: brightness(0.95); color: #fff; }
[data-theme="dark"] .ace .ace-btn-ok { background: #2f8a5c; }
.ace .ace-btn-sm { white-space: nowrap; flex-shrink: 0; min-height: 34px; padding: 0.35rem 0.75rem; font-size: 0.85rem; border-radius: 8px; }
.ace .ace-btn-sm svg { width: 15px; height: 15px; }
.ace .ace-btn-lg { min-height: 52px; font-size: 1.05rem; padding: 0.7rem 1.5rem; }
.ace .ace-iconbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--ace-line); background: var(--ace-card); color: var(--ace-text2); cursor: pointer; padding: 0; flex-shrink: 0; }
.ace .ace-iconbtn:hover:not(:disabled) { border-color: var(--ace-accent); color: var(--ace-accent-strong); }
.ace .ace-iconbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.ace .ace-iconbtn svg { width: 16px; height: 16px; }
.ace .ace-link-btn { background: none; border: 0; padding: 0.25rem; font: inherit; font-size: 0.85rem; color: var(--ace-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; }
.ace .ace-link-btn:hover { color: var(--ace-accent-strong); }
.ace .ace-link-btn svg { width: 15px; height: 15px; }

/* chips / quick cards */
.ace .ace-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
.ace .ace-seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ace .ace-seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ace .ace-seg-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ace .ace-seg-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ace .ace-q {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-width: 0; min-height: 40px;
    padding: 0.4rem 0.35rem; border: 1px solid var(--ace-line); border-radius: 9px; background: var(--ace-card); color: var(--ace-text);
    font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; text-align: center; line-height: 1.2;
}
.ace .ace-q small { font-size: 0.68rem; font-weight: 500; color: var(--ace-muted); }
.ace .ace-q svg { width: 16px; height: 16px; color: var(--ace-accent); }
.ace .ace-q:hover:not(:disabled) { border-color: var(--ace-accent); }
.ace .ace-q.ace-on { border-color: var(--ace-accent); background: var(--ace-accent-soft); color: var(--ace-accent-strong); box-shadow: inset 0 0 0 1px var(--ace-accent); }
.ace .ace-q:disabled { opacity: 0.45; cursor: not-allowed; }

/* settings: main block + collapsed rows */
.ace .ace-block { background: var(--ace-card); border: 1px solid var(--ace-line); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 0.875rem; }
.ace .ace-block > .ace-caption { margin-bottom: 0.55rem; }
.ace .ace-adv { background: var(--ace-card); border: 1px solid var(--ace-line); border-radius: 12px; overflow: hidden; margin-bottom: 0.875rem; }
.ace .ace-adv-row + .ace-adv-row { border-top: 1px solid var(--ace-line); }
.ace .ace-adv-head { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0.9rem; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.ace .ace-adv-head:hover { background: var(--ace-bg2); }
.ace .ace-adv-head:focus-visible { outline: 2px solid var(--ace-accent); outline-offset: -2px; }
.ace .ace-adv-left, .ace .ace-adv-right { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.ace .ace-adv-right { flex-shrink: 0; gap: 0.5rem; }
.ace .ace-adv-left > svg { width: 16px; height: 16px; color: var(--ace-accent); }
.ace .ace-adv-text { display: flex; flex-direction: column; min-width: 0; }
.ace .ace-adv-title { font-size: 0.86rem; font-weight: 600; color: var(--ace-text); white-space: nowrap; }
.ace .ace-adv-hint { font-size: 0.75rem; color: var(--ace-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ace .ace-adv-value { font-size: 0.75rem; font-weight: 700; color: var(--ace-accent-strong); background: var(--ace-accent-soft); border-radius: 999px; padding: 0.2rem 0.6rem; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ace .ace-adv-chev { width: 16px; height: 16px; color: var(--ace-muted); transition: transform 0.2s ease; }
.ace .ace-adv-row.ace-open .ace-adv-chev { transform: rotate(180deg); }
.ace .ace-adv-row.ace-open .ace-adv-head, .ace .ace-adv-row.ace-open .ace-adv-body { background: var(--ace-bg2); }
.ace .ace-adv-body { padding: 0.25rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; }
.ace .ace-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ace .ace-field label, .ace .ace-lab { font-size: 0.8rem; font-weight: 600; color: var(--ace-text2); }
.ace .ace-input { width: 100%; min-height: 38px; padding: 0.4rem 0.65rem; border: 1px solid var(--input-border, var(--ace-line2)); border-radius: 8px; background: var(--input-bg, var(--ace-card)); color: var(--ace-text); font: inherit; font-size: 0.9rem; }
.ace .ace-input:focus { outline: 2px solid var(--ace-accent-line); border-color: var(--ace-accent); }
.ace .ace-fields-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.55rem; }
.ace .ace-range { width: 100%; accent-color: var(--ace-accent); }
.ace .ace-range-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--ace-text2); }
.ace .ace-range-head b { color: var(--ace-accent-strong); }
.ace .ace-switchrow { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ace .ace-switchrow span { font-size: 0.85rem; color: var(--ace-text2); }
.ace .ace-switchwrap { display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; font-size: 0.75rem; font-weight: 700; color: var(--ace-muted); }
.tool-container input[type="checkbox"].ace-switch {
    -webkit-appearance: none !important; appearance: none !important; position: relative !important; display: inline-block !important;
    width: 44px !important; min-width: 44px !important; height: 24px !important; margin: 0 !important; padding: 0 !important; cursor: pointer !important;
    border: 1px solid var(--ace-line2) !important; border-radius: 999px !important;
    background: var(--ace-switch-off) !important; background-color: var(--ace-switch-off) !important; background-image: none !important;
    transition: background-color 0.2s ease !important; vertical-align: middle !important; box-shadow: none !important;
}
.tool-container input[type="checkbox"].ace-switch:checked { background: var(--ace-accent) !important; background-color: var(--ace-accent) !important; border-color: var(--ace-accent) !important; }
.tool-container input[type="checkbox"].ace-switch::before { content: none !important; display: none !important; }
.tool-container input[type="checkbox"].ace-switch::after,
.tool-container input[type="checkbox"].ace-switch:checked::after {
    content: "" !important; position: absolute !important; top: 2px !important; left: 2px !important; width: 18px !important; height: 18px !important;
    border: 0 !important; border-radius: 50% !important; background: #fff !important; transform: none; transition: transform 0.2s ease !important; display: block !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}
.tool-container input[type="checkbox"].ace-switch:checked::after { transform: translateX(20px) !important; }
.tool-container input[type="checkbox"].ace-switch:focus-visible { outline: 2px solid var(--ace-accent) !important; outline-offset: 2px !important; }

/* overlay with stages */
.ace .ace-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.ace .ace-ov-card { background: var(--ace-card); border: 1px solid var(--ace-line); border-radius: 16px; padding: 1.5rem; min-width: 340px; max-width: 440px; width: 100%; text-align: center; color: var(--ace-text); }
.ace .ace-stages { display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.ace .ace-stage { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--ace-bg2); color: var(--ace-muted); display: inline-flex; align-items: center; justify-content: center; }
.ace .ace-stage svg { width: 20px; height: 20px; }
.ace .ace-stage.ace-active { background: var(--ace-accent); color: #fff; }
.ace .ace-stage.ace-done { background: var(--ace-ok); color: #fff; }
.ace .ace-stage-line { width: 28px; height: 2px; background: var(--ace-line); }
.ace .ace-ov-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 0.35rem; }
.ace .ace-ov-msg { color: var(--ace-muted); font-size: 0.88rem; min-height: 1.3em; margin: 0 0 0.9rem; }
.ace .ace-bar { height: 8px; background: var(--ace-bg2); border-radius: 999px; overflow: hidden; }
.ace .ace-bar span { display: block; height: 100%; width: 0; background: var(--ace-accent); border-radius: 999px; transition: width 0.25s ease; }
.ace .ace-ov-pct { font-weight: 800; font-size: 1.1rem; margin-top: 0.55rem; color: var(--ace-accent-strong); }
.ace .ace-ov-cancel { margin-top: 0.9rem; }

/* result */
.ace .ace-result { background: var(--ace-ok-soft); border: 1px solid var(--ace-ok); border-radius: 16px; padding: 1.1rem 1.2rem; margin-top: 1rem; }
.ace .ace-result-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.ace .ace-result-head > svg { color: var(--ace-ok); width: 22px; height: 22px; }
.ace .ace-result-head h2 { margin: 0; font-size: 1.05rem; color: var(--ace-text); }
.ace .ace-result-head p { margin: 0; font-size: 0.85rem; color: var(--ace-text2); }
.ace .ace-result audio, .ace .ace-result video { width: 100%; display: block; margin: 0 0 0.75rem; border-radius: 10px; }
.ace .ace-result-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ace .ace-then { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.85rem; font-size: 0.82rem; color: var(--ace-muted); }
.ace .ace-then a { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.65rem; border: 1px solid var(--ace-line); border-radius: 999px; text-decoration: none; color: var(--ace-text2); background: var(--ace-card); font-weight: 600; }
.ace .ace-then a:hover { border-color: var(--ace-accent); color: var(--ace-accent-strong); }
.ace .ace-then svg { width: 14px; height: 14px; }

/* info section */
.ace .ace-info { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.ace .ace-info-card { background: var(--ace-card); border: 1px solid var(--ace-line); border-radius: 16px; padding: 1.4rem 1.5rem; }
.ace .ace-info-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.85rem; font-size: 1.3rem; color: var(--ace-text); }
.ace .ace-info-card h2 svg { width: 22px; height: 22px; color: var(--ace-accent); }
.ace .ace-info-card h3 { margin: 1rem 0 0.35rem; font-size: 1rem; color: var(--ace-text); }
.ace .ace-info-card p, .ace .ace-info-card li { color: var(--ace-text2); line-height: 1.7; font-size: 0.97rem; }
.ace .ace-info-card p { margin: 0 0 0.75rem; }
.ace .ace-info-card p:last-child { margin-bottom: 0; }
.ace .ace-info-card ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.ace .ace-table-wrap { overflow-x: auto; margin: 0 0 0.85rem; border: 1px solid var(--ace-line); border-radius: 12px; }
.ace .ace-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 460px; }
.ace .ace-table th, .ace .ace-table td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid var(--ace-line); color: var(--ace-text2); }
.ace .ace-table th { background: var(--ace-bg2); color: var(--ace-text); font-weight: 700; }
.ace .ace-table tr:last-child td { border-bottom: 0; }
.ace .ace-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.75rem; }
.ace .ace-tile { border: 1px solid var(--ace-line); border-radius: 12px; padding: 0.9rem 1rem; min-width: 0; }
.ace .ace-tile h3 { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.35rem; font-size: 0.98rem; }
.ace .ace-tile h3 svg { color: var(--ace-accent); width: 18px; height: 18px; }
.ace .ace-tile p { margin: 0; font-size: 0.9rem; }

@media (max-width: 860px) {
    .ace .ace-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .ace .ace-title-icon { width: 46px; height: 46px; }
    .ace .ace-title-icon svg { width: 24px; height: 24px; }
    .ace .ace-seg-4, .ace .ace-seg-5, .ace .ace-seg-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ace .ace-adv-hint { white-space: normal; }
    .ace .ace-info-card { padding: 1.1rem; }
    .ace .ace-ov-card { min-width: 0; }
    .ace .ace-card { padding: 0.9rem; }
    .ace .ace-drop { min-height: 200px; padding: 1.5rem 1rem; }
}

/* ---------- audio cut editor specifics ---------- */
.ace { --ace-wave-on: #3399cc; --ace-wave-off: #b4c1cf; --ace-wave-mid: rgba(15, 23, 42, 0.10); --ace-head: #e64e4e; }
[data-theme="dark"] .ace { --ace-wave-on: #4db8e8; --ace-wave-off: #4b5b72; --ace-wave-mid: rgba(255, 255, 255, 0.10); --ace-head: #f87171; }
.ace .ace-wavecard { margin-bottom: 1rem; }
.ace .ace-filebar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; min-width: 0; }
.ace .ace-fileicon { width: 42px; height: 42px; border-radius: 10px; background: var(--ace-accent-soft); color: var(--ace-accent-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ace .ace-filetext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ace .ace-filetext b { font-size: 0.95rem; color: var(--ace-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ace .ace-filetext span { font-size: 0.8rem; color: var(--ace-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ace .ace-zoombar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.ace .ace-zoomctl { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ace .ace-zoom { width: 140px; }
.ace .ace-wave { position: relative; height: 150px; overflow-x: auto; overflow-y: hidden; background: var(--ace-wave-bg); border: 1px solid var(--ace-line); border-radius: 12px 12px 0 0; scrollbar-width: thin; }
.ace .ace-wave-inner { position: relative; height: 100%; min-width: 100%; cursor: crosshair; touch-action: pan-x; }
.ace .ace-canvas { position: sticky; left: 0; top: 0; display: block; height: 100%; pointer-events: none; }
.ace .ace-sel { position: absolute; top: 0; bottom: 0; background: var(--ace-accent-soft); outline: 1px solid var(--ace-accent-line); pointer-events: none; }
.ace .ace-sel.ace-sel-remove { background: var(--ace-bad-soft); outline-color: var(--ace-bad); }
.ace .ace-h { position: absolute; top: 0; bottom: 0; width: 22px; margin-left: -11px; cursor: ew-resize; pointer-events: auto; touch-action: none; display: flex; justify-content: center; z-index: 3; }
.ace .ace-h-l { left: 0; margin-left: -4px; justify-content: flex-start; }
.ace .ace-h-r { left: 100%; margin-left: -18px; justify-content: flex-end; }
.ace .ace-h > span { width: 3px; height: 100%; background: var(--ace-accent); border-radius: 2px; position: relative; }
.ace .ace-h > span::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 30px; margin: -15px 0 0 -7px; border-radius: 7px; background: var(--ace-accent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.ace .ace-sel-remove .ace-h > span, .ace .ace-sel-remove .ace-h > span::after { background: var(--ace-bad); }
.ace .ace-h:focus-visible { outline: none; }
.ace .ace-h:focus-visible > span::after { box-shadow: 0 0 0 3px var(--ace-accent-line); }
.ace .ace-cuts { position: absolute; inset: 0; pointer-events: none; }
.ace .ace-cut { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--ace-bad-soft) 0 6px, transparent 6px 12px); outline: 1px dashed var(--ace-bad); }
.ace .ace-partmark { position: absolute; top: 0; height: 18px; background: var(--ace-accent-soft); border: 1px solid var(--ace-accent); border-radius: 0 0 6px 6px; font-size: 0.68rem; color: var(--ace-accent-strong); display: flex; align-items: center; padding-left: 4px; overflow: hidden; }
.ace .ace-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ace-head); pointer-events: none; z-index: 2; }
.ace .ace-ruler { position: relative; height: 22px; overflow: hidden; border: 1px solid var(--ace-line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--ace-card); }
.ace .ace-ruler span { position: absolute; top: 3px; font-size: 0.68rem; color: var(--ace-muted); padding-left: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ace .ace-ruler span::before { content: ""; position: absolute; left: 0; top: -3px; height: 7px; width: 1px; background: var(--ace-line2); }
.ace .ace-wavehint { font-size: 0.78rem; color: var(--ace-muted); margin: 0.45rem 0 0.8rem; }
.ace .ace-transport { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.ace .ace-play { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--ace-btn); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.ace .ace-play:hover { background: var(--ace-btn-hover); }
.ace .ace-play svg { width: 22px; height: 22px; }
.ace .ace-iconbtn.ace-on { background: var(--ace-accent-soft); border-color: var(--ace-accent); color: var(--ace-accent-strong); }
.ace .ace-seg2 { display: inline-flex; border: 1px solid var(--ace-line); border-radius: 10px; overflow: hidden; background: var(--ace-card); }
.ace .ace-seg2 button { border: 0; background: transparent; color: var(--ace-muted); padding: 0.45rem 0.7rem; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.ace .ace-seg2 button + button { box-shadow: inset 1px 0 0 var(--ace-line); }
.ace .ace-seg2 button.ace-on { background: var(--ace-accent-soft); color: var(--ace-accent-strong); }
.ace .ace-clock { margin-left: auto; font-size: 0.88rem; color: var(--ace-muted); font-variant-numeric: tabular-nums; }
.ace .ace-clock b { color: var(--ace-text); }
.ace .ace-times { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.75rem; align-items: start; margin-bottom: 0.85rem; }
.ace .ace-time { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ace .ace-time > label, .ace .ace-lab { font-size: 0.78rem; font-weight: 700; color: var(--ace-text2); }
.ace .ace-time-len { align-items: center; text-align: center; padding-top: 0.2rem; }
.ace .ace-time-len b { font-size: 1.25rem; color: var(--ace-accent-strong); font-variant-numeric: tabular-nums; }
.ace .ace-time-len .ace-lab { font-weight: 600; color: var(--ace-muted); }
.ace .ace-timebox { display: flex; align-items: stretch; gap: 0.3rem; }
.ace .ace-timeinput { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1rem; }
.ace .ace-timeinput.ace-bad { border-color: var(--ace-bad); }
.ace .ace-nudge { width: 38px; flex-shrink: 0; border: 1px solid var(--ace-line); border-radius: 8px; background: var(--ace-card); color: var(--ace-text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.ace .ace-nudge:hover { border-color: var(--ace-accent); color: var(--ace-accent-strong); }
.ace .ace-nudge svg { width: 15px; height: 15px; }
.ace .ace-time .ace-link-btn { align-self: flex-start; font-size: 0.78rem; }
.ace .ace-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.ace .ace-chipbtn { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--ace-line); background: var(--ace-card); color: var(--ace-text2); border-radius: 999px; padding: 0.38rem 0.8rem; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.ace .ace-chipbtn svg { width: 15px; height: 15px; color: var(--ace-accent); }
.ace .ace-chipbtn:hover { border-color: var(--ace-accent); color: var(--ace-accent-strong); }
.ace .ace-chipbtn.ace-chip-strong { border-color: var(--ace-accent-line); background: var(--ace-accent-soft); color: var(--ace-accent-strong); }
.ace .ace-ring, .ace .ace-cleanup { border-top: 1px solid var(--ace-line); padding-top: 0.85rem; display: flex; flex-direction: column; gap: 0.55rem; }
.ace .ace-ring .ace-q { flex-direction: row; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-start; text-align: left; padding: 0.55rem 0.7rem; }
.ace .ace-ring .ace-q small { width: 100%; }
.ace .ace-cleanrow { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ace .ace-inline { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }
.ace .ace-select { width: auto; min-height: 34px; padding: 0.25rem 0.5rem; font-size: 0.82rem; }
.ace .ace-cutlist { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ace .ace-cutchip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 600; color: var(--ace-bad); background: var(--ace-bad-soft); border-radius: 999px; padding: 0.2rem 0.3rem 0.2rem 0.65rem; font-variant-numeric: tabular-nums; }
.ace .ace-cutchip button { border: 0; background: none; color: inherit; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 50%; }
.ace .ace-cutchip svg { width: 13px; height: 13px; }
.ace .ace-parts { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.ace .ace-partlist { margin: 0; padding: 0; list-style: none; width: 100%; display: flex; flex-direction: column; gap: 0.35rem; }
.ace .ace-partlist li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; border: 1px solid var(--ace-line); border-radius: 8px; padding: 0.3rem 0.3rem 0.3rem 0.65rem; font-size: 0.82rem; color: var(--ace-text2); font-variant-numeric: tabular-nums; }
.ace .ace-partlist .ace-iconbtn { width: 28px; height: 28px; }
.ace .ace-seg-4 .ace-q, .ace .ace-seg-3 .ace-q, .ace .ace-seg-2 .ace-q { min-height: 48px; }
.ace #aceMode .ace-q { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 0.35rem; padding: 0.55rem 0.7rem; }
.ace #aceMode .ace-q small { width: 100%; }
.ace .ace-summary { display: flex; flex-direction: column; gap: 0.35rem; margin: 0 0 0.9rem; }
.ace .ace-sumline { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0; font-size: 0.82rem; color: var(--ace-text2); line-height: 1.45; }
.ace .ace-sumline svg { width: 15px; height: 15px; color: var(--ace-accent); margin-top: 2px; }
.ace .ace-sumline.ace-warnline { color: var(--ace-warn); }
.ace .ace-sumline.ace-warnline svg { color: var(--ace-warn); }
.ace .ace-go { width: 100%; }
.ace .ace-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 8000; background: #1e293b; color: #f8fafc; border-radius: 10px; padding: 0.6rem 1rem; font-size: 0.88rem; max-width: calc(100vw - 32px); transition: opacity 0.2s ease, transform 0.2s ease; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.ace .ace-toast.ace-show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .ace .ace-toast { background: #f1f5f9; color: #0f172a; }
.ace .ace-result audio { margin-top: 0.25rem; }
@media (max-width: 700px) {
    .ace .ace-times { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ace .ace-time-len { grid-column: 1 / -1; order: 3; flex-direction: row; justify-content: center; gap: 0.6rem; }
    .ace .ace-clock { margin-left: 0; width: 100%; }
    .ace .ace-nomobile { display: none; }
}
@media (max-width: 560px) {
    .ace .ace-zoombar .ace-btn-sm span { display: none; }
    .ace .ace-zoom { width: 90px; }
    .ace .ace-wave { height: 130px; }
    .ace .ace-times { grid-template-columns: minmax(0, 1fr); }
    .ace .ace-ring .ace-seg-3 { grid-template-columns: minmax(0, 1fr); }
    .ace #aceMode { grid-template-columns: minmax(0, 1fr); }
    .ace .ace-seg-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ace .ace-seg2 button { padding: 0.45rem 0.55rem; }
}
/* icon + title on one line, caption below (2026-10-12) */
.ace #aceMode .ace-q, .ace .ace-ring .ace-q { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 0.45rem; row-gap: 0.1rem; align-items: center; justify-items: start; text-align: left; padding: 0.55rem 0.7rem; }
.ace #aceMode .ace-q small, .ace .ace-ring .ace-q small { grid-column: 2; width: auto; padding: 0; margin: 0; }
