:root {
  color-scheme: light;
  --ink: #11182e;
  --muted: #657089;
  --line: rgba(83, 105, 156, 0.16);
  --blue: #2f61f4;
  --violet: #7156ff;
  --green: #35c777;
  --orange: #f49a39;
  --paper: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 70px rgba(66, 88, 160, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 96% 2%, rgba(99, 122, 247, 0.2) 0 180px, transparent 181px),
    radial-gradient(circle at 8% 98%, rgba(94, 116, 229, 0.1) 0 210px, transparent 211px),
    linear-gradient(135deg, #f8fbff 0%, #eef3ff 46%, #f7f9ff 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

body::before {
  width: 146px;
  height: 86px;
  right: 74px;
  top: 82px;
  opacity: 0.62;
  background-image: radial-gradient(circle, rgba(255,255,255,0.9) 2px, transparent 2.5px);
  background-size: 18px 18px;
}

body::after {
  width: 132px;
  height: 88px;
  left: 70px;
  bottom: 46px;
  opacity: 0.48;
  background-image: radial-gradient(circle, rgba(169,181,235,0.7) 2px, transparent 2.5px);
  background-size: 18px 18px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-shell {
  width: min(1370px, calc(100vw - 80px));
  margin: 0 auto;
  padding: 94px 0 72px;
}

.hero {
  min-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy {
  margin-bottom: 42px;
  padding-left: 6px;
}

.hero-copy h1 {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 900;
}

.hero-copy h1 i {
  display: inline-block;
  width: 6px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, #764ef8, #2967ff);
}

.hero-copy h1 span {
  color: var(--violet);
}

.hero-copy p {
  margin: 20px 0 0 42px;
  color: #516078;
  font-size: 17px;
  font-weight: 500;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(430px, 690px) minmax(460px, 1fr);
  gap: 46px;
  align-items: stretch;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.tool-card {
  position: relative;
  display: block;
  min-height: 282px;
  padding: 38px 44px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 18px 46px rgba(78, 99, 157, 0.1);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(79, 99, 240, 0.22);
  box-shadow: 0 24px 60px rgba(67, 88, 165, 0.16);
  outline: none;
}

.tool-card strong {
  display: block;
  margin-top: 24px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
}

.tool-card small {
  display: block;
  margin-top: 14px;
  color: #65718a;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 600;
}

.orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  font-size: 48px;
}

.orb svg {
  stroke-width: 3.5;
}

.orb-green {
  color: #31be72;
  background: linear-gradient(135deg, #e9fbef, #d8f6e6);
}

.orb-blue {
  color: #2a61e7;
  background: linear-gradient(135deg, #edf3ff, #dce7ff);
}

.orb-violet {
  color: #7b52eb;
  background: linear-gradient(135deg, #f1eaff, #e6dbff);
}

.orb-orange {
  color: var(--orange);
  background: linear-gradient(135deg, #fff4e6, #ffe7cc);
}

.mini-badge {
  position: absolute;
  right: 0;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: #43c97a;
  border: 3px solid #e8faef;
  font-size: 21px;
}

.mini-badge svg {
  stroke-width: 2.6;
}

.arrow {
  position: absolute;
  right: 30px;
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 27px;
  font-weight: 800;
}

.arrow-green {
  color: #22b565;
  background: #e7f8ee;
}

.arrow-blue {
  color: #3868f3;
  background: #edf3ff;
}

.arrow-violet {
  color: #744cf0;
  background: #f0e9ff;
}

.arrow-orange {
  color: #f19a32;
  background: #fff1e3;
}

.workspace-panel {
  position: relative;
  min-height: 586px;
  padding: 42px 44px;
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 94% 40%, rgba(255,255,255,0.11) 0 86px, transparent 87px),
    radial-gradient(circle at 76% 104%, rgba(255,255,255,0.1) 0 180px, transparent 181px),
    linear-gradient(135deg, #8d61f5 0%, #4f56ff 46%, #245df0 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workspace-panel::before,
.workspace-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.42;
}

.workspace-panel::before {
  width: 210px;
  height: 210px;
  right: 18px;
  top: 8px;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 7px, rgba(255,255,255,0.34) 8px 9px, transparent 10px 16px);
  transform: rotate(24deg) skewX(-18deg);
}

.workspace-panel::after {
  width: 320px;
  height: 160px;
  right: -14px;
  bottom: -18px;
  border-radius: 50%;
  border-top: 1px solid rgba(255,255,255,0.28);
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 8px, rgba(255,255,255,0.18) 9px 10px, transparent 11px 18px);
  transform: rotate(-9deg);
}

.panel-icon {
  display: grid;
  grid-template-columns: repeat(2, 18px);
  gap: 8px;
  place-content: center;
  width: 62px;
  height: 62px;
  border-radius: 10px;
  background: rgba(255,255,255,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.panel-icon span {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff;
}

.workspace-panel h2 {
  margin: 42px 0 16px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.workspace-panel p {
  margin: 0;
  color: rgba(255,255,255,0.9);
  font-size: 17px;
  line-height: 1.8;
  font-weight: 700;
}

.panel-rule {
  height: 1px;
  margin: 40px 0 34px;
  background: rgba(255,255,255,0.22);
}

.panel-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.panel-tools span {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 0;
  color: rgba(255,255,255,0.95);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.panel-tools svg {
  font-size: 38px;
  stroke-width: 2.2;
}

.primary-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 58px;
  min-width: 322px;
  height: 66px;
  margin-top: 78px;
  border: 0;
  border-radius: 14px;
  color: #2e56f4;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 42, 160, 0.2);
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #35c777, #2f61f4);
  box-shadow: 0 18px 42px rgba(20, 42, 160, 0.28);
  transform: translateY(-3px);
  outline: none;
}

.primary-action:hover span,
.primary-action:focus-visible span {
  transform: translateX(4px);
}

.primary-action span {
  font-size: 32px;
  line-height: 1;
  transition: transform 180ms ease;
}

.compressor-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  padding-top: 14px;
  padding-bottom: 14px;
}

.subnav {
  margin-bottom: 10px;
}

.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(89, 111, 170, 0.15);
  border-radius: 999px;
  color: #31405d;
  background: rgba(255,255,255,0.68);
  box-shadow: 0 10px 28px rgba(66, 88, 160, 0.08);
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.subnav a:hover,
.subnav a:focus-visible {
  border-color: rgba(47, 97, 244, 0.32);
  box-shadow: 0 14px 34px rgba(66, 88, 160, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.compressor {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: 0;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 18px;
  background: rgba(255,255,255,0.62);
  box-shadow: 0 24px 70px rgba(66, 88, 160, 0.12);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.compressor-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.compressor h1,
.compressor h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}

.privacy-pill {
  padding: 10px 16px;
  border-radius: 999px;
  color: #246052;
  background: #dff7ed;
  font-size: 14px;
  font-weight: 800;
}

.compressor-grid {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(250px, 0.85fr) minmax(300px, 1.15fr);
  gap: 24px;
  min-height: 0;
}

.upload-panel,
.preview-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(89, 111, 170, 0.13);
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  box-shadow: 0 16px 42px rgba(66, 88, 160, 0.08);
}

.upload-panel {
  padding: 22px;
  overflow: auto;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: clamp(168px, 28vh, 260px);
  padding: 22px;
  border: 2px dashed rgba(77, 94, 238, 0.24);
  border-radius: 12px;
  text-align: center;
  background: linear-gradient(180deg, #f8fbff, #f1f5ff);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone.dragging {
  border-color: rgba(42, 97, 231, 0.68);
  background: #eef5ff;
  transform: translateY(-2px);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #2f61f4;
  background: #e9efff;
  font-size: 42px;
}

.dropzone strong {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 900;
}

.dropzone small {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.choose-button {
  margin-top: 18px;
  padding: 11px 22px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #7655f7, #2c66f4);
  font-weight: 900;
}

.settings {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.settings label {
  display: grid;
  gap: 10px;
  color: #1d2740;
  font-size: 14px;
  font-weight: 900;
}

.settings label span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.settings b {
  color: var(--blue);
}

.settings select,
.settings input[type="number"] {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(78, 96, 156, 0.2);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.settings select:focus,
.settings input[type="number"]:focus {
  border-color: rgba(47, 97, 244, 0.58);
  box-shadow: 0 0 0 4px rgba(47, 97, 244, 0.1);
}

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

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

.checkbox-line {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px !important;
}

.checkbox-line span {
  display: inline !important;
}

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

.compress-button,
.download-row button {
  height: 50px;
  border: 0;
  border-radius: 9px;
  font-weight: 900;
}

.compress-button {
  color: #fff;
  background: linear-gradient(135deg, #34c777, #2f61f4);
  box-shadow: 0 12px 28px rgba(47, 97, 244, 0.18);
}

.compress-button:disabled,
.download-row button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
}

.preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(260px, 48vh, 420px);
  border-radius: 12px;
  background:
    linear-gradient(45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f8 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f8 75%);
  background-color: #f8faff;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  overflow: hidden;
  touch-action: none;
}

.preview-stage img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.preview-stage.has-image img {
  display: block;
}

#compressedPreview {
  clip-path: inset(0 50% 0 0);
}

.compare-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  display: none;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(38, 67, 168, 0.24), 0 0 20px rgba(38, 67, 168, 0.24);
}

.compare-mask::before {
  content: "压缩后";
  position: absolute;
  top: 18px;
  left: -12px;
  width: max-content;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(47, 97, 244, 0.86);
  font-size: 12px;
  font-weight: 900;
  transform: translateX(-100%);
}

.compare-mask::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 24px rgba(39, 63, 138, 0.24);
  transform: translate(-50%, -50%);
}

.preview-stage.has-compressed .compare-mask {
  display: block;
}

.preview-stage.has-compressed {
  cursor: ew-resize;
}

.preview-stage:focus-visible {
  outline: 4px solid rgba(47, 97, 244, 0.22);
  outline-offset: 4px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 16px;
  color: #72809a;
  font-weight: 800;
}

.empty-state span {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(47,97,244,0.2), rgba(53,199,119,0.18)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='82' height='82' viewBox='0 0 82 82'%3E%3Cg fill='none' stroke='%232f61f4' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='19' y='22' width='44' height='36' rx='4'/%3E%3Cpath d='m23 54 14-16 10 11 6-7 8 10'/%3E%3Ccircle cx='52' cy='32' r='4'/%3E%3C/g%3E%3C/svg%3E") center / 62px 62px no-repeat;
}

.preview-stage.has-image .empty-state {
  display: none;
}

.compare-control {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #4f5d78;
  font-size: 14px;
  font-weight: 900;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.stats-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(84, 105, 165, 0.13);
  border-radius: 10px;
  background: #fff;
}

.stats-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 18px;
  line-height: 1.2;
  word-break: break-word;
}

.download-row {
  display: grid;
  grid-template-columns: 1fr 0.45fr;
  gap: 12px;
  margin-top: 16px;
}

.download-row button:first-child {
  color: #fff;
  background: linear-gradient(135deg, #7655f7, #2f61f4);
}

.download-row button:last-child {
  color: #31405d;
  background: #eaf0fb;
}

.status {
  max-width: 100%;
  min-height: 22px;
  margin: 14px 0 0;
  color: #657089;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  max-width: min(520px, calc(100vw - 34px));
  padding: 13px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 46, 0.92);
  box-shadow: 0 18px 46px rgba(17, 24, 46, 0.24);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.editor-shell .compressor {
  padding: 22px;
}

.crop-layout {
  display: grid;
  grid-template-columns: 250px minmax(290px, 1fr);
  gap: 18px;
  min-height: 0;
  flex: 1;
}

.crop-sidebar,
.crop-main {
  min-width: 0;
  border: 1px solid rgba(89, 111, 170, 0.13);
  border-radius: 12px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 16px 42px rgba(66, 88, 160, 0.08);
}

.crop-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow: auto;
}

.mini-uploader {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px dashed rgba(77, 94, 238, 0.32);
  border-radius: 10px;
  color: #2f61f4;
  background: #f1f5ff;
  font-weight: 900;
}

.mini-uploader input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.segment-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #eef2f8;
}

.segment-tabs button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: #637089;
  background: transparent;
  font-weight: 900;
}

.segment-tabs button.active {
  color: #1c2740;
  background: #fff;
  box-shadow: 0 8px 20px rgba(66, 88, 160, 0.1);
}

.preset-list {
  display: grid;
  gap: 6px;
  max-height: min(220px, 28vh);
  padding: 8px;
  border-radius: 10px;
  background: #f1f4f9;
  overflow: auto;
}

.preset-list.hidden {
  display: none;
}

.preset-list button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #4e5a70;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.preset-list button span {
  color: #7b8799;
  font-size: 12px;
}

.preset-list button.active,
.preset-list button:hover,
.preset-list button:focus-visible {
  color: #2f61f4;
  background: #e2efff;
  outline: none;
}

.crop-dimensions label {
  display: grid;
  gap: 8px;
  color: #1d2740;
  font-size: 13px;
  font-weight: 900;
}

.crop-dimensions input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(78, 96, 156, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

.crop-actions {
  margin-top: 0;
}

.crop-actions button:first-child {
  color: #fff;
  background: linear-gradient(135deg, #7655f7, #2f61f4);
}

.crop-actions button:last-child {
  color: #31405d;
  background: #eaf0fb;
}

.crop-format {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 8px;
  color: #1d2740;
  font-size: 13px;
  font-weight: 900;
}

.crop-format span {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crop-format b {
  min-width: 0;
  color: #2f61f4;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.crop-format select {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(78, 96, 156, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.crop-format select:focus {
  border-color: rgba(47, 97, 244, 0.58);
  box-shadow: 0 0 0 4px rgba(47, 97, 244, 0.1);
}

.crop-main {
  padding: 18px;
}

.crop-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f8 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f8 75%);
  background-color: #f8faff;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  overflow: hidden;
  touch-action: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.crop-stage img {
  position: absolute;
  display: none;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.crop-stage.has-image img,
.crop-stage.has-image .crop-box {
  display: block;
}

.crop-stage.has-image .empty-state {
  display: none;
}

.crop-stage .empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.crop-stage .empty-state small {
  color: #8390a8;
  font-size: 13px;
  font-weight: 800;
}

.crop-stage.dragging-file {
  outline: 3px solid rgba(47, 97, 244, 0.28);
  outline-offset: -6px;
  background-color: #eef5ff;
}

.crop-stage.has-output .crop-box {
  display: none;
}

.crop-box {
  position: absolute;
  display: none;
  border: 2px solid #31c8ff;
  box-shadow: 0 0 0 9999px rgba(17, 24, 46, 0.36);
  cursor: move;
}

.crop-grid-line {
  position: absolute;
  background: rgba(255,255,255,0.78);
  pointer-events: none;
}

.crop-grid-line.v1,
.crop-grid-line.v2 {
  top: 0;
  bottom: 0;
  width: 1px;
}

.crop-grid-line.v1 {
  left: 33.333%;
}

.crop-grid-line.v2 {
  left: 66.666%;
}

.crop-grid-line.h1,
.crop-grid-line.h2 {
  left: 0;
  right: 0;
  height: 1px;
}

.crop-grid-line.h1 {
  top: 33.333%;
}

.crop-grid-line.h2 {
  top: 66.666%;
}

.crop-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 5px;
  background: #31c8ff;
  box-shadow: 0 8px 20px rgba(17, 24, 46, 0.22);
}

.crop-handle.nw {
  top: -11px;
  left: -11px;
  cursor: nwse-resize;
}

.crop-handle.ne {
  top: -11px;
  right: -11px;
  cursor: nesw-resize;
}

.crop-handle.sw {
  bottom: -11px;
  left: -11px;
  cursor: nesw-resize;
}

.crop-handle.se {
  right: -11px;
  bottom: -11px;
  cursor: nwse-resize;
}

.secondary-action {
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  color: #31405d;
  background: #eaf0fb;
  font-weight: 900;
}

.secondary-action:hover,
.secondary-action:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #34c777, #2f61f4);
  outline: none;
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.filter-layout {
  display: grid;
  flex: 1;
  grid-template-columns: 310px minmax(300px, 1fr);
  gap: 18px;
  min-height: 0;
}

.title-layout {
  display: grid;
  flex: 1;
  grid-template-columns: 370px minmax(300px, 1fr);
  gap: 18px;
  min-height: 0;
}

.filter-sidebar,
.filter-main,
.title-sidebar,
.title-main {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(89, 111, 170, 0.13);
  border-radius: 12px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 16px 42px rgba(66, 88, 160, 0.08);
}

.filter-sidebar,
.title-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
}

.filter-main,
.title-main {
  padding: 14px;
}

.filter-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 300px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f8 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f8 75%);
  background-color: #f8faff;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  overflow: hidden;
}

.filter-stage.dragging-file {
  outline: 3px solid rgba(47, 97, 244, 0.28);
  outline-offset: -6px;
  background-color: #eef5ff;
}

.filter-stage.has-image .empty-state {
  display: none;
}

.filter-stage canvas {
  display: none;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(17, 24, 46, 0.16);
}

.filter-stage.has-image canvas {
  display: block;
}

.title-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 300px;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f8 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f8 75%);
  background-color: #f8faff;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  overflow: hidden;
}

.title-stage canvas {
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(17, 24, 46, 0.16);
}

.title-stage .empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  pointer-events: none;
}

.title-stage.has-image .empty-state {
  display: none;
}

.title-stage.has-text .empty-state {
  display: none;
}

.title-stage.dragging-file {
  outline: 3px solid rgba(47, 97, 244, 0.28);
  outline-offset: -6px;
  background-color: #eef5ff;
}

.step-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(78, 96, 156, 0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #11182e;
  font-size: 16px;
  font-weight: 900;
}

.step-title span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: #2f61f4;
  font-size: 13px;
}

