:root {
  --page-bg: #eef1f5;
  --panel-bg: #ffffff;
  --ink: #162033;
  --muted: #65738a;
  --line: #d8e0ea;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --teal: #0f766e;
  --stage-bg: #111827;
}

.veya-page {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(238, 241, 245, 0.9)),
    var(--page-bg);
}

.veya-shell {
  width: 100%;
  max-width: 1180px;
}

.veya-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.login-panel {
  width: min(100%, 390px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 12px 30px rgba(22, 32, 51, 0.07);
  padding: 1.25rem;
}

.veya-kicker {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.veya-model {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  padding: 0.65rem 0.8rem;
  text-align: right;
}

.veya-model span,
.veya-model strong {
  display: block;
}

.veya-model span {
  color: var(--muted);
  font-size: 0.76rem;
}

.veya-model strong {
  font-size: 0.92rem;
}

.veya-workspace {
  display: grid;
  grid-template-columns: minmax(310px, 420px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.control-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 12px 30px rgba(22, 32, 51, 0.07);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.result-panel {
  min-height: calc(100vh - 8rem);
  padding: 1rem;
}

.upload-zone {
  position: relative;
  display: grid;
  min-height: 134px;
  place-items: center;
  border: 1px dashed #9aa9bc;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-zone.is-dragover {
  border-color: var(--blue);
  background: #eef5ff;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-copy {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--ink);
  text-align: center;
  padding: 1rem;
}

.upload-copy small {
  color: var(--muted);
}

.upload-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

.preview-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.preview-head,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.preview-head {
  padding: 0.55rem 0.7rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.result-head {
  margin-bottom: 1rem;
}

.image-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: auto;
  background-color: var(--stage-bg);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.055) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.055) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.055) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.source-stage {
  min-height: 220px;
  max-height: 330px;
}

.result-stage {
  min-height: calc(100vh - 13rem);
}

.image-stage img {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.stage-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 180px;
  color: #cbd5e1;
  text-align: center;
  padding: 1rem;
}

.result-placeholder {
  width: min(320px, 70%);
  aspect-ratio: 1;
  border: 1px solid rgba(203, 213, 225, 0.22);
  background:
    linear-gradient(90deg, transparent 31px, rgba(125, 211, 252, 0.24) 32px),
    linear-gradient(0deg, transparent 31px, rgba(125, 211, 252, 0.24) 32px);
  background-size: 32px 32px;
}

.status-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  min-height: 44px;
  padding: 0.65rem 0.75rem;
}

.status-box.is-error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.status-box.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

@media (max-width: 900px) {
  .veya-workspace {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 560px) {
  .veya-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .veya-model {
    text-align: left;
  }

  .control-panel,
  .result-panel {
    padding: 0.85rem;
  }
}
