:root {
  --bg: #f3f1ec;
  --card: #ffffff;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #74716b;
  --line: #e0dcd3;
  --line-2: #cfcabf;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --accent-soft: #fff0e9;
  --ok: #1f8a4c;
  --err: #c2321d;
  --err-soft: #fdeeea;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .9em; background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: rgba(243,241,236,.9); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.top .row { height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 18px; letter-spacing: -.01em; }
.logo b { font-weight: 800; }
nav { display: flex; gap: 24px; }
nav a { text-decoration: none; font-size: 14px; color: var(--ink-2); }
nav a:hover { color: var(--ink); }

/* hero */
.hero { padding-top: 64px; padding-bottom: 24px; }
h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 14px; font-weight: 800; max-width: 760px; }
.lead { font-size: 18px; color: var(--ink-2); margin: 0 0 32px; }

/* form */
.urlform { display: flex; gap: 10px; }
.field {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: var(--radius);
  padding: 0 8px 0 16px; height: 58px; color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17,17,17,.06); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); height: 100%; }
.field input::placeholder { color: #a9a59d; }
.ghost { border: 0; background: transparent; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; font-size: 14px; }
.ghost:hover { background: var(--bg); color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: var(--card); cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2a2a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.urlform .btn { height: 58px; padding: 0 24px; border-radius: var(--radius); }
.btn.wide { width: 100%; height: 54px; font-size: 16px; }
.btn.primary.wide { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary.wide:hover { background: #ec4a10; }
.ghost-btn { border-color: transparent; background: transparent; color: var(--ink-2); }
.ghost-btn:hover { border-color: var(--line-2); }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* notices */
.notice, .error { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.notice { background: #fff7d6; border: 1px solid #f0dc8a; margin-bottom: 14px; color: #5b4a00; }
.notice svg { flex: none; margin-top: 2px; }
.error { margin-top: 12px; background: var(--err-soft); color: var(--err); border: 1px solid #f4cfc6; }
.error svg { flex: none; margin-top: 3px; }

/* panel */
.panel { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.video { display: flex; gap: 16px; align-items: center; }
.thumb { position: relative; width: 168px; aspect-ratio: 16/9; flex: none; border-radius: 10px; overflow: hidden; background: #ddd; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); color: #fff; font: 600 12px/1 var(--mono); padding: 4px 6px; border-radius: 5px; }
.meta { min-width: 0; }
.meta h2 { font-size: 17px; line-height: 1.35; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; letter-spacing: -.01em; }
.meta p { margin: 0; color: var(--muted); font-size: 14px; }

/* picker */
.picker { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.tabs { display: inline-flex; background: var(--bg); border-radius: 11px; padding: 4px; gap: 4px; }
.tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.tab.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.fmt { text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 11px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color .12s, background .12s; }
.fmt:hover { border-color: var(--line-2); }
.fmt.on { border-color: var(--accent); background: var(--accent-soft); }
.fmt-label { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.fmt-note { font-size: 12.5px; color: var(--muted); line-height: 1.3; }

.quality { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; font-weight: 600; }
.quality select { height: 40px; padding: 0 34px 0 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; font-weight: 500; cursor: pointer; min-width: 170px; }
.quality select:disabled { opacity: .6; cursor: default; }

.actions { margin-top: 18px; }

/* progress */
.progress { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.progress-top { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; position: relative; }
.bar > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.bar.indeterminate > div { position: absolute; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { left: -35%; } to { left: 100%; } }

/* done */
.done { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.done-info { display: flex; align-items: center; gap: 12px; }
.done-info strong { display: block; }
.ok { width: 34px; height: 34px; border-radius: 50%; background: #e3f4ea; color: var(--ok); display: grid; place-items: center; flex: none; }
.done-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.done-actions .btn.primary { background: var(--accent); border-color: var(--accent); }

/* recent */
.recent { margin-top: 28px; }
.recent-head { display: flex; justify-content: space-between; align-items: baseline; }
.recent h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; }
.recent ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.recent li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.recent li:first-child { border-top: 0; }
.badge { font: 700 11px/1 var(--mono); background: var(--ink); color: #fff; padding: 5px 7px; border-radius: 6px; flex: none; }
.r-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.r-size { flex: none; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-2); }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.hint { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 10px 2px 0; }

/* info sections */
.info { padding: 72px 0 0; }
.section-head { margin-bottom: 22px; }
.kicker { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.section-head h2 { font-size: 30px; letter-spacing: -.025em; margin: 8px 0 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
thead th { border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #faf9f6; }
td:first-child { font-weight: 700; }
td:nth-child(2), td:nth-child(3) { color: var(--ink-2); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.num { font: 700 13px/1 var(--mono); color: var(--accent); }
.steps h3 { margin: 14px 0 6px; font-size: 17px; letter-spacing: -.01em; }
.steps p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.faq { border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 22px/1 var(--mono); color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--ink-2); max-width: 680px; }

/* footer */
.foot { margin-top: 96px; border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; }
.foot b { font-weight: 800; }

/* mobile */
@media (max-width: 640px) {
  nav { display: none; }
  .hero { padding-top: 40px; }
  .lead { font-size: 16px; }
  .urlform { flex-direction: column; }
  .field { flex: none; height: 54px; }
  .urlform .btn { height: 52px; }
  .video { flex-direction: column; align-items: stretch; }
  .thumb { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .done-actions { width: 100%; }
  .done-actions .btn { flex: 1; }
  .pastebtn span { display: none; }
}

/* live stats */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.tile-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 0 rgba(31,138,76,.5); animation: pulse 1.8s ease-out infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,138,76,.45); } 80%, 100% { box-shadow: 0 0 0 7px rgba(31,138,76,0); } }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 18px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.chart-head h3 { margin: 0; font-size: 15px; }
.empty { color: var(--muted); font-size: 14px; margin: 24px 0; }

.tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; }
.tip b { font-weight: 700; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 170px; border-bottom: 1px solid var(--line); padding-bottom: 0; position: relative; }
.col { position: relative; display: flex; flex-direction: column; align-items: center; outline: none; cursor: default; }
.col-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.col-bar { width: min(28px, 70%); background: var(--accent); border-radius: 4px 4px 0 0; transition: height .4s ease; }
.col-label { position: absolute; top: calc(100% + 6px); font-size: 12px; color: var(--muted); }
.col-label.today { color: var(--ink); font-weight: 600; }
.col:hover .tip, .col:focus .tip { opacity: 1; }
.col:hover .col-bar, .col:focus .col-bar { background: #e04712; }
.chart-card:has(.week) { padding-bottom: 36px; }

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.hbars li { position: relative; display: grid; grid-template-columns: 48px 1fr 44px; align-items: center; gap: 10px; outline: none; }
.hb-label { font: 700 12px/1 var(--mono); }
.hb-track { height: 12px; display: block; }
.hb-bar { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; transition: width .4s ease; min-width: 2px; }
.hb-value { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hbars li:hover .tip, .hbars li:focus .tip { opacity: 1; }
.hbars li:hover .hb-bar { background: #e04712; }
.stats .hint { margin-top: 12px; }

@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
  .tile-value { font-size: 24px; }
}
.q-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); max-width: 640px; }
.q-note b { color: var(--ink); }
