:root {
  --ink: #172033;
  --muted: #6d778b;
  --line: #dfe5ee;
  --soft: #f6f8fb;
  --card: #ffffff;
  --accent: #5367f1;
  --accent-dark: #3e50d1;
  --accent-soft: #eef0ff;
  --danger: #c13d53;
  --shadow: 0 20px 60px rgba(31, 44, 80, .09);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; color: var(--ink); background: #fbfcfe; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 28px; }
.brand { color: var(--ink); font-weight: 800; letter-spacing: -.04em; text-decoration: none; font-size: 1.05rem; }
.local-note { color: var(--muted); font-size: .78rem; }
.tool-card { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 4vw, 44px); box-shadow: var(--shadow); }
.eyebrow { color: var(--accent); font-size: .69rem; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.065em; }
h2 { margin-bottom: 0; font-size: 1.05rem; letter-spacing: -.02em; }
.lede { max-width: 650px; color: var(--muted); font-size: 1rem; margin-bottom: 13px; }
.privacy-line { display: flex; align-items: center; gap: 8px; color: #4c5c74; font-size: .83rem; margin-bottom: 30px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ca66d; box-shadow: 0 0 0 4px #e1f6eb; }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section-heading > div { display: flex; gap: 10px; align-items: center; }
.step { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .1em; }
.format-chip, .preview-status { color: var(--muted); font-size: .72rem; border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 5px 9px; white-space: nowrap; }
.dropzone { min-height: 194px; border: 1.5px dashed #b9c3d6; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); transition: .2s ease; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.dropzone strong { color: var(--ink); font-size: 1rem; }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 4px; color: var(--accent); background: var(--accent-soft); border-radius: 13px; font-size: 1.5rem; font-weight: 700; }
.dropzone small { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); margin-top: 5px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; color: var(--muted); font-size: .75rem; }
.divider:before, .divider:after { content: ""; height: 1px; background: var(--line); flex: 1; }
textarea { width: 100%; min-height: 112px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; padding: 12px; color: var(--ink); background: #fbfcff; font: .79rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
textarea:focus, input:focus, button:focus-visible { outline: 3px solid rgba(83, 103, 241, .2); outline-offset: 2px; }
.input-actions { display: flex; gap: 10px; align-items: center; margin-top: 11px; }
.button { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 750; transition: .2s ease; }
.button-primary { width: 100%; background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button-secondary { color: var(--ink); background: var(--soft); border: 1px solid var(--line); }
.button-secondary:hover { background: var(--accent-soft); border-color: #c8ceff; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: .82rem; }
.download-button { width: 100%; margin-top: 10px; }
.download-button:disabled { cursor: not-allowed; opacity: .45; }
.error { min-height: 1.1em; margin: 9px 0 0; color: var(--danger); font-size: .8rem; }
.canvas-wrap { position: relative; min-height: 330px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.checkerboard { background-color: #fff; background-image: linear-gradient(45deg, #edf0f5 25%, transparent 25%), linear-gradient(-45deg, #edf0f5 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #edf0f5 75%), linear-gradient(-45deg, transparent 75%, #edf0f5 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
canvas { display: block; max-width: calc(100% - 28px); max-height: 285px; width: auto; height: auto; object-fit: contain; }
.empty-state { position: absolute; display: grid; justify-items: center; gap: 9px; color: #8893a7; font-size: .78rem; text-align: center; pointer-events: none; }
.empty-mark { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid #d8deea; border-radius: 15px; color: #a5aec0; font-size: .8rem; font-weight: 800; }
.file-meta, .result-summary { color: var(--muted); font-size: .78rem; margin-top: 11px; }
.settings, .result-section { margin-top: 16px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 11px; font-size: .78rem; font-weight: 750; }
.segmented { display: flex; gap: 8px; }
.segmented label { flex: 1; }
.segmented input, .background-option input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; color: var(--muted); text-align: center; font-size: .78rem; cursor: pointer; }
.segmented input:checked + span { color: var(--accent-dark); background: var(--accent-soft); border-color: #c6cdff; font-weight: 700; }
.size-controls { display: flex; align-items: end; gap: 12px; margin-top: 12px; }
.size-controls label, .scale-custom { color: var(--muted); font-size: .75rem; }
.size-controls input[type=number], .scale-custom input { width: 94px; margin-left: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; color: var(--ink); }
.ratio-lock { display: flex; align-items: center; gap: 6px; padding-bottom: 7px; }
.ratio-lock input { accent-color: var(--accent); }
.scale-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.scale-button { border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); padding: 7px 11px; font-size: .77rem; }
.scale-button.active { background: var(--accent-soft); color: var(--accent-dark); border-color: #c6cdff; font-weight: 700; }
.scale-custom { display: flex; align-items: center; margin-left: auto; }
.scale-custom input { width: 60px; }
.background-options { display: flex; gap: 12px; flex-wrap: wrap; }
.background-option { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .78rem; cursor: pointer; padding: 7px 9px; border: 1px solid transparent; border-radius: 10px; }
.background-option.selected { color: var(--ink); border-color: #cbd2ff; background: var(--accent-soft); }
.swatch { width: 20px; height: 20px; border: 1px solid #ccd4e1; border-radius: 6px; }
.swatch-checker { background: repeating-conic-gradient(#dfe4ed 0 25%, white 0 50%) 50% / 10px 10px; }
.swatch-white { background: white; }
.swatch-custom { background: #eef2ff; }
.color-input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: center; }
.result-canvas-wrap { min-height: 270px; }
.result-actions { display: flex; flex-direction: column; }
.content-section, .faq-section { max-width: 820px; margin: 38px auto 0; padding: 0 4px; }
.content-copy { border-top: 1px solid var(--line); padding-top: 27px; }
.content-section h2, .faq-section h2 { margin: 6px 0 10px; font-size: 1.6rem; letter-spacing: -.04em; }
.content-section p, .notes-list, .faq-section details { color: var(--muted); font-size: .9rem; }
.notes-list { display: grid; gap: 12px; padding-left: 20px; }
.notes-list strong { color: var(--ink); }
.notes-list em { color: var(--accent-dark); font-style: normal; }
.compact { margin-top: 28px; }
.faq-section { display: grid; gap: 0; }
.faq-section details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq-section summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.faq-section details p { margin: 10px 0 0; }
code { padding: 2px 5px; border-radius: 5px; background: var(--soft); color: var(--ink); }
.footer { margin-top: 48px; color: #9aa4b5; font-size: .75rem; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 680px); padding-top: 10px; }
  .topbar { padding-bottom: 18px; }`r`n  .local-note { display: none; }
  .tool-card { padding: 16px; border-radius: 20px; }
  h1 { font-size: clamp(2rem, 11vw, 3.2rem); }
  .input-grid, .settings-grid, .result-grid { grid-template-columns: 1fr; }
  .input-panel { order: 1; }
  .preview-panel { order: 2; }
  .canvas-wrap { min-height: 250px; }
  .result-canvas-wrap { min-height: 220px; }
  .result-actions { width: 100%; }
  .scale-custom { margin-left: 0; }
  .background-options { gap: 5px; }
  .background-option { padding-left: 6px; padding-right: 6px; }
}


.footer { display:flex; gap:1rem; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.footer nav { display:flex; gap:1rem; flex-wrap:wrap; }
.footer a { color:inherit; text-underline-offset:3px; }
.info-page { max-width:760px; margin:2rem auto 5rem; padding:clamp(1.2rem,4vw,2.5rem); border:1px solid #dbe2ee; border-radius:20px; background:#fff; line-height:1.7; }
.info-page h1 { margin-top:0; }
.info-page h2 { margin-top:2rem; }
.info-page p, .info-page li { max-width:70ch; }
.info-page a { overflow-wrap:anywhere; }
@media(max-width:480px) { .footer { align-items:flex-start; flex-direction:column; } .info-page { margin:1rem 0 3rem; } }
