:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

button, input, select {
  font: inherit;
}

button, select {
  cursor: pointer;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.top-nav a,
.site-footer a {
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
}

.top-nav a:hover,
.site-footer a:hover {
  color: #111827;
}

.header-label {
  padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
}

.page-intro {
  padding: 56px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.intro-copy {
  max-width: 760px;
  margin: 16px 0 18px;
  color: #4b5563;
  font-size: 17px;
}

.trust-points {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 13px;
}

.trust-points i {
  margin-right: 5px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.tool-section {
  padding-bottom: 56px;
}

.upload-panel {
  min-height: 260px;
  padding: 30px 20px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  transition: border-color .15s, background .15s;
}

.upload-panel.drag-over {
  border-color: var(--blue);
  background: #eff6ff;
}

.upload-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: #eef2f7;
  display: grid;
  place-items: center;
}

.upload-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #374151;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-panel h2 {
  margin: 0 0 2px;
  font-size: 18px;
}

.upload-panel p {
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.button {
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}

.button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.button-primary {
  background: #111827;
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: #293548;
}

.button-secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

.button-secondary:hover:not(:disabled) {
  background: #f3f4f6;
}

.choose-button {
  cursor: pointer;
}

.format-note {
  margin: 12px 0 0 !important;
  font-size: 12px !important;
}

.privacy-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin: 16px 0 24px;
  border: 1px solid #dcfce7;
  border-radius: 11px;
  background: #f0fdf4;
}

.privacy-icon {
  color: #15803d;
  font-size: 18px;
}

.privacy-note p {
  margin: 0;
  color: #365744;
  font-size: 13px;
}

.privacy-note strong {
  color: #14532d;
}

.workspace-panel,
.process-panel,
.settings-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.workspace-panel {
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.02em;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace-empty {
  padding: 48px 20px;
  border: 1px dashed #d1d5db;
  border-radius: 11px;
  background: #fafbfc;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.workspace-content {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 24px;
  align-items: start;
}

.preview-panel {
  min-width: 0;
  padding: 16px;
  background: #fafbfc;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.preview-heading span {
  color: var(--muted);
  font-size: 12px;
}

.preview-stage {
  min-height: 280px;
  padding: 18px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #f3f4f6 25%, transparent 25%),
    linear-gradient(-45deg, #f3f4f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f3f4f6 75%),
    linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.image-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.settings-panel {
  padding: 20px;
}

.settings-panel h3 {
  margin: 0 0 16px;
  font-size: 17px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.mode-button {
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}

.mode-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}

.dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setting-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.setting-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setting-field strong {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.setting-field input[type="number"],
.setting-field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.setting-field input:focus,
.setting-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.setting-field input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.setting-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

.checkbox-setting {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 20px;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
}

.checkbox-setting input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.preset-section {
  margin: 4px 0 18px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.preset-button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  color: #4b5563;
  font-size: 11px;
}

.preset-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.settings-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.output-dimensions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  margin: 4px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

.output-dimensions strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.resize-button,
.download-button {
  width: 100%;
  margin-top: 8px;
}

.result-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-message.success {
  color: var(--green);
}

.result-message.error {
  color: var(--red);
}

.process-panel {
  padding: 20px;
  margin-top: 18px;
}

.process-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 13px;
}

.status-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-copy strong {
  font-size: 14px;
}

.status-copy span {
  color: var(--muted);
  font-size: 12px;
}

.status-percent {
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 7px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width .2s;
}

.engine-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.content-section {
  padding: 12px 0 60px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.content-grid h2,
.faq-section h2 {
  margin: 0 0 16px;
  font-size: 20px;
  letter-spacing: -.025em;
}

.content-grid ol,
.content-grid ul {
  padding-left: 21px;
  margin: 0;
  color: #4b5563;
  font-size: 13px;
}

.content-grid li {
  padding-left: 4px;
  margin: 0 0 9px;
}

.content-grid strong {
  color: #1f2937;
}

.faq-section {
  margin-top: 52px;
}

.faq-section h2 {
  margin-bottom: 18px;
}

.faq-section details {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.faq-section summary {
  color: #1f2937;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.faq-section details p {
  max-width: 850px;
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.related-section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.related-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.related-inner h2 {
  margin: 0 0 5px;
  font-size: 19px;
}

.related-inner p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.related-inner .eyebrow {
  margin-bottom: 7px;
}

.site-footer {
  padding: 24px 0;
  background: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner > span {
  color: var(--muted);
  font-size: 12px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 9px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .header-inner {
    min-height: 64px;
    gap: 14px;
  }

  .brand-logo {
    width: 155px;
  }

  .top-nav {
    gap: 13px;
  }

  .top-nav a {
    font-size: 12px;
  }

  .header-label {
    display: none;
  }

  .page-intro {
    padding-top: 40px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .workspace-panel {
    padding: 16px;
  }

  .workspace-content {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .preview-stage {
    min-height: 220px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .related-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .container,
  .header-inner {
    width: min(100% - 28px, 1120px);
  }

  .header-inner {
    gap: 10px;
  }

  .brand-logo {
    width: 128px;
  }

  .top-nav {
    gap: 10px;
  }

  .top-nav a {
    font-size: 11px;
  }

  .trust-points {
    gap: 10px 16px;
  }

  .upload-panel {
    min-height: 230px;
    padding: 24px 14px;
  }

  .workspace-panel {
    padding: 13px;
  }

  .settings-panel {
    padding: 14px;
  }

  .dimension-grid {
    gap: 8px;
  }

  .preset-buttons {
    gap: 6px;
  }

  .preset-button {
    font-size: 10px;
  }

  .footer-inner nav {
    gap: 12px;
  }
}
