:root {
  color-scheme: light;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --ink: #181b20;
  --muted: #6c727d;
  --line: #dfe3e9;
  --soft-line: #eceff3;
  --blue: #2e62e8;
  --blue-dark: #1948c6;
  --blue-pale: #edf3ff;
  --frame-accent: #2e62e8;
  --id-accent: #6f4ed5;
  --good: #16835f;
  --warn: #c27a13;
  --bad: #c94a45;
  --shadow: 0 18px 60px rgba(31, 40, 58, 0.12);
  --radius: 18px;
  font-family: "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  font-size: 16px;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible,
.upload-card:focus-within {
  outline: 3px solid rgba(46, 98, 232, 0.25);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-header {
  height: 74px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(247, 248, 250, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.home-view,
.upload-view {
  width: min(1080px, calc(100% - 40px));
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  padding: 68px 0 80px;
}

.home-copy {
  max-width: 680px;
  margin-bottom: 36px;
}

.home-copy > p,
.upload-view > p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.home-title,
.upload-view h1 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.mode-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.mode-card {
  --mode-accent: var(--frame-accent);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 16px 45px rgba(34, 44, 68, 0.08);
}

.mode-card--frame { --mode-accent: var(--frame-accent); }
.mode-card--id { --mode-accent: var(--id-accent); }

.mode-card__preview {
  height: 210px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 17px;
  background: color-mix(in srgb, var(--mode-accent) 8%, white);
}

.mode-card__preview span {
  width: 126px;
  height: 164px;
  border: 10px solid var(--mode-accent);
  border-radius: 3px;
  background: linear-gradient(150deg, #dbe5f7 0 47%, #afc4df 48% 100%);
  box-shadow: 0 18px 32px rgba(23, 32, 54, 0.16);
}

.id-preview span {
  width: 122px;
  height: 168px;
  border: 1px solid color-mix(in srgb, var(--mode-accent) 35%, white);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 36%, #f3cdb8 0 16%, transparent 17%),
    radial-gradient(ellipse at 50% 88%, #334d7d 0 34%, transparent 35%),
    #eef0f7;
}

.mode-card__eyebrow {
  color: var(--mode-accent);
  font-size: 14px;
  font-weight: 750;
}

.mode-card h2 {
  margin: 8px 0;
  font-size: 24px;
}

.mode-card p {
  min-height: 52px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.mode-card__button {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--mode-accent);
  color: white;
  font-size: 16px;
  font-weight: 750;
}

.change-mode-button {
  margin: 0 22px 4px;
}

.inline-error {
  margin: 0 18px 12px;
  padding: 11px 13px;
  border: 1px solid rgba(201, 74, 69, 0.28);
  border-radius: 10px;
  background: rgba(201, 74, 69, 0.08);
  color: #9e302c;
  font-size: 14px;
  line-height: 1.55;
}

.compliance-note {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid rgba(111, 78, 213, 0.2);
  color: #5e5282;
  font-size: 13px;
  line-height: 1.65;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px var(--paper);
  background: var(--blue);
  transform: rotate(-2deg);
}

.brand-mark i {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  display: block;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "STZhongsong", "FZYaoti", serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-top: 5px;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--good);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(22, 131, 95, 0.1);
}

.app-shell {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(340px, 410px) 1fr;
}

.control-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.panel-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--soft-line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.section-heading h2 {
  font-size: 16px;
  line-height: 1.35;
  margin: 3px 0 0;
}

.step-label,
.eyebrow {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.text-button,
.icon-button,
.preset-chip,
.mode-button,
.tool-button {
  border: 0;
  color: inherit;
  background: transparent;
}

.text-button {
  color: var(--blue);
  padding: 4px;
  font-size: 13px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.icon-button:hover,
.tool-button:hover {
  background: var(--paper);
}

.icon-button:disabled {
  color: #aeb4bd;
  background: #f2f3f5;
  cursor: not-allowed;
}

.upload-card {
  min-height: 116px;
  border: 1.5px dashed #b8c1cf;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--ink);
  background: #fbfcfe;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.upload-card:hover,
.upload-card.is-dragging {
  border-color: var(--blue);
  background: var(--blue-pale);
  transform: translateY(-1px);
}

.upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-card strong {
  font-size: 14px;
}

.upload-card small,
.file-summary small {
  color: var(--muted);
  font-size: 12px;
}

.upload-icon {
  width: 34px;
  height: 34px;
  color: var(--blue);
  display: grid;
  place-items: center;
  background: var(--blue-pale);
  border-radius: 50%;
  margin-bottom: 3px;
}

.file-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--paper);
  border-radius: 12px;
}

.file-summary > span:last-child {
  min-width: 0;
}

.file-summary strong,
.file-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-thumb {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 15px;
}

.size-category-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border-radius: 11px;
  margin-bottom: 14px;
}

.size-category-button {
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.size-category-button.is-active {
  color: var(--blue-dark);
  background: white;
  box-shadow: 0 2px 9px rgba(32, 42, 58, 0.08);
}

.id-preset-grid {
  grid-template-columns: repeat(3, 1fr);
}

.preset-chip {
  min-width: 0;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #4f5661;
  padding: 6px 4px;
}

.adjust-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-chip strong,
.preset-chip small {
  display: block;
}

.preset-chip strong {
  font-size: 12px;
}

.preset-chip small {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 400;
  margin-top: 3px;
  white-space: nowrap;
}

.preset-chip:hover,
.preset-chip.is-active {
  color: var(--blue-dark);
  border-color: #9bb4f5;
  background: var(--blue-pale);
}

.preset-chip.is-active small {
  color: #5271bf;
}

.preset-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin: -7px 0 14px;
}

.size-usage-note {
  position: relative;
  margin: 2px 0 16px;
  padding: 14px 15px 14px 17px;
  overflow: hidden;
  border: 1px solid #d8e2fa;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f8ff, #fbfcff);
}

.size-usage-note::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--blue);
}

.usage-label,
.size-usage-note strong,
.size-usage-note p,
.size-usage-note small {
  display: block;
}

.usage-label {
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 5px;
}

.size-usage-note strong {
  font-size: 13px;
}

.size-usage-note p {
  color: #4f5866;
  font-size: 11px;
  line-height: 1.65;
  margin: 6px 0 7px;
}

.size-usage-note small {
  color: #7a6371;
  font-size: 10px;
  line-height: 1.55;
}

.dimension-row {
  display: grid;
  grid-template-columns: 1fr 16px 1fr 86px;
  gap: 8px;
  align-items: end;
}

.field > span:first-child,
.range-field > span:first-child {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-bottom: 7px;
}

.field input,
.field select,
.format-select select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 0 11px;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
}

.dimension-cross {
  height: 42px;
  color: #969ca6;
  display: grid;
  place-items: center;
}

.trim-field {
  display: block;
  margin-top: 14px;
}

.input-with-suffix {
  position: relative;
  display: block;
}

.input-with-suffix input {
  padding-right: 52px;
}

.input-with-suffix em {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  pointer-events: none;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--paper);
  border-radius: 12px;
  margin-bottom: 18px;
}

.mode-button {
  min-height: 57px;
  padding: 7px 8px;
  border-radius: 9px;
}

.mode-button strong,
.mode-button small {
  display: block;
}

.mode-button strong {
  font-size: 13px;
}

.mode-button small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.mode-button.is-active {
  background: white;
  box-shadow: 0 2px 10px rgba(32, 42, 58, 0.08);
}

.mode-button.is-active strong {
  color: var(--blue-dark);
}

.range-field {
  display: grid;
  grid-template-columns: 40px 1fr 46px;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}

.range-field > span:first-child {
  margin: 0;
}

.range-field output {
  color: var(--muted);
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 11px;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--blue);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-button {
  height: 41px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
}

.tool-button svg {
  width: 17px;
  height: 17px;
}

.workspace {
  min-width: 0;
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto auto auto;
  padding: 24px clamp(20px, 4vw, 56px) 28px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0) 45%),
    var(--paper);
}

