* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #16181d; background: #fff; line-height: 1.6; }
a { color: #c00; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.topbar { border-bottom: 1px solid #eee; background: #fff; position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 800; font-size: 19px; color: #16181d; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: #e62117; color: #fff; font-size: 13px; }
.menu a { color: #555; text-decoration: none; margin-left: 20px; font-size: 15px; }
.menu a:hover { color: #c00; }

/* Hero */
.hero { text-align: center; padding: 44px 0 28px; }
.eyebrow { color: #c00; font-weight: 700; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; }
.lead { font-size: 18px; color: #444; max-width: 620px; margin: 0 auto 22px; }
#fetch-form { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }
#url-input { flex: 1; min-width: 0; padding: 13px 15px; font-size: 16px; border: 2px solid #ddd; border-radius: 10px; outline: none; }
#url-input:focus { border-color: #e62117; }
#fetch-btn { padding: 13px 22px; font-size: 16px; font-weight: 700; color: #fff; background: #e62117; border: none; border-radius: 10px; cursor: pointer; white-space: nowrap; }
#fetch-btn:hover { background: #c00; }
#fetch-btn:disabled { opacity: .6; cursor: wait; }
.hint { color: #777; font-size: 14px; margin: 12px 0 4px; }
.examples { color: #777; font-size: 14px; margin: 0; }
.examples a { color: #c00; }

/* Status */
.error { max-width: 640px; margin: 0 auto 20px; padding: 13px 16px; background: #fdecea; border: 1px solid #f5c6c0; color: #8f1d12; border-radius: 10px; }
.loading { text-align: center; color: #555; padding: 18px 0; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #ddd; border-top-color: #e62117; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
#result { padding-bottom: 10px; }
#player-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
#player-wrap iframe, #player { position: absolute; inset: 0; width: 100%; height: 100%; }
.video-meta h2 { font-size: 21px; margin: 0 0 2px; line-height: 1.35; }
.video-meta p { color: #666; margin: 0 0 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.toggle input { accent-color: #e62117; width: 17px; height: 17px; }
#lang-select { padding: 8px 10px; font-size: 15px; border: 1px solid #ccc; border-radius: 8px; background: #fff; }
.toolbar button { padding: 9px 16px; font-size: 15px; font-weight: 600; border-radius: 8px; cursor: pointer; }
#copy-btn { background: #16181d; color: #fff; border: 1px solid #16181d; }
#download-btn { background: #fff; color: #16181d; border: 1px solid #bbb; }
#copy-btn:hover, #download-btn:hover { border-color: #e62117; color: #c00; }
#copy-btn:hover { background: #16181d; color: #fff; }

/* Transcript */
.transcript { background: #fafafa; border: 1px solid #eee; border-radius: 12px; padding: 20px 22px; font-size: 16.5px; line-height: 1.75; }
.transcript p { margin: 0 0 14px; }
.transcript p:last-child { margin-bottom: 0; }
.seg { cursor: pointer; border-radius: 4px; padding: 0 1px; }
.seg:hover { background: #ffe9e7; }
.ts { display: none; font-size: 12.5px; font-weight: 700; color: #c00; background: #fdecea; border-radius: 5px; padding: 1px 6px; margin-right: 5px; white-space: nowrap; }
body.show-ts .ts { display: inline-block; }

/* Info sections */
.section { padding: 26px 0 8px; }
.section h2 { font-size: 24px; margin: 0 0 12px; }
.section h3 { font-size: 17px; margin: 18px 0 4px; }
.section p { color: #444; margin: 0 0 10px; }
.steps { color: #444; padding-left: 22px; }
.steps li { margin-bottom: 8px; }
.note { background: #f6f6f6; border-left: 4px solid #e62117; padding: 12px 16px; border-radius: 0 8px 8px 0; }

/* Footer */
footer { border-top: 1px solid #eee; margin-top: 34px; padding: 22px 0 30px; }
.foot p { margin: 0 0 6px; }
.small { color: #888; font-size: 13px; }

@media (max-width: 600px) {
  h1 { font-size: 27px; }
  .lead { font-size: 16px; }
  #fetch-form { flex-direction: column; }
  #fetch-btn { width: 100%; }
  .menu a { margin-left: 14px; }
  .transcript { padding: 16px; font-size: 15.5px; }
}
