.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem; margin-bottom: 1.25rem; }
.label { font-weight: 600; }
.hint { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field .hint { margin: 0; }
.row { display: flex; gap: .5rem; align-items: center; }
.row input, .row select { flex: 1; min-width: 0; }

.controls { display: grid; gap: 1.5rem; grid-template-columns: 19rem minmax(0, 1fr); }
@media (max-width: 52rem) { .controls { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: .4rem; }
.fields { gap: 1rem; }
.two { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 36rem) { .two { grid-template-columns: 1fr; } }

.controls input[type="text"], .controls input[type="password"], .controls textarea, .controls select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem;
}
.controls textarea { resize: vertical; }
.controls input:focus, .controls textarea:focus, .controls select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }

.drop {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 16 / 9; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer;
  color: var(--muted); background: var(--bg); overflow: hidden;
}
.drop:hover, .drop.over { border-color: var(--accent); color: var(--ink); }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop small { color: var(--muted); }

.btn { font: inherit; font-weight: 600; cursor: pointer; padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.small { padding: .4rem .8rem; font-size: .9rem; border-radius: 10px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.check { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.check input { accent-color: var(--accent); }
.key summary { cursor: pointer; font-weight: 600; }
.key[open] summary { margin-bottom: .25rem; }
.steps { margin: .75rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .9rem; display: grid; gap: .35rem; }
.steps a { color: var(--accent); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.msg { margin: 0; color: var(--muted); font-size: .95rem; min-height: 1.4em; }
.msg.error { color: #d6455d; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.seg button { font: inherit; font-size: .9rem; padding: .35rem .9rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---- YouTube-style grid ---- */
.yt { --yt-bg: #0f0f0f; --yt-text: #f1f1f1; --yt-sub: #aaaaaa; --yt-skel: #272727; --yt-skel2: #3a3a3a;
  font-family: Roboto, Arial, sans-serif; background: var(--yt-bg); color: var(--yt-text); border-radius: 14px; padding: 1.5rem; }
.yt.light { --yt-bg: #ffffff; --yt-text: #0f0f0f; --yt-sub: #606060; --yt-skel: #f0f0f0; --yt-skel2: #e2e2e2; }
.vgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.4rem 1rem; }
@media (max-width: 52rem) { .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 32rem) { .vgrid { grid-template-columns: 1fr; } }

.vid { min-width: 0; border-radius: 14px; }
.vid.mine.hl { outline: 2px solid #3ea6ff; outline-offset: 6px; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--yt-skel); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--yt-sub); font-size: 14px; text-align: center; border: 2px dashed var(--yt-skel2); }
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .8); color: #fff; font-size: 12px; font-weight: 500; line-height: 1; padding: 3px 4px; border-radius: 4px; }
.meta { display: flex; gap: 12px; margin-top: 12px; }
.av { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--yt-skel2); object-fit: cover; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 500; font-size: 16px; }
.txt { min-width: 0; }
.t { font-size: 16px; line-height: 22px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.t.ph { color: var(--yt-sub); }
.ch, .st { font-size: 14px; line-height: 20px; color: var(--yt-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch { margin-top: 4px; }

.skel .thumb, .skel .av, .skel .bar1, .skel .bar2 { background: var(--yt-skel); }
.skel .bar1, .skel .bar2 { height: 14px; border-radius: 7px; margin-top: 6px; }
.skel .bar1 { width: 90%; height: 16px; } .skel .bar2 { width: 55%; }
.loading .skel .thumb, .loading .skel .av, .loading .skel .bar1, .loading .skel .bar2 {
  background: linear-gradient(90deg, var(--yt-skel) 25%, var(--yt-skel2) 50%, var(--yt-skel) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .loading .skel * { animation: none !important; } }

.src-box { display: flex; flex-direction: column; gap: 12px; }
.src-box .row { flex-wrap: wrap; }
.src-box .row select { flex: 1; min-width: 140px; }
#source { display: flex; }
#source button { flex: 1; }
.st:empty { display: none; }