.helper-text {
  margin: 0;
  color: #657089;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.helper-text.warning,
.form-line b.warning {
  color: #df4d45;
}

#filterDownloadButton,
.crop-sidebar > .compress-button,
.filter-sidebar > .compress-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  padding: 0 14px;
  line-height: 1;
}

.filter-panel {
  display: grid;
  gap: 10px;
}

.filter-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  color: #11182e;
  background: #f1f5ff;
  font-size: 18px;
  font-weight: 900;
  text-align: left;
}

.filter-panel-title b {
  font-size: 18px;
}

.filter-panel-body {
  display: grid;
  gap: 10px;
}

.filter-panel.collapsed .filter-panel-body {
  display: none;
}

.filter-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.filter-preset {
  min-width: 0;
  border: 1px solid rgba(78, 96, 156, 0.14);
  border-radius: 9px;
  padding: 0;
  background: #fff;
  overflow: hidden;
  font-weight: 900;
}

.filter-preset span:first-child {
  display: block;
  height: 34px;
  background: var(--preset-bg, linear-gradient(135deg, #eef3ff, #f8fbff));
}

.filter-preset span:last-child {
  display: block;
  padding: 6px 4px;
  color: #4d5870;
  font-size: 13px;
}

.filter-preset.active,
.filter-preset:hover,
.filter-preset:focus-visible {
  border-color: rgba(47, 97, 244, 0.46);
  box-shadow: 0 0 0 3px rgba(47, 97, 244, 0.1);
  outline: none;
}

.title-template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.title-template {
  min-width: 0;
  border: 1px solid rgba(78, 96, 156, 0.14);
  border-radius: 9px;
  padding: 0 8px;
  background: #fff;
  overflow: hidden;
  font-weight: 900;
}

.title-template span {
  display: none;
}

.title-template span::after {
  content: none;
}

.title-template b {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: #4d5870;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
}

.title-template.active,
.title-template:hover,
.title-template:focus-visible {
  border-color: rgba(47, 97, 244, 0.46);
  box-shadow: 0 0 0 3px rgba(47, 97, 244, 0.1);
  outline: none;
}

.text-add-panel {
  gap: 14px;
}

.text-add-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.text-add-grid button {
  min-width: 0;
  min-height: 88px;
  border: 2px dashed rgba(97, 110, 137, 0.34);
  border-radius: 12px;
  color: #151a25;
  background: #fff;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.text-add-grid button:nth-child(2) {
  font-size: 20px;
}

.text-add-grid button:nth-child(3) {
  font-size: 18px;
  font-weight: 800;
}

.text-add-grid button:hover,
.text-add-grid button:focus-visible {
  border-color: rgba(47, 97, 244, 0.56);
  color: #2f61f4;
  background: #f6f8ff;
  outline: none;
}

.text-inspector {
  gap: 14px;
  padding: 18px;
  background: rgba(255,255,255,0.9);
}

.text-inspector.is-empty {
  display: none;
}

.inspector-head {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(78, 96, 156, 0.12);
}

.text-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 14px;
  color: #171b23;
  background: #f1f3f7;
  font-family: Georgia, serif;
  font-size: 48px;
  line-height: 1;
}

.inspector-head strong {
  display: block;
  margin-bottom: 18px;
  color: #151a25;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.icon-toolbar,
.segmented-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-toolbar button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: #202632;
  background: transparent;
  font-size: 20px;
  font-weight: 900;
}

.icon-toolbar button:hover,
.icon-toolbar button:focus-visible,
.icon-toolbar button.active {
  color: #2f61f4;
  background: #eef3ff;
  outline: none;
}

.inspector-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.inspector-row > span {
  color: #606776;
  font-size: 18px;
  font-weight: 900;
}

.inspector-row select,
.inspector-row input {
  min-width: 0;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  color: #1c222d;
  background: #f1f3f8;
  font-size: 18px;
  font-weight: 800;
  outline: none;
}

.inspector-row input[type="color"] {
  padding: 5px;
  background: #f1f3f8;
}

.two-fields {
  grid-template-columns: 66px minmax(0, 1fr) minmax(0, 0.9fr);
}



.segmented-icons {
  min-width: 0;
  justify-content: space-between;
  gap: 4px;
  min-height: 50px;
  padding: 5px;
  border-radius: 12px;
  background: #f1f3f8;
}

.segmented-icons button {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  border: 0;
  border-radius: 9px;
  color: #202632;
  background: transparent;
  font-size: 20px;
  font-weight: 900;
}

.segmented-icons button.active,
.segmented-icons button:hover,
.segmented-icons button:focus-visible {
  color: #2f61f4;
  background: #fff;
  outline: none;
}












.export-actions {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#titleDownloadButton,
#titleToCompressButton,
.export-actions .compress-button,
.export-actions .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  padding: 0 8px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Compact text inspector hierarchy: level 1 section titles, level 2 labels, level 3 controls. */
.title-sidebar {
  gap: 8px;
}

.step-panel {
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: 10px;
}

.step-title {
  font-size: 16px;
  line-height: 1.25;
}

.text-add-grid {
  gap: 9px;
}

.text-add-grid button {
  min-height: 58px;
  border-radius: 9px;
  font-size: 20px;
}

.text-add-grid button:nth-child(2) {
  font-size: 18px;
}

.text-add-grid button:nth-child(3) {
  font-size: 16px;
}

.text-inspector {
  gap: 8px;
  padding: 10px;
}

.inspector-head {
  grid-template-columns: 48px 1fr;
  gap: 8px;
  padding-bottom: 8px;
}

.text-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-size: 30px;
}

.inspector-head strong {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.2;
}

.icon-toolbar {
  gap: 4px;
}

.icon-toolbar button {
  width: 24px;
  height: 24px;
  font-size: 16px;
}

.form-line {
  gap: 6px;
  font-size: 14px;
}

.form-line textarea {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 14px;
}

.inspector-row {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
}

.inspector-row > span {
  font-size: 14px;
  line-height: 1.25;
}

.inspector-row select,
.inspector-row input {
  height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 800;
}

.two-fields {
  grid-template-columns: 52px minmax(0, 1fr) 48px;
}

.inspector-row input[type="color"] {
  padding: 4px;
}

.segmented-icons {
  min-height: 34px;
  padding: 4px;
  border-radius: 9px;
}

.segmented-icons button {
  height: 26px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1;
}

#styleButtons button {
  font-size: 16px;
}

