:root {
  --bg: #f4f6f8; --surface: #ffffff; --ink: #14202b; --muted: #5b6b7a; --line: #dfe5eb;
  --brand: #0f766e; --brand-ink: #ffffff; --brand-soft: #e3f3f1; --danger: #b42318;
  --ok: #067647; --ok-soft: #e7f6ee; --wait: #8a5a00; --wait-soft: #fdf3dc;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1418; --surface: #151d23; --ink: #e6edf2; --muted: #95a4b1; --line: #26323b;
    --brand: #2bb3a5; --brand-ink: #062521; --brand-soft: #123532; --danger: #ff8a7a;
    --ok: #4ad295; --ok-soft: #10301f; --wait: #f5c46b; --wait-soft: #33280f;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[hidden] { display: none !important; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 0 0 1rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; }
.brand b { color: var(--brand); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.who { color: var(--muted); font-size: .9rem; }

main { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.narrow { max-width: 420px; margin: 6vh auto 0; }

form { display: grid; gap: 14px; margin-top: 12px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
input:focus, textarea:focus, button:focus-visible, .drop:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
input[type="checkbox"] { width: 18px; height: 18px; }

button { font: inherit; cursor: pointer; border-radius: 10px; padding: 10px 16px; border: 1px solid transparent; }
button:disabled { opacity: .55; cursor: progress; }
.primary { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn-link { display: inline-block; text-decoration: none; padding: 9px 14px; border-radius: 10px; color: var(--brand-ink); }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); padding: 7px 12px; }
.danger { background: transparent; color: var(--danger); border-color: var(--line); padding: 6px 10px; }
.error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: .9rem; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }

.steps { margin: 0 0 4px; padding-left: 20px; color: var(--muted); }
.drop {
  position: relative; border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 26px 16px; text-align: center; background: var(--bg); cursor: pointer;
}
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop p { margin: 2px 0; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }

.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.list-head h2 { margin: 0; }
.videos { display: grid; gap: 14px; }
.video { display: grid; gap: 14px; grid-template-columns: 200px 1fr; }
.video video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 10px; }
.video .placeholder {
  aspect-ratio: 9 / 16; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; padding: 10px;
}
.video .meta { display: grid; gap: 10px; align-content: start; min-width: 0; }
.video .line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.video pre {
  margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .9rem;
  background: var(--bg); border-radius: 10px; padding: 10px 12px;
}
.video a { color: var(--brand); word-break: break-all; }
.video a.btn-link { color: var(--brand-ink); word-break: normal; font-weight: 700; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.wait { background: var(--wait-soft); color: var(--wait); }
.badge.bad { background: transparent; color: var(--danger); border: 1px solid var(--line); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.integ p { min-height: 3em; }

.row-form { grid-template-columns: 1fr 1fr auto auto; align-items: end; }
.row-form .error { grid-column: 1 / -1; }
.users { width: 100%; border-collapse: collapse; }
.users th, .users td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.users td:last-child { text-align: right; }

@media (max-width: 640px) {
  .video { grid-template-columns: 1fr; }
  .video video, .video .placeholder { max-width: 260px; }
  .row-form { grid-template-columns: 1fr; }
  .brand span { font-size: .92rem; }
  .who { display: none; }
}
