:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #211c32;
  background: #f7f6fb;
  --ink: #211c32;
  --muted: #5b556c;
  --line: #ddd8e8;
  --brand: #5231ac;
  --brand-dark: #3c2382;
  --accent: #d8f5bb;
  --success: #305117;
  --error: #912a42;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
a { color: inherit; }
button, select, input { font: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(100% - 3rem, 62rem); margin-inline: auto; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wordmark { display: inline-flex; align-items: center; gap: .65rem; font-size: .9rem; font-weight: 780; letter-spacing: .045em; text-decoration: none; white-space: nowrap; }
.slash { color: var(--brand); }
.mark { display: flex; align-items: center; justify-content: center; gap: 2px; width: 2rem; height: 2rem; background: var(--brand); border-radius: .55rem; }
.mark i { width: 2px; height: 7px; background: #fff; border-radius: 3px; }
.mark i:nth-child(2), .mark i:nth-child(4) { height: 11px; }
.mark i:nth-child(3) { height: 16px; background: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: clamp(.7rem, 3vw, 1.65rem); }
.topbar nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; font-weight: 650; color: var(--muted); text-decoration: none; white-space: nowrap; }
.topbar nav a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: .25em; }

.tool { padding-block: clamp(1.9rem, 4.7vw, 3.15rem) clamp(2.65rem, 7vw, 4.75rem); }
.tool-intro { text-align: center; margin-bottom: clamp(1.3rem, 3vw, 1.7rem); }
h1 { margin: 0; font-size: clamp(3.05rem, 8vw, 5.35rem); font-weight: 790; letter-spacing: -.073em; line-height: .99; }
.title-period { color: var(--brand); }
.tool-intro > p { margin: 1.05rem auto .85rem; color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.2rem); line-height: 1.45; }
.terms { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem .78rem; color: var(--muted); font-size: .85rem; font-weight: 590; }
.free { padding: .27rem .55rem; background: var(--accent); color: var(--success); font-weight: 720; border-radius: 100px; white-space: nowrap; }