.form-line {
  display: grid;
  gap: 8px;
  color: #1d2740;
  font-size: 13px;
  font-weight: 900;
}

.form-line input,
.form-line select,
.form-line textarea {
  width: 100%;
  border: 1px solid rgba(78, 96, 156, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.form-line input,
.form-line select {
  height: 40px;
}

.form-line textarea {
  min-height: 62px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.form-line input[type="color"] {
  padding: 4px;
}

.form-line input[type="file"] {
  padding: 8px;
  height: auto;
}

.text-style-stack {
  display: grid;
  gap: 10px;
}

.text-style-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.text-style-group strong {
  grid-column: 1 / -1;
  color: #1d2740;
  font-size: 12px;
  font-weight: 900;
}

.text-style-group select {
  grid-column: 1 / -1;
}

.text-style-group select,
.text-style-group input {
  min-width: 0;
  width: 100%;
  height: 34px;
  border: 1px solid rgba(78, 96, 156, 0.18);
  border-radius: 8px;
  padding: 0 6px;
  background: #fff;
  outline: none;
}

.text-style-group input[type="color"] {
  padding: 4px;
}

.title-stage.has-image {
  cursor: ew-resize;
}

.slider-stack {
  display: grid;
  gap: 10px;
}

.tone-control {
  display: grid;
  grid-template-columns: 74px 1fr 54px;
  align-items: center;
  gap: 8px;
}

.tone-control label {
  color: #3e4a62;
  font-size: 13px;
  font-weight: 900;
}

.tone-control input[type="range"] {
  min-width: 0;
}

.tone-control input[type="number"] {
  width: 54px;
  height: 34px;
  border: 1px solid rgba(78, 96, 156, 0.18);
  border-radius: 8px;
  padding: 0 6px;
  text-align: center;
  outline: none;
}

.compact-tabs {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1120px) {
  .page-shell {
    width: min(920px, calc(100vw - 34px));
    padding-top: 56px;
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }

  .workspace-panel {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 24px, 560px);
    padding: 36px 0 42px;
  }

  .compressor-shell {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    margin-bottom: 28px;
  }

  .hero-copy h1 {
    gap: 16px;
    font-size: 42px;
  }

  .hero-copy h1 i {
    height: 44px;
  }

  .hero-copy p {
    margin-left: 24px;
    font-size: 15px;
    line-height: 1.7;
  }

  .tool-grid,
  .panel-tools {
    grid-template-columns: 1fr;
  }

  .dimension-row,
  .option-row,
  .stats-grid,
  .download-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-card {
    min-height: 240px;
    padding: 28px;
  }

  .workspace-panel,
  .compressor {
    padding: 16px;
  }

  .compressor h1,
  .compressor h2 {
    font-size: 28px;
  }

  .compressor-grid {
    grid-template-columns: 220px minmax(250px, 1fr);
    gap: 14px;
  }

  .crop-layout,
  .filter-layout,
  .title-layout {
    grid-template-columns: 220px minmax(250px, 1fr);
    gap: 14px;
  }

  .title-layout {
    grid-template-columns: 1fr;
  }

  .text-add-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .text-add-grid button {
    min-height: 74px;
    font-size: 20px;
  }

  .inspector-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .two-fields {
    grid-template-columns: 56px minmax(0, 1fr) minmax(0, 0.9fr);
  }



  .crop-sidebar,
  .crop-main,
  .filter-sidebar,
  .filter-main,
  .title-sidebar,
  .title-main,
  .upload-panel,
  .preview-panel {
    padding: 12px;
  }

  .primary-action {
    width: 100%;
    min-width: 0;
    gap: 28px;
  }

  .compressor-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .crop-stage {
    min-height: 340px;
  }

  .filter-stage {
    min-height: 340px;
  }

  .title-stage {
    min-height: 340px;
  }
}

.spacing-row {
  grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr);
}

.spacing-row input {
  width: 100%;
}


/* Workspace editor */
.workspace-body {
  height: 100vh;
  min-height: 0;
  background: #eef2f8;
  overflow: hidden;
}

.workspace-body::before,
.workspace-body::after {
  content: none;
}

.workspace-app {
  display: grid;
  grid-template-columns: 68px 330px minmax(360px, 1fr) 310px;
  grid-template-rows: 56px minmax(0, 1fr);
  grid-template-areas:
    "top top top top"
    "rail left canvas right";
  width: 100vw;
  height: 100vh;
  color: #11182e;
  background: #edf1f7;
}

.workspace-topbar {
  grid-area: top;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(83, 105, 156, 0.16);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 8px 28px rgba(66, 88, 160, 0.08);
  z-index: 3;
}

.workspace-back,
.workspace-download,
.workspace-primary,
.workspace-secondary,
.workspace-history button,
.workspace-zoom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
  text-decoration: none;
}

