:root {
  --page-bg: #f3efe6;
  --panel-bg: rgba(255, 250, 242, 0.88);
  --panel-stroke: rgba(73, 55, 38, 0.14);
  --panel-shadow: 0 24px 60px rgba(81, 59, 34, 0.12);
  --text-main: #26180e;
  --text-muted: #72563e;
  --accent: #b74f2a;
  --accent-strong: #8f3214;
  --accent-soft: #f5d8c7;
  --surface-alt: #efe2d1;
  --success: #2d6e45;
  --danger: #9b2c2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(214, 123, 74, 0.20), transparent 34%),
    radial-gradient(circle at bottom right, rgba(101, 145, 120, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f2e9 0%, #efe6d8 100%);
}

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

.hero-card,
.panel {
  backdrop-filter: blur(18px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-stroke);
  border-radius: 24px;
  box-shadow: var(--panel-shadow);
}

.hero-card {
  padding: 28px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero-card h1,
.panel-header h2 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.hero-card h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.96;
}

.hero-copy,
.panel-header p,
.hero-meta,
.field span,
.message-box,
.status-chip,
.metadata-grid dt,
.metadata-grid dd {
  color: var(--text-muted);
}

.hero-copy {
  max-width: 780px;
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.6;
}

.hero-meta {
  margin-top: 16px;
  font-size: 0.92rem;
}

.control-grid,
.result-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.control-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

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

.panel {
  padding: 22px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header p {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.field,
.field-row {
  display: flex;
  gap: 14px;
}

.field {
  flex-direction: column;
  width: 100%;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input[type="file"],
input[type="number"],
input[type="color"],
select {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(76, 49, 30, 0.14);
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 14px;
  color: var(--text-main);
}

input[type="color"] {
  padding: 6px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #db7b4a 100%);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(183, 79, 42, 0.24);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 0.9rem;
  font-weight: 700;
}

.message-box {
  margin-top: 16px;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(239, 226, 209, 0.72);
  line-height: 1.5;
}

.message-box.error {
  color: var(--danger);
  background: rgba(245, 214, 214, 0.88);
}

.message-box.success {
  color: var(--success);
  background: rgba(216, 240, 224, 0.92);
}

.image-frame {
  position: relative;
  min-height: 280px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(240, 224, 203, 0.95), rgba(224, 238, 231, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.image-frame.empty img {
  display: none;
}

.image-frame span {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

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

.metadata-grid div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
}

.metadata-grid dt {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metadata-grid dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

@media (max-width: 900px) {
  .control-grid,
  .result-grid,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
  }
}