:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --panel: #ffffff;
  --ink: #17201c;
  --muted: #66736d;
  --line: #dce4df;
  --brand: #4f9b73;
  --brand-strong: #357c59;
  --soft: #e8f3ec;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --shadow: 0 16px 42px rgba(25, 34, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(79, 155, 115, 0.08), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(79, 155, 115, 0.14), transparent 18%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
.button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

button:hover,
.button:hover {
  background: var(--brand-strong);
}

button:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button.ghost,
.button.secondary {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

button.ghost:hover,
.button.secondary:hover {
  background: #f4faf6;
  border-color: #bed8c8;
}

button.danger,
.button.danger {
  background: var(--danger-bg);
  border: 1px solid #ffd1cc;
  color: var(--danger);
}

button.danger:hover,
.button.danger:hover {
  background: #ffe8e4;
}

.button.compact {
  font-size: 13px;
  min-height: 34px;
  padding: 0 10px;
}

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

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

.glass-bar,
.glass-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 228, 223, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.glass-bar {
  padding: 12px;
}

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

.brand-mark {
  align-items: center;
  background: var(--soft);
  border: 1px solid #cfe6d6;
  border-radius: 8px;
  color: var(--brand-strong);
  display: grid;
  font-weight: 900;
  height: 48px;
  place-items: center;
  width: 48px;
}

.brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.brand small {
  color: var(--muted);
  display: block;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.05;
  margin: 0 0 5px;
}

.topbar p,
.lead,
.status,
.image-meta span,
.feature p,
.section-head p,
.result-panel p,
.mini-card p,
.upload-card p,
.login-panel p {
  color: var(--muted);
}

.topbar p {
  margin: 0;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 44px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-bottom: 60px;
}

.eyebrow {
  color: #2d6d4c;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin: 0 0 16px;
}

.hero h1 {
  font-size: clamp(46px, 8vw, 96px);
  line-height: 0.98;
  margin: 0 0 24px;
  max-width: 820px;
}

.lead {
  font-size: 20px;
  line-height: 1.75;
  margin: 0;
  max-width: 760px;
}

.feature-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 34px;
}

.feature,
.panel,
.upload-card,
.result-panel,
.dropzone {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feature {
  padding: 18px;
}

.feature span {
  color: var(--brand);
  display: block;
  font-weight: 900;
  margin-bottom: 10px;
}

.feature strong {
  display: block;
  margin-bottom: 6px;
}

.feature p {
  margin: 0;
}

.trust-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: -28px 0 50px;
}

.mini-card {
  padding: 18px;
}

.mini-card span {
  color: var(--brand);
  display: block;
  font-weight: 900;
  margin-bottom: 10px;
}

.mini-card strong {
  display: block;
  margin-bottom: 6px;
}

.mini-card p {
  line-height: 1.65;
  margin: 0;
}

.upload-card {
  align-items: center;
  display: grid;
  gap: 14px;
  min-height: 440px;
  padding: 42px;
  place-items: center;
  position: relative;
  text-align: center;
}

.file-input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.upload-symbol {
  align-items: center;
  background: var(--soft);
  border: 1px solid #b9dac5;
  border-radius: 999px;
  color: var(--brand);
  display: grid;
  font-size: 42px;
  height: 96px;
  place-items: center;
  width: 96px;
}

.upload-kicker {
  background: #eef6ff;
  border-radius: 999px;
  color: #245a91;
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  padding: 7px 12px;
}

.upload-card h2 {
  display: block;
  font-size: 30px;
  line-height: 1.18;
  margin: 0;
}

.upload-card p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

.file-button {
  min-width: 112px;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  width: min(100%, 360px);
}

.queue-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.file-chip {
  align-items: center;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
  text-align: left;
}

.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip small {
  color: var(--muted);
  font-weight: 800;
}

.upload-card.dragging,
.dropzone.dragging {
  border-color: var(--brand);
  outline: 4px solid rgba(79, 155, 115, 0.14);
}

.section-head,
.result-panel {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 32px 0 14px;
}

.section-head h2,
.result-panel h2 {
  font-size: 32px;
  margin: 0 0 8px;
}

.section-head p,
.result-panel p {
  margin: 0;
}

.compact {
  margin-top: 0;
}

.result-panel {
  padding: 22px;
}

.result-list {
  display: grid;
  gap: 10px;
  min-width: min(100%, 520px);
}

.result-row {
  align-items: center;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.result-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-actions button {
  min-height: 34px;
}

.narrow {
  margin: 36px auto;
  max-width: 420px;
  padding: 26px;
}

.narrow h2 {
  margin: 0;
}

.login-panel {
  margin: 36px auto;
  max-width: 460px;
  padding: 26px;
}

.login-panel h2 {
  font-size: 30px;
  margin: 0 0 8px;
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 12px;
}

.admin-panel {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-top: 42px;
}

.dropzone {
  align-items: center;
  display: grid;
  min-height: 160px;
  margin-bottom: 18px;
  padding: 28px;
  place-items: center;
  position: relative;
  text-align: center;
}

.dropzone strong {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

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

.status {
  min-height: 26px;
}

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

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

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

.image-meta {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.image-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 0 12px 12px;
}

.actions button {
  min-height: 36px;
  padding: 0 8px;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero,
  .feature-list,
  .trust-grid {
    grid-template-columns: 1fr;
  }

  .upload-card {
    min-height: 360px;
  }
}

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

  .topbar,
  .section-head,
  .result-panel,
  .result-row {
    align-items: stretch;
    flex-direction: column;
  }

  .hero h2 {
    font-size: 46px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .upload-card {
    padding: 28px 18px;
  }

  .upload-actions,
  .result-actions,
  .top-actions {
    width: 100%;
  }

  .upload-actions .button,
  .result-actions .button,
  .top-actions .button {
    flex: 1;
  }

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