﻿:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #0f7b6c;
  --accent-strong: #0a5f53;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.sectionTitle,
.actions,
.copyRow,
.imageInfo {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.topbar p,
.actions span,
.imageInfo span,
.empty {
  color: var(--muted);
}

.button,
button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 10px 14px;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button.muted,
.sectionTitle button,
.copyRow button,
.imageCard button {
  background: #e8eef2;
  color: var(--text);
}

.uploadPanel,
.result,
.gallery {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 170px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.dropzone.active {
  border-color: var(--accent);
  background: #eef8f6;
}

.dropzone input {
  display: none;
}

.actions {
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

progress {
  width: 100%;
  height: 10px;
  margin-top: 14px;
  accent-color: var(--accent);
}

.result {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
}

.result[hidden] {
  display: none;
}

.result img,
.imageCard img {
  width: 100%;
  object-fit: cover;
  background: #eef1f5;
}

.result img {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
}

.links {
  display: grid;
  gap: 10px;
}

.links label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.copyRow {
  flex-wrap: wrap;
  gap: 10px;
}

.sectionTitle {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.imageCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.imageCard img {
  aspect-ratio: 1;
}

.imageInfo {
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.imageInfo strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.imageCard button {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .topbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .result {
    grid-template-columns: 1fr;
  }
}
