/* Pack Creator */
.screen.cr { justify-content: flex-start; align-items: stretch; padding: 1.6rem 1.8rem 1rem; gap: .6rem; }
.cr-top { display: flex; align-items: center; gap: 1rem; flex: none; min-height: 3.9rem; padding-bottom: .4rem; }
.cr-top .cr-back svg { width: 1.9rem; height: 1.9rem; }
.cr-title { font-size: 2.1rem; white-space: nowrap; }
.cr-sub { color: var(--muted); font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cr-grow { flex: 1; }
.cr .btn.small { padding-left: 1.75rem; padding-right: 1.6rem; }
.cr .btn.sq, .cr-dialog .btn.sq { padding: .5rem .75rem; }
.cr .btn.sq svg { width: 1.35rem; height: 1.35rem; }

/* ---------- обзор ---------- */
.cr-overview #co-q { width: 17rem; }
.cr-overview #co-sort { width: 13rem; }
.cr-tabs { display: flex; gap: .8rem; flex: none; padding-bottom: .5rem; }
.cr-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.6rem 1.2rem; align-content: start; padding: .2rem .6rem 1rem .1rem;
}
.cr-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 7rem 0; font-size: 1.35rem; }
.cr-card { padding: .8rem; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.cr-card .cv {
  aspect-ratio: 16 / 9; border-radius: .7rem; overflow: hidden; background: var(--panel3); border: .2rem solid var(--line);
  position: relative; display: flex; align-items: center; justify-content: center;
}
.cr-card .cv[data-open] { cursor: pointer; }
.cr-card .cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-card .cv .ph { color: var(--muted); font-family: var(--head); text-transform: uppercase; font-size: 1.1rem; }
.cr-card .tag {
  position: absolute; left: .5rem; top: .5rem; background: var(--yellow); color: var(--ink); border: .15rem solid var(--line);
  border-radius: 99rem; font-family: var(--head); font-size: .85rem; padding: .1rem .7rem; text-transform: uppercase;
}
.cr-card .nm { font-family: var(--head); font-size: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .2rem; }
.cr-card .meta { color: var(--muted); font-size: .95rem; }
.cr-card .acts { display: flex; gap: .6rem; align-items: center; margin-top: .25rem; padding-bottom: .4rem; }

/* ---------- окна ---------- */
.modal.cr-dialog { width: 36rem; }
.modal.cr-dialog.wide { width: 50rem; }
.cr-dialog input[type=text], .cr-dialog select { width: 100%; }
.cr-dialog .cr-err { color: var(--red); font-size: .95rem; min-height: 1.3em; margin-top: -.45rem; }
.cr-dialog .cr-note { font-size: .95rem; }
.cr-dialog .btnrow { flex-wrap: nowrap; padding-bottom: .4rem; }
.cr-bar { height: 1.5rem; border-radius: 99rem; background: var(--track); border: .2rem solid var(--line); overflow: hidden; flex: none; }
.cr-bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99rem; transition: width .25s linear; }
.cr-bar.big { height: 1.9rem; }

