:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
}

.workspace {
  width: min(960px, 100%);
  margin: 0 auto;
}

.workspace-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #d7dee6;
}

.eyebrow {
  margin: 0 0 8px;
  color: #5c6b7a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1;
}

.relay-origin {
  margin: 0;
  color: #3a4958;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span,
.remember-token {
  color: #344252;
  font-size: 0.94rem;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bec8d3;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
  padding: 10px 12px;
}

.field input:focus {
  border-color: #1d5d9b;
  outline: 3px solid #cfe4f8;
}

.field:has(input[type="file"]) {
  grid-column: 1 / -1;
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.remember-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.remember-token input {
  width: 18px;
  height: 18px;
}

button {
  min-width: 140px;
  min-height: 44px;
  border: 1px solid #16466f;
  border-radius: 6px;
  background: #1d5d9b;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  border-color: #9aa8b5;
  background: #9aa8b5;
  cursor: wait;
}

.status-panel {
  margin-top: 24px;
  border-left: 4px solid #718093;
  background: #ffffff;
  padding: 14px 16px;
}

.status-panel[data-state="uploaded"] {
  border-left-color: #247a52;
}

.status-panel[data-state="failed"] {
  border-left-color: #b83c3c;
}

.status-panel p {
  margin: 0;
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.image-frame {
  display: grid;
  place-items: center;
  min-height: 320px;
  border: 1px solid #d7dee6;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.image-status {
  margin: 10px 16px 16px;
  color: #5c6b7a;
  font-size: 0.9rem;
}

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

.metadata-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
  border: 1px solid #d7dee6;
  border-radius: 6px;
  background: #ffffff;
  padding: 16px;
}

.metadata-grid dt {
  color: #5c6b7a;
  font-weight: 700;
}

.metadata-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.metadata-grid a {
  color: #1d5d9b;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 20px;
  }

  .workspace-header,
  .actions,
  .result-panel {
    display: grid;
  }

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

  button {
    width: 100%;
  }
}
