/* okoptyk sync — поверх Pico CSS */
:root { --ok-ready: #2e7d32; --ok-warn: #b26a00; --ok-bad: #c62828; }
.topbar { border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1rem; }
.topbar .brand { font-weight: 700; }
form.inline { display: inline; margin: 0; }
button.small { padding: .25rem .6rem; font-size: .85rem; margin: 0; }
.login-card { max-width: 24rem; margin: 3rem auto; }
.error { color: var(--ok-bad); }
.ok { color: var(--ok-ready); }
.banner { background: #fff3cd; color: #664d03; padding: .6rem 1rem; text-align: center; border-bottom: 1px solid #ffe69c; }

/* список позиций */
.list-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.counter { font-weight: 600; }
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; }
.filter-row select { margin-bottom: .5rem; }
.muted { color: var(--pico-muted-color); font-size: .9rem; }
table.products td.thumb { width: 72px; }
table.products img, .no-thumb { width: 64px; height: 64px; object-fit: contain; display: block; }
.no-thumb { background: var(--pico-muted-border-color); font-size: .65rem; line-height: 64px; text-align: center; color: var(--pico-muted-color); border-radius: 4px; }
.status { font-size: .8rem; padding: .1rem .45rem; border-radius: 1rem; background: var(--pico-muted-border-color); white-space: nowrap; }
.status-ready { background: #d6f5d6; color: var(--ok-ready); }
.status-no_photo { background: #fff3cd; color: var(--ok-warn); }
.status-archived, .status-hidden { background: #eee; color: #777; }
.pager { display: flex; gap: 1rem; justify-content: center; align-items: center; }
@media (max-width: 767px) {
  table.products thead { display: none; }
  table.products, table.products tbody { display: block; }
  table.products tr { display: grid; grid-template-columns: 72px 1fr; gap: 0 .75rem; padding: .5rem 0;
                      border-bottom: 1px solid var(--pico-muted-border-color); }
  table.products td { border: 0; padding: 0; }
  table.products td.thumb { grid-row: span 5; }
  table.products td.name { font-weight: 600; }
}

/* карточка позиции */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 992px) { .card-grid { grid-template-columns: 1.1fr 1fr; } }
.photo-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.photo-grid li { list-style: none; border: 1px solid var(--pico-muted-border-color); border-radius: 6px; padding: .4rem; background: #fff; cursor: grab; }
.photo-grid li.empty { cursor: default; color: var(--pico-muted-color); }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.photo-state { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .8rem; color: var(--pico-muted-color); }
.photo-actions { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.upload { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.button-like { display: inline-block; padding: .6rem 1rem; border-radius: var(--pico-border-radius); background: var(--pico-primary-background); color: var(--pico-primary-inverse); cursor: pointer; margin: 0; }
.button-like.secondary { background: var(--pico-secondary-background); }
.button-like.small { padding: .25rem .6rem; font-size: .85rem; }
table.armo th { width: 35%; font-weight: 600; }
.crop-area { max-height: 70vh; }
.crop-area img { max-width: 100%; display: block; }
#crop-dialog article { max-width: 900px; width: 95vw; }
model-viewer { width: 100%; height: 320px; background: #f6f6f6; border-radius: 6px; }
.model3d-steps li { margin-bottom: .6rem; }
.model3d-steps .upload { margin-top: 0; align-items: center; }
#model3d-prompt { font-size: .8rem; }

/* пакетная загрузка */
table.batch td.thumb img { width: 80px; height: 80px; object-fit: contain; }
.dropzone { border: 2px dashed var(--pico-muted-border-color); padding: 1.5rem; border-radius: 8px; }

/* журнал и настройки */
.run { font-size: .8rem; padding: .1rem .45rem; border-radius: 1rem; background: var(--pico-muted-border-color); }
.run-ok { background: #d6f5d6; color: var(--ok-ready); }
.run-error, .run-interrupted { background: #fbe0e0; color: var(--ok-bad); }
.run-skipped { background: #eee; color: #777; }
.tabs { margin-bottom: 1rem; }
.inline-details { display: inline-block; margin: 0 0 0 .5rem; }

/* шапка на телефоне: пункты переносятся, без горизонтальной прокрутки */
@media (max-width: 767px) {
  .topbar nav { flex-wrap: wrap; }
  .topbar nav ul { flex-wrap: wrap; margin: 0; }
  .topbar nav li { padding: .3rem .45rem; font-size: .9rem; }
}
nav.tabs { display: block; }
.flash { position: sticky; top: 0; z-index: 50; background: #fbe0e0; color: #8a1c1c; padding: .6rem 1rem; text-align: center; }

/* примерка (тест) */
.tryon-controls { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.tryon-controls button { margin: 0; }
.tryon-stage { position: relative; max-width: 960px; background: #000; border-radius: 6px; overflow: hidden; }
.tryon-stage video, .tryon-stage img { display: block; width: 100%; height: auto; }
.tryon-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* селфи как в зеркале: видео и очки отражаются вместе */
.tryon-stage.mirrored video, .tryon-stage.mirrored canvas { transform: scaleX(-1); }
