/* Video hujjatini tahrirlash sahifasi — EngOne ranglari. Oddiy, katta tugmalar, avtomatik saqlash. */
:root {
  --canvas: #f4f9f7; --surface: #fff; --surface-2: #e8f2ee; --ink: #1d3832; --muted: #4c645d; --faint: #7d918b;
  --line: #d6e5df; --primary: #0b6e5c; --primary-hover: #08584a; --primary-50: #e1f1eb; --on-primary: #fff;
  --sun: #ffc23d; --sun-50: #fff4d9; --edit: #fff7e0; --edit-line: #f0c75a; --err: #b42318;
  --r: 12px; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --canvas: #13201d; --surface: #1b2b27; --surface-2: #233732; --ink: #eaf4f0; --muted: #b3c6c0; --faint: #8da39c;
  --line: #33483f; --primary: #5fcfae; --primary-hover: #86dcc3; --primary-50: #1f3b33; --on-primary: #0b2a23;
  --sun-50: #3a3222; --edit: #33301f; --edit-line: #8c7330; --err: #ff8a80; color-scheme: dark; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand img { height: 34px; width: auto; display: block; }
:root .brand img { filter: none; }
@media (prefers-color-scheme: dark) { .brand img { filter: brightness(1.45); } }
.ttl { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ttl b { font-size: 17px; }
.ttl span { font-size: 13px; color: var(--muted); }
.prog { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.bar { width: 140px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.save { font-size: 14px; color: var(--muted); min-width: 150px; text-align: right; }
.save.err { color: var(--err); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-weight: 600; text-decoration: none; border: 0; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible, .tabs button:focus-visible, .row :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.wrap { display: grid; grid-template-columns: minmax(360px, 560px) minmax(0, 1fr); gap: 24px; padding: 20px; max-width: 1600px; margin: 0 auto; }
.player { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 12px; }
.player video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r); display: block; }
.now { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.now small { color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.now p { margin: 2px 0 0; font-size: 17px; }
.follow { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--muted); cursor: pointer; }
.follow input, .ok input { width: 20px; height: 20px; accent-color: var(--primary); }
.help { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px; font-size: 15px; }
.help summary { cursor: pointer; font-weight: 600; }
.help ol { padding-left: 20px; margin: 10px 0; }
.help p { margin: 0 0 4px; color: var(--muted); }

.tools { position: sticky; top: 62px; z-index: 10; display: flex; gap: 12px; align-items: center; padding: 8px 0 12px; background: var(--canvas); }
.tabs { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.tabs button { border: 0; background: none; padding: 0 14px; min-height: 42px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--muted); }
.tabs button + button { border-left: 1px solid var(--line); }
.tabs button.on { background: var(--primary-50); color: var(--ink); box-shadow: inset 0 -3px 0 var(--primary); }
.tabs button span { font-weight: 500; color: var(--faint); margin-left: 4px; }
#q { flex: 1; min-width: 0; min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

.row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.row.cur { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.row.done { background: color-mix(in srgb, var(--surface) 85%, var(--primary-50)); }
.shot { display: flex; flex-direction: column; gap: 6px; }
.shot button { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; overflow: hidden; position: relative; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--surface-2); }
.shot button::after { content: "▶"; position: absolute; inset: auto auto 8px 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; }
.shot button:hover img { opacity: .9; }
.meta { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.meta b { color: var(--ink); font-size: 15px; }
.meta .id { color: var(--faint); }
.fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fld label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.fld textarea { width: 100%; resize: none; overflow: hidden; field-sizing: content; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); line-height: 1.45; }
.fld textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); background: var(--surface); }
.fld.say textarea { font-size: 17px; }
.fld.changed textarea { background: var(--edit); border-color: var(--edit-line); }
.orig { font-size: 13px; color: var(--muted); margin-top: 4px; }
.orig s { color: var(--faint); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: underline; }
.foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ok { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 15px; }
.ok:has(input:checked) { background: var(--primary-50); border-color: var(--primary); color: var(--ink); }
.seg { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-height: 40px; padding: 0 14px; cursor: pointer; font-weight: 600; font-size: 15px; }
.seg:hover { border-color: var(--primary); }
.st { font-size: 13px; color: var(--faint); margin-left: auto; }
.st.err { color: var(--err); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

@media (max-width: 980px) {
  .wrap { grid-template-columns: 1fr; padding: 0 12px 20px; gap: 0; }
  .player { top: 58px; z-index: 15; background: var(--canvas); padding: 10px 0; margin: 0 -12px; padding-inline: 12px; }
  .player .now, .player .help, .player .follow { display: none; }
  .tools { position: static; flex-wrap: wrap; }
  .prog .bar { width: 70px; }
  .save { min-width: 0; }
  .row { grid-template-columns: 1fr; }
  .shot { flex-direction: row; align-items: center; }
  .shot button { width: 140px; flex: none; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .ttl span, .brand { display: none; }
  .prog { margin-left: 0; }
  .btn#docx { margin-left: auto; min-height: 38px; font-size: 14px; }
  .tabs { width: 100%; } .tabs button { flex: 1; padding: 0 6px; font-size: 14px; white-space: nowrap; }
  .tabs button span { display: none; }
}

/* oflayn paket: ism maydoni eksport tugmasi yonida */
.who { min-height: 42px; width: 150px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); }
.who:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.who.need { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 20%, transparent); }
@media (max-width: 640px) { .who { width: 120px; min-height: 38px; } }
