:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #162033;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #3454d1;
  --accent-dark: #253eb0;
  --success: #067647;
  --warning: #b54708;
  --info: #175cd3;
  --shadow: 0 18px 50px rgba(22, 32, 51, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #eef2ff, transparent 36%), var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 8px;
}

h1, h2, p { margin-top: 0; }

h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin-bottom: 14px;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.lede {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.privacy {
  white-space: nowrap;
  padding: 12px 16px;
  background: #ecfdf3;
  color: var(--success);
  border: 1px solid #abefc6;
  border-radius: 999px;
  font-weight: 700;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  border: 2px dashed #b7c2d8;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  transition: 0.18s ease;
  overflow: hidden;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #eef2ff;
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-content {
  text-align: center;
  padding: 36px;
  pointer-events: none;
}

.icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: #eef2ff;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 900;
}

.drop-content p, .drop-content small { color: var(--muted); }

.controls {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1fr 1.1fr 1.15fr;
  gap: 16px;
  margin-top: 18px;
}

.control-card,
.preview,
.files {
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.control-card label {
  display: block;
  font-weight: 800;
  margin-bottom: 12px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slider-row input { width: 100%; }

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 800;
  transition: 0.15s ease;
}

button:hover:not(:disabled) { transform: translateY(-1px); }

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

.presets button, .secondary, .ghost {
  background: #f2f4f7;
  color: var(--text);
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:hover:not(:disabled) { background: var(--accent-dark); }

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
}

.control-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.toggle {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: 16px;
  background: #eff8ff;
  border: 1px solid #b2ddff;
  cursor: pointer;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.toggle span {
  color: var(--info);
}

.preview,
.files {
  margin-top: 18px;
}

.preview-header,
.files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.preview-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.image-frame {
  height: 340px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(-45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f2f4f7 75%),
    linear-gradient(-45deg, transparent 75%, #f2f4f7 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.image-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
}

.stats span { color: var(--muted); }

.saving-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f9fafb;
  border: 1px solid var(--line);
  font-weight: 800;
  line-height: 1.45;
}

.saving-box.good {
  background: #ecfdf3;
  border-color: #abefc6;
  color: var(--success);
}

.saving-box.bad {
  background: #fffaeb;
  border-color: #fedf89;
  color: var(--warning);
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.file-name {
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 3px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f2f4f7;
  font-weight: 850;
  white-space: nowrap;
}

.badge.good {
  color: var(--success);
  background: #ecfdf3;
}

.badge.bad {
  color: var(--warning);
  background: #fffaeb;
}

.download {
  background: #101828;
  color: white;
}

.hidden { display: none; }
.visually-hidden { position: absolute; left: -9999px; }

@media (max-width: 1180px) {
  .controls { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 850px) {
  .hero, .preview-header { align-items: flex-start; flex-direction: column; }
  .privacy { white-space: normal; }
  .controls, .preview-grid { grid-template-columns: 1fr; }
  .image-frame { height: 250px; }
  .file-row { grid-template-columns: 1fr; }
}


.control-card.disabled {
  opacity: 0.72;
}

.control-card.disabled input[type="range"] {
  cursor: not-allowed;
}


/* v5.4: Favicon erstatter maks bredde/højde, så layoutet holder 5 kolonner. */
