* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.container { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }

h1 { font-size: 24px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 16px; color: #555; }
a { color: #1a1a1a; }

/* Кнопки */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  background: #1a1a1a;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #333; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-secondary {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ddd;
}
.btn-secondary:hover { background: #f5f5f5; }

/* Шапка сайта */
.site-header { border-bottom: 1px solid #ddd; padding: 14px 16px; }
.brand { font-size: 20px; font-weight: 700; text-decoration: none; letter-spacing: .02em; }

/* Кнопки сверху */
.top-actions { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.responsible { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.responsible input { width: 20px; height: 20px; accent-color: #1a1a1a; }
.bar-actions { display: flex; gap: 8px; align-items: center; }

/* Полноэкранный просмотр фото */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  cursor: pointer;
  padding: 16px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; border-radius: 12px; }
.photo-row img, .view-card img { cursor: zoom-in; }

/* Порядковый номер фото на странице выпуска */
.photo-num {
  font-size: 20px;
  font-weight: 600;
  color: #999;
  min-width: 28px;
  text-align: center;
  padding-top: 72px;
  flex-shrink: 0;
}

/* Поиск (демо, пока не работает) */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: none;
  justify-content: center;
  padding-top: 22vh;
  z-index: 100;
}
.search-overlay.open { display: flex; }
.search-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 20px;
  width: min(480px, 90vw);
}
.search-box input {
  width: 100%;
  padding: 12px;
  font: inherit;
  border: 1px solid #ddd;
  border-radius: 12px;
  outline: none;
}
.search-box input:focus { border-color: #999; }
.search-box .hint { margin: 8px 0 0; }

/* Логин: одно поле посередине экрана */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-wrap input {
  width: min(320px, 90vw);
  padding: 14px 16px;
  font-size: 18px;
  border: 1px solid #ccc;
  border-radius: 12px;
  outline: none;
  text-align: center;
}
.login-wrap input:focus { border-color: #999; }
.login-wrap input.input-error { border-color: #c0392b; }

/* Поля формы */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 6px; color: #555; }
.field input {
  width: 100%;
  padding: 12px;
  font: inherit;
  border: 1px solid #ddd;
  border-radius: 12px;
  outline: none;
}
.field input:focus { border-color: #999; }

/* Дропбокс */
.dropzone {
  border: 2px dashed #ccc;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  color: #777;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: #999;
  background: #fafafa;
}
.dropzone input { display: none; }

.counter { margin: 12px 0; color: #777; font-size: 14px; }
.error {
  border: 1px solid #e0b4b4;
  background: #fdf2f2;
  color: #8a1f1f;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

/* Превью на странице загрузки */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.preview { position: relative; border: 1px solid #ddd; border-radius: 12px; overflow: hidden; }
.preview img { width: 100%; height: 120px; object-fit: cover; display: block; }
.preview .remove {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.9);
  font-size: 14px; line-height: 1; cursor: pointer;
}

/* Выбор галочками */
.select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}
.select-card { position: relative; border: 1px solid #ddd; border-radius: 12px; overflow: hidden; cursor: pointer; }
.select-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.select-card input { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; accent-color: #1a1a1a; cursor: pointer; }
.select-card:has(input:checked) { border-color: #1a1a1a; box-shadow: 0 0 0 1px #1a1a1a; }

/* Счётчик выбранных фото */
.selected-count { margin: 0 0 4px; color: #777; font-size: 14px; }

/* Копируемый ID фото */
.copy-id { cursor: pointer; border-bottom: 1px dashed #999; }
.copy-id:hover { color: #1a1a1a; }

/* Описание */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
}
.sticky-bar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sticky-bar h1 { margin: 0; font-size: 20px; }

.photo-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.photo-row img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}
.photo-row textarea {
  flex: 1;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}
.photo-row textarea:focus { outline: none; border-color: #999; }

.hint { font-size: 14px; color: #888; }

/* Список съёмок */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 { margin: 0; }
.page-head div { display: flex; gap: 8px; flex-wrap: wrap; }

.shoot-list { list-style: none; margin: 0; padding: 0; }
.shoot-list li {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.shoot-list li.highlight {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 1px #1a1a1a;
  background: #fafafa;
}
.shoot-name { font-size: 18px; font-weight: 600; text-decoration: none; }
.shoot-name:hover { text-decoration: underline; }
.meta { display: block; color: #777; font-size: 14px; margin-top: 4px; }

/* Просмотр съёмки */
.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}
.view-card { border: 1px solid #ddd; border-radius: 12px; overflow: hidden; padding-bottom: 12px; }
.view-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.view-name { padding: 10px 12px 0; font-weight: 600; word-break: break-all; }
.view-id { padding: 2px 12px 0; font-size: 13px; color: #777; font-family: monospace; }
.badge {
  display: inline-block;
  margin: 8px 0 0 12px;
  padding: 2px 10px;
  border: 1px solid #1a1a1a;
  border-radius: 999px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .photo-row { flex-direction: column; }
  .photo-row img { width: 100%; height: 200px; }
  .photo-row textarea { width: 100%; min-height: 120px; }
}