/* ---------- загрузка и ожидание ---------- */
.cr-center { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.cr-box { width: 44rem; padding: 2rem 2.4rem 2.2rem; display: flex; flex-direction: column; gap: 1.1rem; text-align: center; }
.cr-box h2 { font-size: 2rem; }
.cr-box p { margin: 0; color: var(--muted); }
.cr-box .cr-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cr-box.drop { outline: .3rem dashed var(--yellow); outline-offset: .3rem; }
.cr-box .cr-warn { color: var(--red); }
.cr-box .btnrow { padding-bottom: .4rem; }

/* ---------- обрезка ---------- */
.cr-stage { flex: 1; min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; background: #1b1733; padding: .6rem; overflow: hidden; margin-bottom: .5rem; }
.cr-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: .5rem; display: block; cursor: pointer; }
.cr-trim .cr-stage video { cursor: default; }
.cr-sel { text-align: center; font-family: var(--head); font-size: 1.25rem; white-space: pre; flex: none; }
.cr-trimbar { height: 6.3rem; flex: none; position: relative; }
.cr-trimbar canvas { position: absolute; left: 0; top: 0; display: block; touch-action: none; }
.cr-status { color: var(--muted); font-size: 1rem; line-height: 1.4; height: 1.4em; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-status.warn { color: var(--yellow); }
.cr-trim .cr-status { text-align: center; }
.cr-trimbtns { padding-bottom: .5rem; flex: none; }

/* ---------- редактор ---------- */
.cr-editor #ce-name { width: 24rem; }
.cr-editor #ce-lang { width: 12.5rem; }
.cr-saved { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.cr-saved.bad { color: var(--red); }
.cr-expwrap { display: inline-flex; }
.cr-actions { display: flex; align-items: center; gap: .8rem; flex: none; min-height: 2.9rem; padding-bottom: .4rem; }
.cr-jobs { display: flex; gap: .5rem; margin-left: .4rem; min-width: 0; }
.cr-chip {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; line-height: 1.2; padding: .25rem .85rem; border-radius: 99rem;
  background: var(--panel2); border: .15rem solid var(--line); white-space: nowrap;
}
.cr-chip::before { content: ''; width: .65rem; height: .65rem; border-radius: 50%; background: var(--muted); flex: none; }
.cr-chip.run::before { background: var(--yellow); animation: blink 1s steps(2) infinite; }
.cr-chip.ok::before { background: var(--green); }
.cr-chip.bad::before { background: var(--red); }
.cr-nochar { color: var(--red); font-family: var(--head); font-size: 1.15rem; white-space: nowrap; }
.cr-mid { flex: 1; min-height: 0; display: flex; gap: 1rem; position: relative; z-index: 2; }
.cr-line { width: 30rem; flex: none; padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .65rem; min-height: 0; margin-bottom: .5rem; }
.cr-line h3 { font-size: 1.4rem; white-space: nowrap; }
.cr-line h3 small { color: var(--muted); font-size: 1rem; font-family: var(--body); text-transform: none; letter-spacing: 0; margin-left: .3rem; }
.cr-line textarea {
  flex: 1; min-height: 3.7rem; resize: none; font: inherit; font-size: 1.05rem; line-height: 1.3; color: var(--text); background: var(--panel3);
  border: .22rem solid var(--line); border-radius: .8rem; padding: .55rem .9rem; outline: none; user-select: text;
}
.cr-line textarea:focus { border-color: var(--blue); }
.cr-line textarea::placeholder { color: #7f76a3; }
.cr-line .chr { position: relative; flex: none; }
.cr-line .chr input { width: 100%; padding: .55rem .9rem; }
.cr-ac {
  position: absolute; left: 0; right: 0; top: calc(100% + .25rem); z-index: 10; background: var(--panel2); border: .2rem solid var(--line);
  border-radius: .8rem; box-shadow: 0 .3rem 0 var(--line); max-height: 13rem; overflow-y: auto;
}
.cr-ac div { padding: .35rem .9rem; cursor: pointer; display: flex; gap: .6rem; align-items: center; }
.cr-ac div:hover { background: var(--panel3); }
.cr-ac i { width: .9rem; height: .9rem; border-radius: 50%; border: .12rem solid var(--line); flex: none; }
.cr-line .row { display: flex; align-items: center; gap: .8rem; padding-bottom: .4rem; flex: none; }
.cr-line .none { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 0 2rem; }
.cr-tl {
  flex: none; height: 12.7rem; box-sizing: content-box; position: relative; background: #2a2438; border: .15rem solid var(--line); border-radius: .7rem; overflow: hidden;
}
.cr-tl canvas { position: absolute; left: 0; top: 0; display: block; }
.cr-tl canvas + canvas { touch-action: none; }
.cr-tl input.cr-tl-inp {
  position: absolute; z-index: 3; padding: 0 .45rem; border-radius: .35rem; border: .1rem solid #fff; font-family: var(--head); font-weight: 400;
  background: #1b1733; color: #fff; line-height: 1;
}
.cr-transport { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: .1rem 0 .4rem; }
.cr-transport .c { display: flex; gap: 1rem; align-items: center; }
.cr-hint { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cr-hint.r { text-align: right; }
.cr-clock { font-family: var(--head); font-size: 1.35rem; min-width: 10.5rem; white-space: nowrap; }

/* ---------- светлая тема ---------- */
:root[data-theme=light] .cr-stage { background: #14102a; }
:root[data-theme=light] .cr-status.warn { color: #c7362c; }
:root[data-theme=light] .cr-line textarea::placeholder { color: #a8a2b5; }
