:root { --warn: #d97706; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --warn: #fbbf24; }
}
:root[data-theme="dark"] { --warn: #fbbf24; }

.img-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 32px;
}
@media (max-width: 820px) {
  .img-layout { grid-template-columns: minmax(0, 1fr); }
}

.settings {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 16px;
}
@media (max-width: 820px) {
  .settings { position: static; }
  .work { order: -1; }
}
.size-row { grid-template-columns: 1fr 1fr; }
.privacy {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.color-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.color-input input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0;
  background: none;
  cursor: pointer;
  flex: none;
}
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.color-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }
.color-input code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Filliste */
.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}
.list-head > span { color: var(--muted); font-size: 0.9rem; }
.list-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.file {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: contain;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--border) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}
.thumb.blank { display: block; }
.info { min-width: 0; }
.name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.details {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.smaller { color: var(--accent); }
.bigger { color: var(--warn); }
.file .err { color: var(--danger); font-family: var(--font); font-size: 0.82rem; }
.file-actions { display: flex; gap: 6px; }
.file-actions .btn { padding: 8px 12px; }
.icon-btn.small { width: 36px; height: 36px; }

@media (max-width: 480px) {
  .file { grid-template-columns: 52px minmax(0, 1fr); }
  .thumb { width: 52px; height: 52px; }
  .file-actions { grid-column: 1 / -1; }
  .file-actions .btn { flex: 1; }
}