.workspace-back,
.workspace-secondary,
.workspace-history button,
.workspace-zoom button {
  color: #31405d;
  background: #eaf0fb;
}

.workspace-download,
.workspace-primary {
  color: #fff;
  background: linear-gradient(135deg, #34c777, #2f61f4);
  box-shadow: 0 12px 26px rgba(47, 97, 244, 0.16);
}

.workspace-download:disabled,
.workspace-primary:disabled,
.workspace-secondary:disabled,
.workspace-history button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.workspace-file {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workspace-file strong,
.workspace-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-file strong {
  font-size: 14px;
  line-height: 1.15;
}

.workspace-file span {
  color: #657089;
  font-size: 12px;
  font-weight: 800;
}

.workspace-zoom,
.workspace-history {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5ff;
}

.workspace-history button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.workspace-zoom span {
  min-width: 48px;
  color: #3f4d68;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.workspace-zoom button {
  width: 30px;
  height: 28px;
  padding: 0;
}

.workspace-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px;
  border-right: 1px solid rgba(83, 105, 156, 0.14);
  background: #fff;
}

.workspace-rail button {
  min-width: 0;
  min-height: 50px;
  border: 0;
  border-radius: 9px;
  color: #54617a;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

.workspace-rail button.active,
.workspace-rail button:hover,
.workspace-rail button:focus-visible {
  color: #2f61f4;
  background: #eef3ff;
  outline: none;
}

.workspace-panel-left,
.workspace-panel-right {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  background: rgba(255,255,255,0.9);
  overflow: auto;
}

.workspace-panel-left {
  grid-area: left;
  border-right: 1px solid rgba(83, 105, 156, 0.14);
}

.workspace-panel-right {
  grid-area: right;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 1px solid rgba(83, 105, 156, 0.14);
}

.workspace-tool-panel {
  display: none;
  gap: 12px;
}

.workspace-tool-panel.active {
  display: grid;
}

.workspace-tool-panel h2,
.workspace-panel-right h2 {
  margin: 0;
  color: #11182e;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.workspace-uploader {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 124px;
  border: 2px dashed rgba(47, 97, 244, 0.26);
  border-radius: 12px;
  color: #2f61f4;
  background: #f6f8ff;
  font-weight: 900;
}

.workspace-uploader input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.workspace-uploader small,
.workspace-note,
.workspace-status {
  color: #657089;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 800;
}

.workspace-field,
.workspace-slider {
  display: grid;
  gap: 7px;
  color: #3e4a62;
  font-size: 13px;
  font-weight: 900;
}

.workspace-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workspace-field span b {
  color: #657089;
  font-size: 12px;
}

.workspace-field input,
.workspace-field select,
.workspace-field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(78, 96, 156, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  color: #11182e;
  background: #fff;
  outline: none;
}

.workspace-field input,
.workspace-field select {
  height: 38px;
}

.workspace-field textarea {
  min-height: 64px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.workspace-field input[type="color"] {
  padding: 4px;
}

.workspace-two-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.workspace-option-row {
  display: grid;
  gap: 8px;
}

.workspace-option-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #43506a;
  font-size: 13px;
  font-weight: 900;
}

.workspace-option-row input {
  width: 16px;
  height: 16px;
  accent-color: #2f61f4;
}

.workspace-slider span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.workspace-filter-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(78, 96, 156, 0.12);
  border-radius: 12px;
  background: #fff;
}

.workspace-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  border: 0;
  padding: 0;
  color: #11182e;
  background: transparent;
  font-size: 15px;
  font-weight: 900;
}

