:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #14202b;
  --muted: #657483;
  --line: #d7dee4;
  --accent: #1f6f8b;
  --accent-strong: #164f64;
  --warn: #9b5125;
  --error: #9b2d35;
}

* {
  box-sizing: border-box;
}

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

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

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

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

p {
  margin: 0;
}

#statusText {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.permalink {
  color: var(--accent-strong);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
}

.prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  min-height: 88px;
}

button {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 650;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

button:disabled {
  border-color: #c9d1d8;
  background: #dce2e7;
  color: #7a8793;
  cursor: not-allowed;
}

.comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.side {
  min-width: 0;
}

.image-pane {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 650;
}

.image-pane.loading {
  background:
    linear-gradient(90deg, #eef2f5 0%, #ffffff 46%, #e8eef2 100%);
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

.image-pane.error {
  color: var(--error);
  border-color: #e2b9be;
  background: #fff8f8;
}

.image-pane img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.details {
  min-height: 48px;
  padding: 8px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.details strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.vote-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.vote-row button {
  min-width: 108px;
}

.message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--warn);
  font-size: 14px;
}

@keyframes shimmer {
  from {
    background-position: 110% 0;
  }
  to {
    background-position: -110% 0;
  }
}

@media (max-width: 760px) {
  .app {
    width: min(100vw - 20px, 680px);
    padding-top: 16px;
  }

  .topbar,
  .prompt-row,
  .comparison {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .prompt-row button {
    width: 100%;
  }

  .vote-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vote-row button {
    min-width: 0;
  }
}

