:root {
  --ink: #142119;
  --ink-soft: #516259;
  --muted: #74847a;
  --line: #dce6df;
  --line-soft: #edf2ee;
  --canvas: #f5f8f5;
  --paper: #ffffff;
  --forest: #164a36;
  --forest-deep: #0d3022;
  --mint: #7ae7b4;
  --mint-soft: #e4f9ee;
  --blue: #526ee8;
  --blue-soft: #ebefff;
  --gold: #bd7b20;
  --gold-soft: #fff2d9;
  --shadow: 0 18px 50px rgba(17, 48, 33, 0.08);
  --shadow-lg: 0 28px 70px rgba(17, 48, 33, 0.14);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -5%, rgba(122, 231, 180, 0.28), transparent 26rem),
    radial-gradient(circle at 94% 28%, rgba(205, 232, 218, 0.58), transparent 24rem),
    var(--canvas);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(74, 205, 143, .45); outline-offset: 2px; }

.app-shell { min-height: 100vh; overflow: hidden; }
.topbar {
  width: min(1248px, calc(100% - 48px));
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px auto 0;
  padding: 0 20px 0 12px;
  border: 1px solid rgba(218, 230, 222, .9);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 35px rgba(22, 74, 54, .06);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--forest-deep); font-size: 16px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #f6fff9;
  background: linear-gradient(145deg, #2d8061, var(--forest-deep));
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 7px 13px rgba(13, 48, 34, .22);
}
.brand-mark svg { width: 22px; }
.privacy-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #d5eadf;
  border-radius: 999px;
  color: #33634e;
  background: #f3fcf7;
  font: 500 12px "DM Mono", monospace;
  letter-spacing: .01em;
}
.privacy-status svg { width: 15px; color: #21845c; }

.workspace { width: min(1248px, calc(100% - 48px)); margin: 0 auto; padding: 52px 0 72px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 4px 31px; }
.eyebrow, .panel-kicker { margin: 0 0 9px; color: #317c5a; font: 500 12px "DM Mono", monospace; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; color: var(--forest-deep); font-size: clamp(31px, 4vw, 44px); line-height: 1.08; letter-spacing: -.055em; }
h2 { margin-bottom: 0; letter-spacing: -.035em; }
.output-format {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(196, 219, 207, .9);
  border-radius: 999px;
  color: #376453;
  background: rgba(255,255,255,.76);
  box-shadow: 0 5px 16px rgba(22, 74, 54, .05);
  font: 500 12px "DM Mono", monospace;
}
.output-format svg { width: 15px; color: var(--blue); }

.tool-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.tool-choice {
  position: relative;
  min-height: 100px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 13px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #dce7e0;
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 4px 15px rgba(18, 61, 41, .025);
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
}
.tool-choice::before { content: ""; position: absolute; inset: auto -25px -50px auto; width: 110px; height: 110px; border-radius: 50%; opacity: 0; background: currentColor; transition: opacity .2s; }
.tool-choice:hover { border-color: #adcabc; transform: translateY(-2px); box-shadow: 0 13px 28px rgba(17, 61, 41, .09); }
.tool-choice:hover::before { opacity: .035; }
.tool-choice.is-selected { border-color: #6abe95; background: #fbfffc; box-shadow: 0 0 0 3px rgba(120, 222, 174, .2), 0 14px 26px rgba(17, 71, 46, .08); }
.tool-choice-icon { position: relative; z-index: 1; display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; }
.tool-choice-icon svg { width: 20px; }
.compress-icon { color: #17795a; background: var(--mint-soft); }
.resize-icon { color: #506ade; background: var(--blue-soft); }
.both-icon { color: #ad6c16; background: var(--gold-soft); }
.tool-choice-copy { position: relative; z-index: 1; display: grid; gap: 4px; min-width: 0; }
.tool-choice-copy strong { font-size: 15px; letter-spacing: -.015em; }
.tool-choice-copy small { color: var(--muted); font-size: 13px; }
.choice-check { position: relative; z-index: 1; width: 18px; color: transparent; }
.tool-choice.is-selected .choice-check { color: #17865e; }

.tool-layout { display: grid; grid-template-columns: 345px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.control-panel, .work-area { border-radius: 20px; box-shadow: var(--shadow); }
.control-panel {
  position: relative;
  overflow: hidden;
  padding: 23px;
  color: #e7f5ec;
  background: linear-gradient(155deg, #1e5b42 0%, #103a29 60%, #0c2c20 100%);
}
.control-panel::before { content: ""; position: absolute; right: -90px; bottom: -75px; width: 250px; height: 250px; border: 1px solid rgba(144, 235, 190, .13); border-radius: 50%; box-shadow: 0 0 0 42px rgba(144, 235, 190, .035), 0 0 0 84px rgba(144, 235, 190, .025); pointer-events: none; }
.panel-heading, .label-row, .range-label, .queue-toolbar, .process-footer, .results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading { position: relative; z-index: 1; padding-bottom: 20px; border-bottom: 1px solid rgba(217, 247, 229, .15); }
.panel-kicker { margin-bottom: 5px; color: #87dcb2; font-size: 12px; }
.panel-heading h2 { color: #fff; font-size: 19px; }
.setting-block { position: relative; z-index: 1; padding: 20px 0; border-bottom: 1px solid rgba(217, 247, 229, .15); }
.setting-block label, .range-label { color: #f1fbf5; font-size: 14px; font-weight: 800; }
.field-suffix, .range-label, .input-label span { color: #c6e1d1; font: 500 12px "DM Mono", monospace; }
select, input[type="number"] {
  width: 100%;
  height: 44px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid rgba(218, 243, 228, .14);
  border-radius: 10px;
  outline: none;
  color: #ffffff;
  background: rgba(255, 255, 255, .16);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
select { color-scheme: dark; }
select:focus, input[type="number"]:focus { border-color: #9af0c2; background: rgba(255,255,255,.21); box-shadow: 0 0 0 3px rgba(102, 217, 154, .24); }
select option { color: var(--ink); background: #fff; }
.control-panel input::placeholder { color: #c7dfd1; opacity: 1; }
.format-help, .format-notice { margin: 8px 0 0; color: #d0e7da; font-size: 13px; line-height: 1.55; }
.format-notice { color: #f2c56f; }
input[type="range"] { width: 100%; height: 5px; margin: 12px 0 0; accent-color: #86e7b6; cursor: pointer; }
.range-label { margin-top: 19px; }
.dimension-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.input-label { display: block; font-size: 13px !important; }
.input-label span { float: right; }
.input-label input { margin-top: 5px; }
.lock-button, .preset { border: 1px solid rgba(219, 245, 228, .25); border-radius: 7px; background: rgba(255,255,255,.11); color: #edf9f1; transition: background .15s, border-color .15s; }
.lock-button { height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; font-size: 12px; font-weight: 800; }
.lock-button:hover, .preset:hover { border-color: #8ee6b8; background: rgba(122, 231, 180, .12); }
.lock-button svg { width: 12px; }
.lock-button.is-unlocked { color: #ffe1a7; border-color: rgba(237, 189, 88, .55); background: rgba(235, 171, 49, .12); }
.preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.preset { height: 34px; padding: 0; font: 500 12px "DM Mono", monospace; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 15px; cursor: pointer; }
.check-row input { width: 14px; height: 14px; accent-color: #86e7b6; }
.panel-note { position: relative; z-index: 1; display: flex; gap: 8px; align-items: center; padding-top: 19px; color: #d7ecdf; font-size: 13px; }
.panel-note svg { width: 14px; color: #8ee6b8; }

.work-area {
  min-height: 545px;
  overflow: hidden;
  border: 1px solid rgba(218, 230, 222, .9);
  background: rgba(255,255,255,.84);
}
.dropzone {
  position: relative;
  min-height: 545px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  overflow: hidden;
  border: 2px dashed transparent;
  border-radius: 20px;
  outline: none;
  text-align: center;
  transition: background .2s, border-color .2s;
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px dashed #d9e8de;
  border-radius: 15px;
  background-image: radial-gradient(#d8e7de 1px, transparent 1px);
  background-size: 17px 17px;
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  pointer-events: none;
}
.dropzone > * { position: relative; z-index: 1; }
.dropzone:focus-visible { box-shadow: inset 0 0 0 3px #a9e8c9; }
.dropzone.is-dragging { border-color: #40b77d; background: #effcf5; }
.dropzone.is-dragging::before { border-color: #82dca9; }
.dropzone-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  place-items: center;
  border: 8px solid #f3fbf6;
  border-radius: 23px;
  color: #167653;
  background: linear-gradient(145deg, #d8f7e6, #baf0d0);
  box-shadow: 0 14px 25px rgba(45, 146, 96, .16);
}
.dropzone-icon svg { width: 28px; height: 28px; }
.dropzone h2 { color: var(--forest-deep); font-size: 23px; }
.dropzone p { margin: 8px 0 22px; color: var(--muted); font-size: 14px; }
.supported-formats { margin-top: 19px; color: #809388; font: 500 12px "DM Mono", monospace; letter-spacing: .08em; }
.primary-button, .text-button, .icon-button { border: 0; background: transparent; color: inherit; }
.primary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #0b3424;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #206044, #113c2b);
  box-shadow: 0 5px 0 #092418, 0 10px 18px rgba(12, 53, 35, .18);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 0 #092418, 0 14px 20px rgba(12, 53, 35, .22); }
.primary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #092418, 0 6px 11px rgba(12, 53, 35, .15); }
.primary-button:disabled { cursor: wait; opacity: .6; transform: none; }
.primary-button svg, .text-button svg { width: 16px; height: 16px; }
.spin { animation: spin .8s linear infinite; }
.icon-button {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.control-panel .icon-button { color: #b9d2c2; }
.icon-button:hover { color: var(--forest-deep); border-color: #d3e2d8; background: #f4f8f5; }
.control-panel .icon-button:hover { color: #fff; border-color: rgba(209, 243, 222, .22); background: rgba(255,255,255,.1); }
.icon-button svg { width: 16px; height: 16px; }
.icon-button[data-tooltip]::after { content: attr(data-tooltip); position: absolute; z-index: 5; top: calc(100% + 7px); right: 0; padding: 6px 8px; opacity: 0; pointer-events: none; border-radius: 4px; color: #fff; background: #173629; box-shadow: 0 4px 12px rgba(0,0,0,.13); font: 500 12px "DM Mono", monospace; white-space: nowrap; transition: opacity .15s; }
.icon-button[data-tooltip]:hover::after { opacity: 1; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 5px; color: #1a7857; font-size: 13px; font-weight: 800; }
.text-button:hover { color: var(--forest-deep); }

.queue { min-height: 545px; padding: 24px; }
.queue-toolbar { min-height: 34px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.queue-count { color: var(--muted); font: 500 12px "DM Mono", monospace; }
.toolbar-divider { display: inline-block; width: 1px; height: 13px; margin: 0 9px -2px; background: var(--line); }
.toolbar-actions { display: flex; align-items: center; gap: 5px; }
.file-list, .result-list { display: grid; gap: 9px; margin-top: 18px; }
.file-item, .result-item {
  min-height: 76px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 13px;
  padding: 9px;
  border: 1px solid #e7eee9;
  border-radius: 13px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.file-item:hover, .result-item:hover { border-color: #c8ded0; box-shadow: 0 7px 18px rgba(17, 65, 42, .06); }
.thumb-wrap { width: 58px; height: 58px; overflow: hidden; border-radius: 9px; background: #edf3ef; }
.file-thumb, .result-thumb { display: block; width: 100%; height: 100%; object-fit: cover; }
.file-details, .result-details { display: grid; min-width: 0; gap: 5px; }
.file-details strong, .result-details strong { overflow: hidden; color: #263b30; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.file-meta, .result-meta { color: var(--muted); font: 400 12px "DM Mono", monospace; }
.process-footer { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.process-footer p { margin: 0; color: var(--muted); font-size: 13px; }
.results { margin: 0 24px 24px; padding-top: 25px; border-top: 1px solid var(--line); }
.results-head { margin-bottom: 17px; }
.results-head h2 { color: var(--forest-deep); font-size: 20px; }
.result-item { grid-template-columns: 58px minmax(0, 1fr) auto 32px; }
.saved-badge { padding: 6px 8px; border-radius: 6px; color: #15704f; background: #e3f8ec; font: 500 12px "DM Mono", monospace; }
.hidden { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .control-panel { padding: 19px; }
}

@media (max-width: 760px) {
  .topbar { width: min(100% - 24px, 1248px); height: 64px; margin-top: 12px; padding: 0 12px 0 8px; border-radius: 15px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 11px; }
  .privacy-status { width: 36px; height: 36px; justify-content: center; padding: 0; }
  .privacy-status span { display: none; }
  .workspace { width: min(100% - 24px, 1248px); padding: 37px 0 48px; }
  .intro { margin: 0 2px 24px; }
  h1 { font-size: 31px; }
  .output-format { display: none; }
  .tool-picker { grid-template-columns: 1fr; gap: 9px; margin-bottom: 14px; }
  .tool-choice { min-height: 74px; grid-template-columns: 40px minmax(0, 1fr) 18px; padding: 12px; border-radius: 13px; }
  .tool-choice-icon { width: 40px; height: 40px; border-radius: 11px; }
  .tool-layout { grid-template-columns: 1fr; gap: 14px; }
  .control-panel, .work-area { border-radius: 16px; }
  .work-area { min-height: 430px; }
  .dropzone { min-height: 430px; padding: 40px 20px; border-radius: 16px; }
  .dropzone::before { inset: 14px; }
  .queue { min-height: 430px; padding: 15px; }
  .control-panel { padding: 18px; }
  .results { margin: 0 15px 15px; }
  .process-footer { align-items: stretch; flex-direction: column; }
  .process-footer .primary-button { width: 100%; }
  .result-item { grid-template-columns: 48px minmax(0, 1fr) 32px; }
  .result-item .thumb-wrap { width: 48px; height: 48px; }
  .saved-badge { display: none; }
}