.workspace-filter-title b {
  color: #657089;
  font-size: 14px;
}

.workspace-filter-panel.collapsed .workspace-filter-body {
  display: none;
}

.workspace-filter-body,
.workspace-slider-stack {
  display: grid;
  gap: 10px;
}

.workspace-tone-control {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
}

.workspace-tone-control label {
  color: #3e4a62;
  font-size: 12px;
  font-weight: 900;
}

.workspace-tone-control input[type="range"] {
  min-width: 0;
}

.workspace-tone-control input[type="number"] {
  width: 54px;
  height: 32px;
  border: 1px solid rgba(78, 96, 156, 0.18);
  border-radius: 8px;
  color: #11182e;
  background: #fff;
  text-align: center;
  font-weight: 800;
}

.workspace-preset-row,
.workspace-add-text,
.workspace-segment {
  display: grid;
  gap: 8px;
}

.workspace-preset-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-title-config {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(78, 96, 156, 0.14);
  border-radius: 12px;
  background: #fff;
}

.workspace-title-config.hidden,
.workspace-note.hidden {
  display: none;
}

.workspace-text-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(83, 105, 156, 0.12);
}

.workspace-text-head > span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  color: #11182e;
  background: #f0f3f8;
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 400;
}

.workspace-text-head strong {
  display: block;
  color: #11182e;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
}

