/* Ciuchatek 3.89 — kontrolowany import zdjęć ze starego programu. */
.old-photo-repair-backdrop {
  z-index: 11800;
  padding: 18px;
}

.old-photo-repair-modal {
  width: min(920px, calc(100vw - 36px));
  max-height: min(90vh, 900px);
  overflow: auto;
}

.old-photo-repair-path {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  align-items: center;
  gap: 5px 12px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #b9d4f7;
  border-radius: 12px;
  background: #f1f7ff;
}

.old-photo-repair-path span,
.old-photo-repair-path small {
  color: var(--text-muted, #64748b);
}

.old-photo-repair-path code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #0b4ca3;
  font-weight: 850;
}

.old-photo-repair-path small {
  grid-column: 2;
}

.old-photo-repair-loading,
.old-photo-repair-empty,
.old-photo-repair-warning,
.old-photo-repair-note,
.old-photo-repair-result {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 11px;
}

.old-photo-repair-loading,
.old-photo-repair-empty {
  border: 1px dashed #9db9dc;
  color: #46617f;
  text-align: center;
}

.old-photo-repair-warning {
  border: 1px solid #f0b966;
  background: #fff8e8;
  color: #7a4b04;
}

.old-photo-repair-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.old-photo-repair-summary > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2px 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-color, #d5e1ef);
  border-radius: 12px;
  background: var(--surface-soft, #f8fbff);
}

.old-photo-repair-summary > div.is-primary {
  border-color: #69a4ef;
  background: #eaf4ff;
  box-shadow: inset 4px 0 0 #1262d3;
}

.old-photo-repair-summary span {
  min-width: 0;
  color: var(--text-muted, #64748b);
  font-size: .78rem;
  font-weight: 760;
}

.old-photo-repair-summary strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--text-color, #16243b);
  font-size: 1.65rem;
  line-height: 1;
}

.old-photo-repair-summary small {
  color: var(--text-color, #334155);
  font-weight: 750;
}

.old-photo-repair-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border: 1px solid #d5e1ef;
  background: #f8fafc;
  color: #52647b;
  font-size: .84rem;
}

.old-photo-repair-result {
  display: grid;
  gap: 3px;
  border: 1px solid #84cfaa;
  background: #ecfdf5;
  color: #16613d;
}

.old-photo-repair-result.has-errors {
  border-color: #f0b966;
  background: #fff8e8;
  color: #7a4b04;
}

.old-photo-repair-list-wrap {
  max-height: 300px;
  overflow: auto;
  margin: 12px 0;
  border: 1px solid var(--border-color, #d5e1ef);
  border-radius: 12px;
}

.old-photo-repair-list {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.old-photo-repair-list th,
.old-photo-repair-list td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  text-align: left;
}

.old-photo-repair-list th:nth-child(2),
.old-photo-repair-list td:nth-child(2) {
  width: 110px;
}

.old-photo-repair-list th:nth-child(3),
.old-photo-repair-list td:nth-child(3) {
  width: 90px;
  text-align: center;
}

.old-photo-repair-list td:first-child {
  display: flex;
  gap: 9px;
  min-width: 0;
}

.old-photo-repair-list td:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.old-photo-repair-actions {
  position: sticky;
  bottom: -1px;
  margin-top: 14px;
  padding-top: 12px;
  background: var(--surface, #fff);
}

:root[data-theme="dark"] .old-photo-repair-path,
:root[data-theme="dark"] .old-photo-repair-summary > div.is-primary {
  border-color: #35699f;
  background: #132d4c;
}

:root[data-theme="dark"] .old-photo-repair-path code,
:root[data-theme="dark"] .old-photo-repair-summary > div.is-primary strong {
  color: #bfdbfe;
}

:root[data-theme="dark"] .old-photo-repair-note,
:root[data-theme="dark"] .old-photo-repair-summary > div {
  border-color: #3f526a;
  background: #142033;
}

@media (max-width: 720px) {
  .old-photo-repair-backdrop {
    padding: 8px;
  }

  .old-photo-repair-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .old-photo-repair-path {
    grid-template-columns: 1fr;
  }

  .old-photo-repair-path small {
    grid-column: 1;
  }

  .old-photo-repair-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .old-photo-repair-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .old-photo-repair-actions button:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .old-photo-repair-summary {
    grid-template-columns: 1fr;
  }

  .old-photo-repair-list th:nth-child(2),
  .old-photo-repair-list td:nth-child(2) {
    width: 76px;
  }

  .old-photo-repair-list th:nth-child(3),
  .old-photo-repair-list td:nth-child(3) {
    width: 62px;
  }
}
