:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233e;
  background: #f5f7fc;
  font-synthesis: none;
  --blue: #3658e9;
  --blue-dark: #2849d0;
  --ink: #17233e;
  --muted: #54647e;
  --line: #e4e9f3;
  --light-blue: #eef2ff;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; }
a { color: var(--blue-dark); }
:focus-visible { outline: 3px solid #758bfa; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 1.15em; height: 1.15em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner, .container { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); font-weight: 780; font-size: 1.34rem; letter-spacing: -.04em; }
.brand > span:last-child { color: var(--blue); }
.brand-mark { margin-inline-end: 9px; width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--blue); }
.brand-mark .icon { width: 22px; height: 22px; }
.tool-link { font-size: .875rem; font-weight: 650; text-align: right; }
.related-workflow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 8px 20px;
  border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted);
}
.handoff-status { padding: 0 20px 10px; font-size: .875rem; color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.footer > span { white-space: nowrap; }
.input-unit input:disabled { background: #f2f5fb; color: var(--muted); }
.intro { padding: 39px 0 26px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.07; letter-spacing: -.055em; font-weight: 790; }
h1 span { color: var(--blue); }
.intro p { margin-top: 11px; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.workbench { display: grid; grid-template-columns: minmax(330px, 405px) minmax(0, 1fr); gap: 22px; align-items: start; reading-flow: grid-rows; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 12px #273e7510; min-width: 0; }
.panel-heading { display: flex; align-items: center; gap: 10px; min-height: 65px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 1.0625rem; font-weight: 750; letter-spacing: -.02em; }
.heading-icon { background: var(--light-blue); color: var(--blue-dark); border-radius: 8px; width: 31px; height: 31px; display: grid; place-items: center; }
.heading-icon .icon { width: 17px; height: 17px; }
.panel-heading .reset, .view-switch { margin-inline-start: auto; }
.text-button { border: 0; background: none; color: var(--blue-dark); padding: 7px 4px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 6px; font-weight: 650; font-size: .875rem; }
.text-button:hover { background: var(--light-blue); }
.text-button:disabled { opacity: .6; }
.mobile-output { display: none; }
.settings-content { padding: 16px 20px 14px; }
.settings-section { border: 0; padding: 0; margin: 0; min-width: 0; position: relative; }
.settings-section legend { float: left; width: 100%; font-size: .9375rem; font-weight: 730; margin-bottom: 9px; padding: 0; }
.settings-section legend + *, .settings-section > .field-grid { clear: left; }
.divided { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 13px; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: 100%; }
.presets button { background: #fff; border: 1px solid #dee5f0; border-radius: 8px; min-height: 39px; padding: 4px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: .875rem; font-weight: 630; }
.presets button:hover { border-color: #9eaffc; }
.presets button[aria-pressed="true"] { border-color: #a2b0fc; background: #eef2ff; color: var(--blue-dark); box-shadow: inset 0 0 0 1px #dee5ff; }
.presets .icon { width: 15px; height: 15px; }
.field-note { font-size: .8125rem; color: var(--muted); line-height: 1.45; margin-top: 7px; }
.section-action { position: absolute; right: 0; top: 7px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; }
.icon-button:hover { background: #f0f4fe; color: var(--blue-dark); }
.icon-button[aria-pressed="true"] { background: #eef2ff; color: var(--blue-dark); border-color: #adbafb; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field-grid label, .field-full, .range-field { display: block; font-size: .875rem; font-weight: 620; }
.field-full { margin-top: 10px; }
.input-unit, .select-wrap { display: flex; align-items: center; position: relative; margin-top: 4px; }
.input-unit input, select { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid #dce4f0; border-radius: 7px; color: var(--ink); background: #fff; font-size: .9375rem; font-weight: 550; }
.input-unit input { padding-right: 38px; appearance: textfield; }
.input-unit input::-webkit-inner-spin-button, .input-unit input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.input-unit input::placeholder { color: #6b7990; font-weight: 400; }
.input-unit > span { position: absolute; right: 10px; color: var(--muted); pointer-events: none; font-size: .8125rem; }
select { appearance: none; padding-right: 30px; }
.select-wrap::after { content: ""; position: absolute; right: 14px; width: 7px; height: 7px; border: solid #586987; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); pointer-events: none; }
.toggle-row { position: relative; display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 10px; font-size: .875rem; cursor: pointer; }
.toggle-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .8125rem; }
.toggle-row input { position: absolute; right: 0; width: 38px; height: 25px; opacity: 0; margin: 0; }
.toggle-row:has(input:disabled) { opacity: .65; cursor: default; }
.switch { display: block; width: 36px; height: 21px; flex: 0 0 auto; border-radius: 20px; background: #7b8ca6; padding: 3px; }
.switch::after { display: block; content: ""; width: 15px; height: 15px; border-radius: 50%; background: white; transition: transform .17s ease; }
input:checked + .switch { background: var(--blue); }
input:checked + .switch::after { transform: translateX(15px); }
input:focus-visible + .switch { outline: 3px solid #758bfa; outline-offset: 3px; }
.adjustments { margin-top: 11px; }
.adjustments summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; font-size: .875rem; font-weight: 650; color: var(--muted); border-radius: 5px; list-style: none; }
.adjustments summary::-webkit-details-marker { display: none; }
.adjustments[open] summary .icon { transform: rotate(180deg); }
.adjustment-body { padding-top: 8px; }
.range-field { margin-top: 10px; }
.range-field span { display: flex; justify-content: space-between; }
.range-field output { color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.range-field input { width: 100%; margin: 5px 0 0; accent-color: var(--blue); }
.check-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 24px; font-size: .875rem; font-weight: 600; }
.check-row input { accent-color: var(--blue); width: 16px; height: 16px; }
.preview-content { padding: 18px 20px 15px; }
.view-switch { display: flex; background: #f0f3f9; border-radius: 8px; padding: 3px; }
.view-switch button { border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 5px 10px; font-size: .8125rem; font-weight: 650; }
.view-switch button[aria-pressed="true"] { background: #fff; color: var(--blue-dark); box-shadow: 0 1px 4px #18254b16; }
.preview-stage { border-radius: 12px; background-color: #f5f7ff; position: relative; }
.upload-state { min-height: 321px; border: 1px dashed #a1b2ee; border-radius: inherit; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 24px 12px; text-align: center; }
.preview-stage.is-dragging { outline: 3px solid #6c86f3; background-color: #e8eeff; }
.preview-stage.is-dragging .image-state { opacity: .75; }
.upload-art { width: 88px; height: 76px; display: grid; place-items: center; position: relative; margin-bottom: 11px; }
.upload-art span { width: 53px; height: 55px; border-radius: 12px; background: #e1e8fd; border: 1px solid #d4defb; position: absolute; transform: translate(-14px, 3px) rotate(-13deg); }
.upload-art span + span { transform: translate(14px, 3px) rotate(13deg); }
.upload-art .icon { position: relative; width: 58px; height: 58px; padding: 13px; border-radius: 13px; background: #fff; color: var(--blue); box-shadow: 0 6px 16px #3f5bc12b; }
.upload-state h3 { font-size: 1.28rem; letter-spacing: -.025em; }
.upload-state p { color: var(--muted); font-size: .875rem; margin-top: 6px; line-height: 1.4; }
.upload-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border-radius: 8px; min-height: 40px; padding: 8px 12px; font-size: .875rem; font-weight: 680; white-space: nowrap; }
.primary { color: #fff; background: var(--blue); border: 1px solid var(--blue); box-shadow: 0 2px 4px #3658e92e; }
.primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.primary:disabled { background: #e9edfb; color: #697a9e; border-color: #e9edfb; box-shadow: none; }
.secondary { color: #3e5071; background: #fff; border: 1px solid #dce4f0; }
.secondary:hover:not(:disabled), .secondary[aria-pressed="true"] { color: var(--blue-dark); border-color: #a1b0f9; background: #f2f5ff; }
.secondary:disabled { opacity: .6; }
.image-state { min-height: 321px; display: grid; grid-template-rows: auto auto minmax(214px, 1fr) auto; border: 1px solid #e0e7fa; border-radius: inherit; overflow: hidden; }
.stage-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px 10px; gap: 8px; }
.stage-tools .secondary { min-height: 32px; padding: 4px 8px; }
.image-name { min-width: 0; padding-inline: 2px; font-size: .875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-frame { display: grid; align-items: center; justify-items: center; padding: 6px 10px; overflow: hidden; }
.image-frame img { display: block; width: auto; height: auto; max-width: 100%; max-height: 250px; object-fit: contain; border-radius: 3px; box-shadow: 0 4px 15px #11204724; background: repeating-conic-gradient(#edf0f7 0% 25%, white 0% 50%) 50% / 14px 14px; }
.stage-actions { display: flex; justify-content: flex-end; gap: 6px; max-width: 100%; }
.framing-preview { position: relative; display: grid; min-width: 0; max-width: 100%; }
.framing-preview canvas {
  display: block;
  max-width: 100%;
  max-height: 250px;
  border-radius: 3px;
  box-shadow: 0 4px 15px #11204724;
  background: repeating-conic-gradient(#edf0f7 0% 25%, white 0% 50%) 50% / 14px 14px;
}
.framing-preview.show-grid::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: 3px;
  background:
    repeating-linear-gradient(to right, transparent 0 calc(100% / 3 - 1px), #17233e70 calc(100% / 3 - 1px) calc(100% / 3), #ffffffd9 calc(100% / 3) calc(100% / 3 + 1px)) -1px 0 / 100% 100%,
    repeating-linear-gradient(to bottom, transparent 0 calc(100% / 3 - 1px), #17233e70 calc(100% / 3 - 1px) calc(100% / 3), #ffffffd9 calc(100% / 3) calc(100% / 3 + 1px)) 0 -1px / 100% 100%;
}
.framing-preview.can-pan canvas { cursor: grab; touch-action: none; }
.framing-preview.is-panning canvas { cursor: grabbing; }
.framing-controls { padding: 0 12px 12px; border-top: 1px solid #e0e7fa; background: #fafbff; }
.framing-angle { display: grid; grid-template-columns: minmax(0, 1fr) 76px; align-items: end; gap: 12px; }
.framing-angle .input-unit { margin-bottom: 1px; }
.framing-angle .input-unit input { padding-right: 20px; }
.framing-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.framing-actions .secondary { min-height: 32px; padding: 4px 8px; }
.editing-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 8px;
}
.editing-tools .secondary { min-height: 36px; padding: 6px 9px; }
.editing-tools [aria-expanded="true"] { color: var(--blue-dark); border-color: #a1b0f9; background: #eef2ff; }
.crop-position { margin-top: 5px; }
.tool-controls { padding-top: 6px; }
.finish-editing { display: flex; justify-content: flex-end; padding: 0 12px 6px; background: #fafbff; }
.tool-controls input:is([type="text"], [type="date"]) { padding-inline: 8px; }
.text-fields { margin-top: 8px; }
.background-options, .head-actions { align-items: flex-end; }
.color-field { display: flex; align-items: center; gap: 6px; padding: 4px 6px; color: #3e5071; font-size: .875rem; font-weight: 650; }
.color-field input { width: 32px; height: 26px; padding: 1px; border: 1px solid #dce4f0; border-radius: 5px; background: white; cursor: pointer; }
.head-actions label { font-size: .875rem; font-weight: 650; min-width: 84px; }
.head-actions input { width: 84px; padding-right: 26px; }
.head-guides, .head-mark-line { position: absolute; left: 0; right: 0; pointer-events: none; }
.head-guides { border-block: 2px dashed #fff; box-shadow: inset 0 1px #162c65, inset 0 -1px #162c65; }
.head-mark-line { height: 2px; background: #fff; box-shadow: 0 0 0 1px #162c65; }
.framing-preview.is-marking canvas { cursor: crosshair; }
.file-download { color: var(--blue-dark); }
.file-download:disabled { opacity: .45; }
.editing-fullscreen { overflow: hidden; }
.workspace-dialog {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  border: 0; border-radius: 0; padding: 0; background: #f5f7fc; overscroll-behavior: contain;
}
.workspace-toolbar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; background: #fff; border-bottom: 1px solid var(--line);
  padding: 9px 15px;
}
.workspace-toolbar h2 { font-size: 1.0625rem; white-space: nowrap; }
#close-workspace { gap: 4px; }
.workspace-toolbar > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.workspace-host { width: min(1500px, 100%); margin-inline: auto; padding: 14px; }
.workspace-dialog #open-workspace { display: none; }
.workspace-dialog .image-frame img,
.workspace-dialog .framing-preview canvas { max-height: clamp(215px, 46dvh, 540px); }
.image-frame p, .preview-caption { font-size: .8125rem; text-align: center; color: var(--muted); }
.preview-caption { padding: 8px 10px; min-height: 33px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.stat { background: #f7f9fd; border: 1px solid #e9edf6; border-radius: 9px; padding: 10px 10px; min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; font-size: .8125rem; }
.stat-label .icon { color: #4c62ba; }
.stat > div + div { font-size: clamp(.8125rem, 1.8vw, 1rem); font-weight: 730; letter-spacing: -.02em; margin-top: 5px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.feedback { display: flex; align-items: flex-start; gap: 7px; background: #f1f4fe; color: #445985; padding: 9px 10px; border: 1px solid #e7edfd; border-radius: 8px; margin-top: 12px; font-size: .875rem; line-height: 1.4; }
.feedback .icon { margin-top: 2px; }
.feedback[data-state="good"] { background: #eff9f4; border-color: #dbefe4; color: #23664c; }
.feedback[data-state="warn"] { background: #fff7e8; border-color: #f4e5c6; color: #79521e; }
.notice { color: #802717; background: #fdf0ed; border-radius: 8px; padding: 8px 10px; margin-top: 9px; font-size: .875rem; overflow-wrap: anywhere; }
.queued-files { border-top: 1px solid var(--line); padding: 12px 20px; }
.queued-files h3 { font-size: .875rem; margin-bottom: 7px; }
.queued-files h3 span { color: var(--muted); margin-left: 3px; }
.file-list { display: grid; gap: 5px; max-height: 235px; overflow: auto; }
.file-row { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; min-width: 0; }
.file-row.active { background: #f1f4ff; border-color: #becafb; }
.file-select { display: flex; align-items: center; text-align: left; gap: 7px; min-width: 0; flex: 1; min-height: 37px; border: 0; background: transparent; border-radius: inherit; padding: 6px 9px; font-size: .875rem; }
.file-select .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-select .file-size { flex: 0 0 auto; color: var(--muted); font-size: .8125rem; }
.file-select .file-size[data-warning="true"] { color: #79521e; }
.file-row .icon-button { flex: 0 0 auto; }
.download-bar { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.download-info { font-size: .8125rem; color: var(--muted); }
.download-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.privacy-note { margin-top: 13px; display: flex; gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid #e4eaf7; border-radius: 11px; background: #f0f4fe; color: #324668; font-size: .875rem; }
.privacy-note-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; background: #e2eaff; color: var(--blue-dark); }
.privacy-note p { margin-top: 2px; font-size: .8125rem; color: var(--muted); line-height: 1.4; }
.footer { margin-top: 24px; border-top: 1px solid #e3e9f4; display: flex; justify-content: space-between; gap: 12px; padding: 14px 0 25px; font-size: .8125rem; color: var(--muted); }
.footer span:first-child { font-weight: 700; }
dialog { color: var(--ink); width: min(470px, calc(100% - 30px)); max-height: calc(100% - 30px); overflow: auto; border: 1px solid var(--line); border-radius: 15px; padding: 18px; box-shadow: 0 14px 44px #17234735; }
dialog::backdrop { background: #16234275; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.dialog-heading h2 { font-size: 1.125rem; }
dialog p { margin: 10px 0; line-height: 1.5; color: var(--muted); font-size: .9375rem; }
.dialog-actions { justify-content: flex-end; margin-top: 15px; }
.sponsor { display: grid; gap: 5px; border-radius: 8px; padding: 10px; border: 1px solid var(--line); background: #f7f9fd; }
.sponsor small { color: var(--muted); font-size: .8125rem; }
.sponsor p { margin: 0; }
.sponsor img { width: 100%; max-height: 140px; object-fit: contain; }
.sponsor a { justify-self: start; font-weight: 650; }
@media (max-width: 820px) {
  .header-inner, .container { width: calc(100% - 36px); }
  .workbench { grid-template-columns: minmax(280px, .86fr) minmax(0, 1fr); gap: 12px; }
  .panel-heading, .settings-content, .preview-content, .queued-files, .download-bar { padding-inline: 13px; }
  .download-bar { flex-wrap: wrap; }
  .download-actions { margin-inline-start: auto; }
}
@media (max-width: 670px) {
  .header-inner, .container { width: calc(100% - 28px); }
  .header-inner { min-height: 58px; }
  .intro { padding: 26px 0 19px; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-row: 1; }
  .mobile-output {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border-bottom: 1px solid #dee7fc;
    background: #f0f4fe;
    font-size: .8125rem;
  }
  .mobile-output span { display: block; margin-top: 3px; color: var(--muted); }
  .mobile-output a { text-align: right; font-weight: 650; }
  .upload-state { min-height: 245px; padding-block: 17px; }
  .image-state { min-height: 260px; grid-template-rows: auto auto minmax(160px, 1fr) auto; }
  .image-frame img, .framing-preview canvas { max-height: 220px; }
  .stage-tools { grid-template-columns: minmax(0, 1fr); }
  .stage-actions { flex-wrap: wrap; }
  .editing-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editing-tools .secondary { white-space: normal; }
  .workspace-host { padding: 8px; }
  .workspace-toolbar { padding: 7px 8px; }
  .workspace-toolbar .full-screen-label { display: none; }
  .workspace-dialog .image-frame img,
  .workspace-dialog .framing-preview canvas { max-height: clamp(200px, 39dvh, 360px); }
  .privacy-note { margin-top: 9px; }
}
@media (max-width: 350px) {
  .stat { padding-inline: 5px; }
  .stat-label { gap: 3px; }
  .presets button .icon { display: none; }
  .view-switch button { padding-inline: 5px; }
  .download-actions { justify-content: flex-start; margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