.workspace-text-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.workspace-text-actions button {
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: #2f3545;
  background: #edf2fb;
  font-size: 15px;
  font-weight: 900;
}

.workspace-text-actions button.active {
  color: #2f61f4;
  background: #e2ecff;
}

.workspace-text-head small {
  display: block;
  margin-top: 4px;
  color: #657089;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
}

.workspace-add-text,
.workspace-segment {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#workspaceTextStyle {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-preset-row button,
.workspace-add-text button,
.workspace-segment button,
.workspace-layer-list button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #43506a;
  background: #edf2fb;
  font-size: 13px;
  font-weight: 900;
}


.workspace-preset-list {
  display: grid;
  gap: 7px;
  padding: 8px;
  border-radius: 10px;
  background: #f1f4f9;
  overflow: visible;
}

.workspace-preset-list.hidden {
  display: none;
}

.workspace-preset-list button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #4e5a70;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.workspace-preset-list button span {
  color: #7b8799;
  font-size: 12px;
}

.workspace-preset-list button.active,
.workspace-preset-list button:hover,
.workspace-preset-list button:focus-visible {
  color: #2f61f4;
  background: #e2efff;
  outline: none;
}

.workspace-preset-row button.active,
.workspace-add-text button:hover,
.workspace-segment button.active,
.workspace-layer-list button.active {
  color: #2f61f4;
  background: #e2ecff;
}

