:root {
  --bg: #f4efe7;
  --ink: #172033;
  --muted: #69748d;
  --panel: rgba(255, 250, 243, 0.82);
  --line: rgba(23, 32, 51, 0.12);
  --accent: #d8572a;
  --accent-2: #0f766e;
  --accent-3: #f2b872;
  --accent-4: #fff1d9;
  --shadow: 0 24px 70px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(242, 184, 114, 0.38), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(15, 118, 110, 0.16), transparent 20%),
    linear-gradient(145deg, #f7f0e5 0%, #fffaf3 48%, #edf4f3 100%);
}

body.modal-open {
  overflow: hidden;
}

code,
button,
select,
textarea {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  height: 100vh;
  padding: 18px 0 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.hero {
  padding: 6px 8px;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 92px;
  height: 92px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(216, 87, 42, 0.14), rgba(15, 118, 110, 0.12)),
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(255, 255, 255, 0.22) 12px 24px);
  transform: rotate(12deg);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.subtitle {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  padding-right: 92px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field.full,
.actions.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.86rem;
  font-weight: 700;
}

select,
textarea,
button,
.link {
  border-radius: 16px;
  font-size: 0.94rem;
}

select,
textarea {
  width: 100%;
  border: 1px solid rgba(20, 33, 61, 0.14);
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

textarea {
  resize: vertical;
  min-height: 104px;
  max-height: 180px;
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 12px;
  padding-top: 2px;
}

button {
  border: 0;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

#submit-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), #d1495b);
}

.ghost {
  color: var(--ink);
  background: rgba(20, 33, 61, 0.08);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
}

.left-stack {
  display: grid;
  gap: 14px;
  align-content: stretch;
  min-height: 0;
}

.panel-fixed {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.status-panel {
  min-height: 200px;
}

.result-panel {
  min-height: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

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

.hint {
  color: var(--muted);
  font-size: 0.84rem;
}

h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.chip.neutral {
  color: var(--ink);
  background: rgba(20, 33, 61, 0.08);
}

.chip.pending {
  color: #704214;
  background: rgba(244, 162, 97, 0.25);
}

.chip.success {
  color: #0f5132;
  background: rgba(42, 157, 143, 0.24);
}

.chip.danger {
  color: #842029;
  background: rgba(231, 111, 81, 0.24);
}

.status-body {
  padding: 14px 18px 18px;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.status-stage,
.simple-status-body {
  min-height: 0;
}

.status-stage {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 241, 217, 0.8), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(216, 87, 42, 0.12);
}

.status-title {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.status-message {
  margin: 0;
  line-height: 1.55;
  font-size: 0.9rem;
  color: var(--muted);
}

.simple-status-body {
  justify-content: center;
}

.status-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.status-inline-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-inline-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.result-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 14px 18px 18px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(239, 245, 245, 0.8)),
    linear-gradient(45deg, rgba(23, 32, 51, 0.03) 25%, transparent 25%, transparent 75%, rgba(23, 32, 51, 0.03) 75%);
  border: 1px solid rgba(23, 32, 51, 0.1);
}

.empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-size: 0.92rem;
}

.preview-button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.result-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.42);
}

.zoom-badge {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(23, 32, 51, 0.78);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(10, 16, 29, 0.82);
  backdrop-filter: blur(8px);
}

.lightbox-image {
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  border-radius: 24px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
  background: white;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.8rem;
  line-height: 1;
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 1120px);
    height: auto;
    min-height: 100vh;
    padding: 18px 0 24px;
  }

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

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero::after {
    display: none;
  }

  .hero {
    display: block;
  }

  .subtitle {
    max-width: none;
    padding-right: 0;
    margin-top: 10px;
  }

  .actions {
    flex-direction: column;
  }

  .panel-fixed {
    min-height: auto;
  }

  .result-panel {
    min-height: auto;
  }

  .result-stage {
    min-height: 380px;
  }
}