.workbench { padding: clamp(.75rem, 2vw, 1.1rem); background: #fff; border: 1px solid var(--line); border-radius: 1.4rem; box-shadow: 0 14px 34px #3223560c, 0 2px 5px #32235608; }
.drop { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; padding: 1.35rem .8rem 1.3rem; border: 1px dashed #aca0cb; border-radius: .86rem; background: #f4f0fc; transition: background-color 150ms, border-color 150ms; }
.drop.is-over { background: #eae0ff; border-color: var(--brand); }
.drop-title { max-width: 100%; overflow-wrap: anywhere; margin: .8rem 0 0; font-size: 1.22rem; line-height: 1.35; font-weight: 730; letter-spacing: -.023em; }
.drop-detail { margin: .22rem 0 .92rem; font-size: .9rem; color: var(--muted); line-height: 1.45; font-variant-numeric: tabular-nums; }
.wave { display: flex; justify-content: center; align-items: center; gap: 4px; height: 2.7rem; }
.wave i { width: 3px; height: .58rem; border-radius: 1rem; background: #9a84cd; transition: background-color 140ms; }
.wave i:is(:nth-child(2), :nth-child(6), :nth-child(11), :nth-child(14)) { height: .95rem; }
.wave i:is(:nth-child(3), :nth-child(9), :nth-child(12)) { height: 1.45rem; }
.wave i:is(:nth-child(4), :nth-child(7), :nth-child(10)) { height: 1.95rem; }
.wave i:nth-child(8) { height: 2.68rem; }
.wave i:is(:nth-child(4), :nth-child(7), :nth-child(8), :nth-child(10)) { background: #7253bb; }
.wave.is-uploading i { background: #c7badf; }
.wave.is-uploading i.is-filled { background: var(--brand); }

.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: .4rem; padding: .57rem .95rem; border: 1px solid transparent; border-radius: .62rem; font-size: .9rem; font-weight: 700; line-height: 1.25; transition: background-color 140ms, border-color 140ms, color 140ms; }
.button-primary { background: var(--brand); color: #fff; }
.button-primary:not(:disabled):hover { background: var(--brand-dark); }
.button-outline { color: var(--brand-dark); border-color: #c9bfdf; background: #fff; }
.button-outline:hover { background: #f4f0fc; border-color: var(--brand); }
.button:disabled { background: #eae5f1; color: #5b556c; cursor: default; }
.button[data-copied] { background: var(--accent); color: var(--success); border-color: #a9d988; }
.actions { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; padding: .9rem .12rem .12rem; }
.language { display: grid; gap: .3rem; min-width: 0; width: min(100%, 16rem); }
.language label { color: var(--muted); font-size: .875rem; font-weight: 650; }
.language select { width: 100%; min-height: 44px; padding: .5rem 2rem .5rem .75rem; border: 1px solid #c9bfdf; border-radius: .62rem; background: #fff; color: var(--ink); }
.status { margin: .8rem .1rem .05rem; padding: .63rem .72rem; border-left: 3px solid #a596c6; background: #f6f3fb; color: var(--muted); font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; border-radius: 0 .4rem .4rem 0; }
.status[data-tone='error'] { background: #fff1f4; border-color: var(--error); color: var(--error); }
.progress-strip { padding: .6rem 0 0; }
progress { display: block; width: 100%; height: .45rem; border: 0; border-radius: 1rem; overflow: hidden; accent-color: var(--brand); }

.result { margin-top: 1.1rem; padding: 1.1rem .12rem .15rem; border-top: 1px solid var(--line); animation: settle 180ms ease-out both; }
@keyframes settle { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.result-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem 1rem; flex-wrap: wrap; }
.result-header h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.04em; }
.result-header p { margin: .2rem 0; color: var(--success); font-size: .875rem; }
.exports { display: flex; flex-wrap: wrap; gap: .45rem; }
.timestamps { display: inline-flex; align-items: center; gap: .44rem; min-height: 44px; margin-top: .35rem; font-size: .9rem; font-weight: 620; cursor: pointer; }
.timestamps input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--brand); }
.segments { margin: 0; padding: 0; list-style: none; }
.segments li { display: grid; grid-template-columns: minmax(9rem, max-content) minmax(0, 1fr); gap: .75rem; align-items: start; padding: .62rem 0; border-top: 1px solid #eae6f1; }
.segments p, .plain { margin: 0; line-height: 1.62; overflow-wrap: anywhere; white-space: pre-wrap; }
.time { justify-self: start; padding: .22rem .48rem; border-radius: .3rem; color: var(--brand-dark); background: #f0ebfa; font: 650 .82rem/1.4 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }

.guide { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem clamp(2rem, 7vw, 5.25rem); border-top: 1px solid var(--line); padding-block: 2rem; }
.guide h2, .faq h2 { margin: 0 0 .9rem; font-size: clamp(1.3rem, 4vw, 1.65rem); letter-spacing: -.04em; line-height: 1.2; }
.steps { margin: 0; padding-left: 1.25rem; color: var(--muted); line-height: 1.65; }
.steps li { padding-left: .2rem; margin: .37rem 0; max-width: 55ch; }
.steps li::marker { color: var(--brand); font-weight: 730; font-variant-numeric: tabular-nums; }
.limits { margin: 0; }
.limits div { margin-bottom: .64rem; }
.limits dt { font-weight: 680; }
.limits dd { margin: .14rem 0 0; color: var(--muted); line-height: 1.55; }
.faq { border-top: 1px solid var(--line); padding-block: 2rem clamp(3rem, 8vw, 5.5rem); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding-block: .8rem; min-height: 44px; font-weight: 680; }
.faq summary::marker { color: var(--brand); }
.faq details p { margin: 0 0 1rem; max-width: 65ch; color: var(--muted); line-height: 1.62; }

@media (max-width: 38rem) {
  .shell { width: calc(100% - 2rem); }
  .topbar-inner { min-height: 3.6rem; }
  .tool-intro > p { max-width: 28ch; }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .segments li { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .actions { flex-wrap: wrap; }
  .language, .submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
