:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --ink: #1d2329;
  --muted: #68717a;
  --panel: #ffffff;
  --line: #d8d2c6;
  --accent: #0f6f5c;
  --accent-dark: #0a4e43;
  --gold: #c49a3a;
  --rose: #a94755;
  --shadow: 0 18px 55px rgba(29, 35, 41, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
}

button:hover {
  background: var(--accent-dark);
}

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

button.secondary {
  background: #26313a;
}

button.secondary:hover {
  background: #11171d;
}

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

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  letter-spacing: 0;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.topbar p,
.muted {
  color: var(--muted);
  font-size: 14px;
  margin-top: 7px;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 330px minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 18px;
}

.dropzone {
  align-items: center;
  border: 1px dashed #9a9184;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 120px;
  padding: 18px;
  text-align: center;
}

.dropzone input {
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

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

.picker-actions button {
  min-width: 0;
  padding: 0 12px;
}

.guidance {
  border-left: 3px solid var(--gold);
  color: var(--muted);
  display: grid;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
  padding-left: 12px;
}

.guidance dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.guidance div {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 62px 1fr;
}

.guidance dt {
  color: var(--accent-dark);
  font-weight: 800;
}

.guidance dd {
  margin: 0;
}

.preview {
  min-height: 220px;
  background: #ede8df;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
  place-items: center;
}

.preview img {
  display: block;
  height: auto;
  max-height: min(420px, 54vh);
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.control {
  display: grid;
  gap: 9px;
}

.control span {
  align-items: center;
  display: flex;
  font-size: 14px;
  justify-content: space-between;
}

input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
}

.meter {
  background: #e4ded2;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.meter div {
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--rose));
  height: 100%;
  transition: width 180ms ease;
  width: 0%;
}

.results {
  min-width: 0;
}

.results-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.results-head span {
  color: var(--muted);
  font-size: 14px;
}

.messages {
  color: var(--muted);
  min-height: 22px;
}

.messages.error {
  color: #9f263c;
}

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

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

.card img {
  aspect-ratio: 4 / 3;
  background: #e7e2d9;
  display: block;
  object-fit: cover;
  width: 100%;
}

.card-body {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.score {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.card a {
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding-top: 16px;
  }

  .topbar,
  .workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel {
    position: static;
  }

  .picker-actions {
    grid-template-columns: 1fr;
  }
}