.workspace-canvas-shell {
  grid-area: canvas;
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(45deg, #e1e7f1 25%, transparent 25%),
    linear-gradient(-45deg, #e1e7f1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e1e7f1 75%),
    linear-gradient(-45deg, transparent 75%, #e1e7f1 75%);
  background-color: #f5f7fb;
  background-size: 32px 32px;
  background-position: 0 0, 0 16px, 16px -16px, -16px 0;
}

.workspace-canvas-shell.dragging-file {
  outline: 4px solid rgba(47, 97, 244, 0.24);
  outline-offset: -10px;
}

.workspace-empty {
  display: grid;
  gap: 8px;
  text-align: center;
  color: #657089;
  font-weight: 900;
}

.workspace-empty.hidden {
  display: none;
}

.workspace-empty strong {
  color: #11182e;
  font-size: 22px;
}

#workspaceCanvas {
  display: none;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(17, 24, 46, 0.18);
  touch-action: none;
  cursor: default;
}

@media (max-height: 760px) {
  .workspace-preset-list {
    max-height: min(320px, 42vh);
    overflow: auto;
  }
}

.workspace-info,
.workspace-layers,
.workspace-export-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(78, 96, 156, 0.12);
  border-radius: 12px;
  background: #fff;
}

.workspace-info dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.workspace-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: #657089;
  font-size: 13px;
  font-weight: 800;
}

.workspace-info dd {
  min-width: 0;
  margin: 0;
  color: #11182e;
  overflow-wrap: anywhere;
}

.workspace-layer-list {
  display: grid;
  gap: 8px;
}

.workspace-layer-list button {
  justify-content: flex-start;
  padding: 0 10px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .workspace-app {
    grid-template-columns: 58px 280px minmax(300px, 1fr);
    grid-template-areas:
      "top top top"
      "rail left canvas";
  }

  .workspace-panel-right {
    display: none;
  }
}