.workspace-toolbar,
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.workspace-toolbar > div:first-child strong,
.workspace-toolbar > div:first-child span {
  display: block;
}

.workspace-toolbar > div:first-child strong {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 16px;
  margin-top: 5px;
}

.quality-badge {
  min-width: 137px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.78);
}

.quality-badge > span {
  width: 9px;
  height: 9px;
  background: #a4a9b1;
  border-radius: 50%;
}

.quality-badge small,
.quality-badge strong {
  display: block;
}

.quality-badge small {
  color: var(--muted);
  font-size: 9px;
}

.quality-badge strong {
  font-size: 12px;
  margin-top: 2px;
}

.quality-badge.is-good > span { background: var(--good); }
.quality-badge.is-good strong { color: var(--good); }
.quality-badge.is-warn > span { background: var(--warn); }
.quality-badge.is-warn strong { color: var(--warn); }
.quality-badge.is-bad > span { background: var(--bad); }

.background-heading,
.background-actions,
.background-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.background-heading { justify-content: space-between; }
.background-heading h2 { margin: 3px 0 0; }

.id-export-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  margin: 0 0 14px;
}

.export-tool-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(31, 40, 58, 0.055);
}

.pixel-mode-select select {
  min-width: 116px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 0 30px 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.pixel-mode-select select:focus-visible {
  border-color: var(--blue);
  outline: 3px solid color-mix(in srgb, var(--blue) 25%, transparent);
  outline-offset: 2px;
}

.pixel-dimension-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 14px;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.switch-control input { position: absolute; opacity: 0; }

.switch-control > span {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #c7ccd4;
  transition: background 160ms ease;
}

.switch-control > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 160ms ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

.switch-control input:checked + span { background: var(--blue); }
.switch-control input:checked + span::after { transform: translateX(20px); }
.switch-control input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--blue) 38%, transparent);
  outline-offset: 3px;
}
.switch-control input:disabled + span { opacity: 0.55; }
.switch-control em { font-style: normal; }

