:root {
  --ink: #20251f;
  --muted: #7c8379;
  --soft-muted: #aab0a5;
  --line: #e5e9e1;
  --paper: #fafbf8;
  --white: #ffffff;
  --lime: #c5f36b;
  --lime-strong: #a9de4a;
  --green: #526b3a;
  --shadow: 0 24px 70px rgba(41, 59, 30, 0.08), 0 2px 7px rgba(41, 59, 30, 0.04);
  --sans: "Manrope", "Noto Sans SC", sans-serif;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-visible { outline: 3px solid rgba(169, 222, 74, .55); outline-offset: 3px; }

.app-shell { max-width: 1380px; min-height: 100vh; margin: auto; padding: 0 56px 40px; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.06em; }
.brand-dot { color: var(--lime-strong); }
.brand-mark { width: 25px; height: 25px; padding: 5px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border: 1.5px solid var(--ink); transform: rotate(-10deg); }
.brand-mark i { display: block; background: var(--ink); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--lime-strong); }
.topbar-note { display: flex; align-items: center; gap: 8px; font-family: var(--mono); color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.status-dot, .live-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--lime-strong); box-shadow: 0 0 0 4px rgba(169, 222, 74, .16); }

.intro { text-align: center; padding: 78px 0 50px; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; color: #92998d; font-family: var(--mono); font-size: 10px; letter-spacing: .15em; }
.eyebrow-line { width: 27px; height: 1px; background: var(--lime-strong); }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 21px; font-size: clamp(37px, 4.3vw, 59px); line-height: 1.16; font-weight: 700; letter-spacing: -.065em; }
h1 em { color: var(--green); font-style: normal; position: relative; }
h1 em::after { content: ""; position: absolute; left: 2px; right: 3px; bottom: -7px; height: 7px; background: var(--lime); z-index: -1; transform: rotate(-1.5deg); }
.intro-copy { margin-top: 19px; color: var(--muted); font-size: 14px; letter-spacing: .02em; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 355px; min-height: 618px; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.workspace-main { min-width: 0; padding: 35px 36px 29px; }
.workspace-heading, .settings-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.section-kicker { display: block; color: #a0a89c; font-family: var(--mono); font-size: 10px; letter-spacing: .09em; }
h2 { margin-top: 5px; font-size: 20px; letter-spacing: -.04em; }
.file-limit { padding-top: 9px; color: var(--soft-muted); font-family: var(--mono); font-size: 9px; letter-spacing: .03em; }

.dropzone { min-height: 145px; margin-top: 25px; display: flex; align-items: center; justify-content: center; border: 1.5px dashed #ccd5c6; border-radius: 9px; background: #fcfdfb; transition: .2s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--lime-strong); background: #fbfff4; }
.dropzone-content { text-align: center; }
.upload-icon { width: 30px; height: 30px; margin: 0 auto 8px; position: relative; border: 1.5px solid #99a894; border-radius: 5px; }
.upload-icon::before { content: ""; width: 10px; height: 10px; position: absolute; left: 8px; top: 7px; border: 1.5px solid var(--green); border-radius: 50%; }
.upload-icon span { width: 11px; height: 1.5px; position: absolute; background: var(--green); bottom: 6px; }
.upload-icon span:first-of-type { left: 4px; transform: rotate(-45deg); }
.upload-icon span:last-of-type { right: 3px; transform: rotate(45deg); }
.dropzone h3 { font-size: 14px; font-weight: 700; }
.dropzone p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 11px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.drop-hint { display: block; margin-top: 14px; color: var(--soft-muted); font-family: var(--mono); font-size: 9px; letter-spacing: .03em; }
.dropzone-loaded { width: min(85%, 410px); display: flex; align-items: center; gap: 12px; }
.loaded-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #46612c; background: var(--lime); font-weight: 800; }
.loaded-copy { flex: 1; min-width: 0; text-align: left; }
.loaded-copy strong, .loaded-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loaded-copy strong { font-size: 13px; }
.loaded-copy span { margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); background: var(--white); font-size: 18px; transition: .2s; }
.icon-button:hover { border-color: var(--lime-strong); background: #fbfff4; }

.preview-area { margin-top: 23px; }
.preview-toolbar { height: 31px; display: flex; align-items: center; justify-content: space-between; }
.toolbar-label { display: flex; align-items: center; gap: 9px; color: var(--green); font-family: var(--mono); font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.preview-switch { padding: 3px; display: flex; border: 1px solid var(--line); border-radius: 6px; background: #f7f9f4; }
.preview-tab { padding: 5px 11px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 10px; }
.preview-tab.active { color: var(--ink); background: var(--white); box-shadow: 0 1px 4px rgba(39, 56, 30, .08); font-weight: 700; }
.preview-frame { height: 302px; margin-top: 8px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f1; }
.checkerboard { position: absolute; inset: 0; opacity: .43; background-image: linear-gradient(45deg, #e5e9e2 25%, transparent 25%), linear-gradient(-45deg, #e5e9e2 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e9e2 75%), linear-gradient(-45deg, transparent 75%, #e5e9e2 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0px; }
.preview-frame img { max-width: 92%; max-height: 88%; position: relative; display: block; object-fit: contain; box-shadow: 0 7px 20px rgba(49, 60, 43, .13); transition: opacity .15s; }
.preview-empty { position: absolute; z-index: 2; padding: 8px 12px; border-radius: 5px; color: var(--green); background: rgba(255,255,255,.85); font-family: var(--mono); font-size: 10px; }
.preview-dimensions { position: absolute; right: 12px; bottom: 10px; z-index: 2; padding: 4px 6px; border: 1px solid rgba(224, 230, 219, .8); border-radius: 4px; color: var(--muted); background: rgba(255,255,255,.84); font-family: var(--mono); font-size: 9px; }
.preview-stats { display: flex; align-items: center; gap: 21px; padding-top: 15px; }
.preview-stats div:not(.stats-arrow):not(.save-badge) span, .preview-stats div:not(.stats-arrow):not(.save-badge) strong { display: block; }
.preview-stats span { color: var(--soft-muted); font-family: var(--mono); font-size: 9px; }
.preview-stats strong { margin-top: 3px; font-family: var(--mono); font-size: 11px; font-weight: 500; }
.stats-arrow { color: var(--lime-strong); font-size: 20px; }
.save-badge { margin-left: auto; padding: 6px 9px; border-radius: 5px; color: #7b8278; background: #f4f6f1; font-family: var(--mono); font-size: 9px; }
.save-badge.ready { color: #52752c; background: #eef9d9; }
.empty-tip { margin-top: 21px; color: #a6aea1; font-size: 10px; }
.empty-tip span { margin-right: 6px; color: var(--lime-strong); }

.settings-panel { display: flex; flex-direction: column; padding: 35px 29px 28px; border-left: 1px solid var(--line); background: #fbfcf9; }
.settings-heading { padding-bottom: 6px; }
.control-group { margin-top: 24px; }
.control-label { color: #3b4438; font-size: 11px; font-weight: 700; }
.control-note, .label-row .control-note { float: right; color: #abb2a7; font-family: var(--mono); font-size: 9px; font-weight: 400; letter-spacing: .04em; }
.select-wrap { position: relative; margin-top: 9px; }
.select-wrap::after { content: "⌄"; position: absolute; top: 7px; right: 12px; color: var(--green); font-size: 17px; pointer-events: none; }
select { width: 100%; padding: 10px 31px 10px 11px; border: 1px solid var(--line); border-radius: 6px; outline: none; color: var(--ink); background: var(--white); font-size: 11px; appearance: none; }
select:focus { border-color: var(--lime-strong); }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.label-row output { color: var(--green); font-family: var(--mono); font-size: 11px; }
.range-input { width: 100%; height: 4px; margin: 15px 0 8px; display: block; accent-color: var(--green); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: var(--soft-muted); font-family: var(--mono); font-size: 8px; }
.range-input:disabled { opacity: .35; cursor: not-allowed; }
.segmented { display: flex; margin-top: 9px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #f1f4ed; }
.segment { flex: 1; padding: 8px 5px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 10px; }
.segment.active { color: var(--ink); background: var(--white); box-shadow: 0 1px 4px rgba(39, 56, 30, .08); font-weight: 700; }
.dimension-card { margin-top: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.dimensions-grid { display: grid; grid-template-columns: 1fr 17px 1fr; gap: 7px; align-items: end; }
.dimensions-grid label, .crop-grid label { color: var(--muted); font-family: var(--mono); font-size: 8px; }
.dimensions-grid label span { float: right; color: #bbc2b8; font-size: 7px; }
.dimension-x { padding-bottom: 10px; color: #aeb6aa; text-align: center; font-family: var(--mono); font-size: 12px; }
.dimensions-grid input, .crop-grid input { width: 100%; min-width: 0; margin-top: 5px; padding: 8px 7px; border: 1px solid var(--line); border-radius: 5px; outline: none; color: var(--ink); background: #fcfdfb; font-family: var(--mono); font-size: 11px; }
.dimensions-grid input:focus, .crop-grid input:focus { border-color: var(--lime-strong); }
.check-row { min-height: 22px; margin-top: 11px; display: flex; align-items: center; gap: 7px; color: #5a6456; font-size: 10px; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; }
.fake-check { width: 14px; height: 14px; display: grid; place-items: center; border: 1px solid #b7c0b2; border-radius: 3px; color: transparent; background: var(--white); font-size: 10px; }
.check-row input:checked + .fake-check { border-color: var(--green); color: var(--green); background: var(--lime); }
.check-row small { margin-left: auto; color: #b0b8ad; font-family: var(--mono); font-size: 8px; }
.quick-sizes { display: flex; gap: 5px; margin-top: 11px; }
.quick-sizes button { padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #fbfcfa; font-family: var(--mono); font-size: 8px; }
.quick-sizes button:hover { border-color: var(--lime-strong); color: var(--green); }
.crop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 8px; }
.crop-help { margin-top: 11px; color: #9ca69a; font-size: 9px; line-height: 1.5; }
.crop-presets { margin-top: 12px; }

.settings-footer { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 25px; }
.reset-button { padding: 8px 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; white-space: nowrap; }
.reset-button:hover { color: var(--green); }
.primary-button { flex: 1; display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border: 0; border-radius: 6px; color: #27351f; background: var(--lime); font-size: 11px; font-weight: 800; transition: .2s; }
.primary-button b { font-size: 16px; font-weight: 500; line-height: 10px; }
.primary-button:hover:not(:disabled) { background: var(--lime-strong); transform: translateY(-1px); box-shadow: 0 5px 13px rgba(139, 184, 55, .2); }
.primary-button:disabled { color: #a1aa9b; background: #e9ede6; cursor: not-allowed; }
.shortcut-hint { margin-top: 12px; color: #b0b8ad; font-family: var(--mono); font-size: 8px; text-align: right; }

.how-it-works { max-width: 790px; margin: 42px auto 0; display: flex; align-items: center; justify-content: center; }
.how-item { display: flex; align-items: center; gap: 12px; }
.how-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #526c38; background: #edf8d9; font-family: var(--mono); font-size: 9px; }
.how-item strong { display: block; font-size: 11px; }
.how-item p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.how-connector { width: 75px; height: 1px; margin: 0 25px; background: var(--line); }
.footer { margin-top: 54px; display: flex; justify-content: space-between; color: #aab1a6; font-family: var(--mono); font-size: 9px; letter-spacing: .05em; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; padding: 11px 15px; border: 1px solid #dce8cf; border-radius: 7px; color: #4d672f; background: #f2f9e7; box-shadow: 0 10px 30px rgba(38, 59, 28, .12); font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .app-shell { padding: 0 24px 30px; }
  .workspace { grid-template-columns: 1fr; }
  .settings-panel { border-top: 1px solid var(--line); border-left: 0; }
  .settings-footer { margin-top: 20px; }
}
@media (max-width: 620px) {
  .app-shell { padding: 0 14px 24px; }
  .topbar { height: 72px; }
  .topbar-note { max-width: 180px; text-align: right; line-height: 1.4; }
  .intro { padding: 54px 0 35px; }
  h1 { font-size: 37px; }
  .intro-copy { font-size: 12px; }
  .workspace-main, .settings-panel { padding: 26px 18px 23px; }
  .file-limit { max-width: 145px; text-align: right; line-height: 1.5; }
  .preview-frame { height: 235px; }
  .preview-stats { gap: 11px; }
  .save-badge { display: none; }
  .how-it-works { align-items: flex-start; flex-direction: column; gap: 14px; margin-left: 20px; }
  .how-connector { width: 1px; height: 20px; margin: -7px 0 -7px 15px; }
  .footer { margin-top: 38px; font-size: 8px; }
}
