:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18263a;
  background: #f7f9fc;
  font-synthesis: none;
  --accent: #2859ce;
  --border: #dce3ed;
  --muted: #62718a;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #668ffa; outline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 10; padding: 12px 18px; background: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner, .page-shell { width: min(1120px, calc(100% - 64px)); margin: 0 auto; }
.header-inner { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #18263a; font-size: 22px; font-weight: 750; letter-spacing: -.5px; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #18263a; color: #fff; font-size: 21px; }
nav { display: flex; flex-wrap: wrap; gap: 22px; }
nav a { color: #42516a; text-decoration: none; font-size: 14px; font-weight: 600; }
nav a:hover { color: var(--accent); }
.introduction { padding: 54px 0 35px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: 1.2px; text-transform: uppercase; }
h1 { margin: 0 0 15px; font-size: clamp(34px, 4.5vw, 54px); line-height: 1.1; letter-spacing: -2px; font-weight: 750; }
.intro-copy { max-width: 720px; margin: 0; color: #52617a; font-size: 17px; line-height: 1.65; }
.scope-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.workspace { display: grid; grid-template-columns: 1.12fr 1fr; align-items: start; gap: 26px; padding-bottom: 45px; }
.input-card, .preview-card { min-width: 0; padding: 25px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
h2 { margin: 0 0 20px; font-size: 19px; line-height: 1.3; letter-spacing: -.4px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.drop-target { display: flex; position: relative; flex-direction: column; align-items: center; gap: 5px; padding: 27px 20px; background: #f7faff; border: 1px dashed #abc0e2; border-radius: 9px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop-target:hover, .drop-target.is-dragging { background: #edf3ff; border-color: var(--accent); }
.drop-target:focus-within { outline: 3px solid #668ffa; outline-offset: 4px; }
.drop-target[aria-disabled="true"] { cursor: default; opacity: .6; }
.drop-icon { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 6px; background: #e6eefc; border-radius: 10px; color: var(--accent); font-size: 26px; }
.drop-title { color: var(--accent); font-size: 14px; font-weight: 650; }
.drop-description { color: var(--muted); font-size: 12px; }
.help-text { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.file-summary { margin: 12px 0 0; padding: 11px 13px; background: #eef3fa; border-radius: 7px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.companion-section { margin: 24px 0; }
.field-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
.optional { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 400; }
.companion-section .help-text { margin-top: 0; }
input[type="file"]:not(.visually-hidden) { display: block; width: 100%; margin-top: 12px; color: var(--muted); font-size: 12px; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 8px 11px; border: 1px solid #ced8e6; border-radius: 6px; background: #fff; color: #334768; font: inherit; cursor: pointer; }
.file-list { max-height: 130px; overflow: auto; margin: 8px 0; padding-left: 19px; color: #52617a; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#companion-summary { margin-top: 12px; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
select { width: 100%; height: 42px; padding: 8px 10px; color: #18263a; background: #fff; border: 1px solid #ced8e6; border-radius: 7px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; margin-top: 19px; font-size: 13px; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.primary-button, .secondary-button, .download-button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 42px; padding: 10px 15px; border: 1px solid var(--accent); border-radius: 7px; font-size: 13px; font-weight: 650; text-decoration: none; }
.primary-button, .download-button { color: #fff; background: var(--accent); }
.primary-button:hover:enabled, .download-button:hover { background: #204bb4; }
.secondary-button { color: #334768; background: #fff; border-color: #ced8e6; }
.secondary-button:hover { background: #f2f6fc; }
.text-button { padding: 7px 5px; color: #526783; background: transparent; border: 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--accent); }
.progress-line { display: flex; align-items: center; gap: 9px; min-height: 23px; margin-top: 17px; }
.progress-line p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.spinner { flex: 0 0 auto; width: 13px; height: 13px; border: 2px solid #d8e4f8; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-notice { padding: 13px 15px; margin-top: 16px; border: 1px solid #e8cbd0; border-radius: 8px; background: #fff7f8; color: #983943; font-size: 13px; line-height: 1.6; }
.error-notice p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.error-notice .text-button { margin-top: 5px; padding-left: 0; color: #983943; }
.preview-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.size-badge { margin-top: 1px; padding: 4px 7px; border-radius: 5px; background: #eef2f7; color: #5b6d86; font-size: 11px; white-space: nowrap; }
.preview-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; width: 100%; border: 1px solid #e2e8f1; border-radius: 9px; overflow: hidden; }
.checkerboard { background-color: #fff; background-image: linear-gradient(45deg, #eef1f6 25%, transparent 25%), linear-gradient(-45deg, #eef1f6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eef1f6 75%), linear-gradient(-45deg, transparent 75%, #eef1f6 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.preview-stage img { display: block; position: absolute; width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { margin: 0; padding: 25px; color: #758299; font-size: 13px; line-height: 1.6; text-align: center; }
.preview-caption { margin: 14px 0 0; min-height: 19px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.download-button { margin-top: 19px; }
.site-footer { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-top: 25px; padding-bottom: 35px; border-top: 1px solid var(--border); color: #758299; font-size: 12px; line-height: 1.5; }
.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px 18px; }
@media (max-width: 760px) {
  .header-inner, .page-shell { width: calc(100% - 36px); }
  .header-inner { min-height: 68px; }
  nav { gap: 14px; }
  nav a { font-size: 12px; }
  .introduction { padding-top: 37px; }
  h1 { letter-spacing: -1.3px; }
  .intro-copy { font-size: 15px; }
  .workspace { grid-template-columns: 1fr; gap: 18px; }
  .input-card, .preview-card { padding: 20px; }
  .preview-stage { max-width: 512px; margin: 0 auto; }
  .site-footer { flex-direction: column; gap: 8px; }
  .footer-links { justify-content: start; }
}
@media (max-width: 390px) {
  .header-inner { align-items: start; padding: 17px 0; }
  nav { flex-direction: column; align-items: end; gap: 7px; }
  .options-grid { grid-template-columns: 1fr; gap: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