.background-hint,
.background-status,
.compression-status,
.field-error {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.background-color-row {
  margin-top: 14px;
  flex-wrap: wrap;
}

.color-chip {
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.color-chip span {
  width: 20px;
  height: 20px;
  border: 1px solid #b6bbc4;
  border-radius: 50%;
  background: var(--swatch);
}

.color-chip.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 18%, transparent);
}

.background-custom-field { margin-top: 12px; }
.background-reference-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9em;
}
.background-color-inputs {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
}
.background-color-inputs input[type="color"] {
  width: 52px;
  min-height: 44px;
  padding: 4px;
  cursor: pointer;
}
.field-error { min-height: 1.5em; color: var(--bad); }
.background-actions { margin-top: 10px; flex-wrap: wrap; }
.compression-target-field { margin-top: 14px; }
.compression-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.compression-input-wrap em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}
.compression-status { min-height: 1.5em; }
.compression-status.is-blocked { color: var(--bad); }
.compression-status.is-complete { color: var(--good); }
.quality-badge.is-bad strong { color: var(--bad); }

.canvas-area {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

html[data-workspace="editing"] .workspace,
html[data-workspace="exported"] .workspace {
  grid-template-rows: auto clamp(340px, 40vh, 430px) auto auto auto;
  align-content: start;
}

html[data-workspace="editing"] .canvas-area,
html[data-workspace="exported"] .canvas-area {
  min-height: 0;
  height: 100%;
}

html[data-workspace="editing"] .canvas-drop-zone,
html[data-workspace="exported"] .canvas-drop-zone {
  min-height: 0;
}

.canvas-drop-zone {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  transition: background 160ms ease, outline-color 160ms ease;
}

.canvas-drop-zone.is-dragging {
  outline: 3px solid var(--blue);
  outline-offset: -6px;
  background: var(--blue-pale);
}

#cropCanvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#cropCanvas.is-dragging {
  cursor: grabbing;
}

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  color: #777e89;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(215, 220, 228, 0.9);
  border-radius: 999px;
  padding: 7px 12px;
  pointer-events: none;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.empty-state {
  width: min(420px, 90%);
  text-align: center;
  padding: 32px 20px;
}

.empty-frame {
  width: 158px;
  height: 116px;
  margin: 0 auto 26px;
  padding: 12px;
  background: #262a31;
  border: 1px solid #111318;
  box-shadow: 0 16px 30px rgba(22, 27, 36, 0.2), inset 0 0 0 3px #40454e;
  transform: rotate(-1.5deg);
}

.empty-frame span {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(145deg, transparent 48%, rgba(46, 98, 232, 0.38) 49%, rgba(46, 98, 232, 0.38) 52%, transparent 53%),
    #e6eaf0;
  box-shadow: inset 0 0 0 1px #b7bdc6;
}

.empty-state h1 {
  font-family: "STZhongsong", "FZYaoti", serif;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}

.empty-state p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 auto 20px;
  max-width: 350px;
}

.workspace-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.workspace-state[hidden] {
  display: none;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #dce5f8;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

[data-workspace="empty"] .adjust-panel,
[data-workspace="loading"] .adjust-panel {
  opacity: 0.52;
  pointer-events: none;
}

.export-bar {
  min-height: 72px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 9px 28px rgba(31, 40, 58, 0.07);
}

.export-success {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid #acd9c5;
  border-radius: 12px;
  background: #f1faf6;
}

.export-success[hidden] {
  display: none;
}

.export-success span {
  display: grid;
  gap: 3px;
}

.export-success__actions {
  display: flex !important;
  grid-auto-flow: column;
  gap: 8px;
}

@media (max-width: 640px) {
  .desktop-only {
    display: none;
  }

  .export-success {
    align-items: stretch;
    flex-direction: column;
  }

  .export-success__actions {
    flex-direction: column;
  }

  .export-success__actions button {
    min-height: 44px;
  }
}

.export-detail {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.export-detail small,
.export-detail strong {
  display: block;
}

.export-detail small {
  color: var(--muted);
  font-size: 10px;
}

.export-detail strong {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
}

.export-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-pale);
}

