:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: linear-gradient(145deg, #eef4ff 0%, #f8fafc 48%, #edf7f4 100%);
}

button, input { font: inherit; }

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero { max-width: 760px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px; color: #185c57; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .78rem; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.06; letter-spacing: -.045em; }
.intro { margin: 14px 0 20px; color: #526078; font-size: 1.12rem; }
.privacy-notice { display: inline-flex; gap: 9px; align-items: center; margin: 0; padding: 10px 14px; border: 1px solid #c8e1dc; border-radius: 999px; color: #185c57; background: #effaf7; font-size: .92rem; }

.workspace { padding: clamp(20px, 4vw, 36px); border: 1px solid #dce3ed; border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 24px 70px rgba(33, 51, 82, .1); }
.upload-panel h2, .preview-card h2 { margin: 0; font-size: 1.05rem; }
.upload-panel > p { margin: 7px 0 18px; color: #667085; }

.drop-zone { display: flex; min-height: 220px; padding: 26px; border: 2px dashed #a8b5c8; border-radius: 18px; align-items: center; justify-content: center; flex-direction: column; gap: 10px; text-align: center; background: #f8fafc; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.drop-zone:hover, .drop-zone:focus-within, .drop-zone.is-dragging { border-color: #247b72; background: #f0faf8; transform: translateY(-1px); }
.upload-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; color: #fff; background: #247b72; font-size: 1.5rem; }
.drop-title { font-weight: 700; }
.drop-divider { color: #7a8598; font-size: .85rem; }
#file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }

.button { display: inline-flex; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; }
.button-primary { color: #fff; background: #185c57; }
.button-secondary { color: #294057; border-color: #bdc8d6; background: #fff; }
.button-quiet { color: #526078; background: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; }
.button.is-busy::before { content: ""; width: 14px; height: 14px; margin-right: 9px; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
.button-secondary.is-busy::before { border-color: rgba(41,64,87,.25); border-top-color: currentColor; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .button.is-busy::before { animation-duration: 1.4s; }
}

.message { min-height: 24px; margin: 14px 0 0; color: #526078; }
.message.error { color: #a32828; font-weight: 650; }
.message.success { color: #185c57; font-weight: 650; }

.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.preview-card { min-width: 0; }
.preview-heading { display: flex; min-height: 32px; align-items: baseline; justify-content: space-between; gap: 12px; }
.file-details { color: #667085; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-surface { display: grid; min-height: 220px; padding: 20px; place-items: center; overflow: hidden; border: 1px solid #dce3ed; border-radius: 14px; color: #7a8598; background-color: #f8fafc; background-image: linear-gradient(45deg, #edf1f6 25%, transparent 25%), linear-gradient(-45deg, #edf1f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #edf1f6 75%), linear-gradient(-45deg, transparent 75%, #edf1f6 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; text-align: center; }
.result-surface { background: #fff; }
.preview-surface img, .preview-surface canvas { width: 100%; height: auto; object-fit: contain; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

@media (max-width: 720px) {
  .app-shell { padding-top: 30px; }
  .privacy-notice { border-radius: 14px; align-items: flex-start; }
  .preview-grid { grid-template-columns: 1fr; }
  .actions .button { flex: 1 1 100%; }
}