.export-options {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.format-select select,
.resolution-select select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 0 9px;
  font-size: 11px;
}

.format-select select {
  width: 96px;
}

.resolution-select select {
  width: 116px;
}

.primary-button {
  height: 46px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--blue);
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(46, 98, 232, 0.2);
  transition: transform 150ms ease, background 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  color: #a4aab3;
  background: #e4e7eb;
  box-shadow: none;
  cursor: not-allowed;
}

.primary-button.compact {
  height: 42px;
  padding-inline: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  color: white;
  background: #252a32;
  border-radius: 10px;
  padding: 11px 16px;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.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;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .app-header {
    height: 64px;
    padding: 0 18px;
  }

  .brand small {
    display: none;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .size-panel {
    order: 1;
  }

  .workspace {
    order: 2;
    min-height: auto;
    grid-template-rows: auto minmax(430px, 60vh) auto auto auto;
    padding: 18px 16px 16px;
  }

  .control-panel {
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .panel-section {
    padding: 22px 18px;
  }

  .id-export-tools {
    grid-template-columns: 1fr;
  }

  .export-tool-panel {
    padding: 18px;
  }

  .adjust-panel {
    order: 3;
    margin-block: 12px;
  }

  .export-bar {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 15;
  }
}

@media (max-width: 560px) {
  .privacy-note {
    font-size: 11px;
  }

  .workspace {
    grid-template-rows: auto minmax(420px, 54vh) auto auto auto;
    padding-inline: 12px;
  }

  .workspace-toolbar {
    align-items: flex-end;
  }

  .quality-badge {
    min-width: 124px;
    padding: 8px 10px;
  }

  .canvas-hint {
    bottom: 4px;
  }

  .export-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 9px;
  }

  .export-icon {
    display: none;
  }

  .export-detail {
    margin-left: 2px;
  }

  .export-detail strong {
    font-size: 10px;
  }

  .export-options {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
  }

  .format-select,
  .resolution-select {
    flex: 1;
  }

  .format-select select,
  .resolution-select select {
    width: 100%;
  }

  .primary-button {
    padding-inline: 13px;
    font-size: 12px;
  }

  .primary-button svg {
    display: none;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .id-preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dimension-row {
    grid-template-columns: 1fr 14px 1fr;
  }

  .unit-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .home-view {
    width: min(100% - 28px, 680px);
    padding-top: 38px;
  }

  .mode-card-grid {
    grid-template-columns: 1fr;
  }

  .mode-card__preview {
    height: 170px;
  }
}

.adjust-panel {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.control-panel .panel-section,
.adjust-panel,
.export-tool-panel {
  font-size: 16px;
}

.step-label,
.eyebrow,
.quality-badge small,
.export-detail small {
  font-size: 12px;
}

.section-heading h2,
.background-heading h2 {
  font-size: 18px;
  line-height: 1.35;
}

.text-button,
.tool-button,
.primary-button,
.color-chip,
.pixel-mode-select select,
.field input,
.field select,
.format-select select,
.resolution-select select {
  font-size: 14px;
}

.preset-chip strong,
.mode-button strong {
  font-size: 14px;
}

.preset-chip small,
.mode-button small,
.field > span:first-child,
.range-field > span:first-child {
  font-size: 12px;
}

.usage-label {
  font-size: 11px;
}

.size-usage-note strong {
  font-size: 15px;
}

.size-usage-note p,
.background-hint,
.background-status,
.compression-status,
.background-reference-note {
  font-size: 13px;
  line-height: 1.65;
}

.size-usage-note small,
.preset-note,
.quality-badge strong,
.export-detail strong,
.range-field output {
  font-size: 12px;
  line-height: 1.55;
}

.file-summary strong {
  font-size: 14px;
}

.file-summary small,
.upload-card small {
  font-size: 12px;
}

@media (max-width: 560px) {
  .section-heading h2,
  .background-heading h2 {
    font-size: 17px;
  }

  .primary-button,
  .tool-button,
  .text-button {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
