:root {
  --bg: #080a08;
  --surface: #0e110e;
  --surface-2: #141814;
  --surface-3: #1a1f1a;
  --line: #252c25;
  --line-strong: #354035;
  --text: #f2f6ef;
  --muted: #8e998c;
  --dim: #606a5f;
  --accent: #a7ff35;
  --accent-2: #6ae68e;
  --danger: #ff6577;
  --warning: #ffce5c;
  --radius: 14px;
  --shadow: 0 24px 90px rgba(0, 0, 0, .46);
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(167, 255, 53, .08), transparent 31rem),
    linear-gradient(rgba(255, 255, 255, .012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .012) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  accent-color: var(--accent);
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hidden { display: none !important; }

.app-container {
  width: min(1680px, calc(100% - 40px));
  max-width: 1680px;
  margin: 0 auto;
  padding: 58px 0 76px;
}

.tool-header {
  margin: 0 auto 35px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
}

.tool-header h1 {
  margin: 13px 0 9px;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  font-weight: 300;
  line-height: .98;
  letter-spacing: -.055em;
}

.tool-header h1 span {
  color: var(--accent);
  font-weight: 700;
}

.tool-header h1 b {
  display: inline-block;
  margin-left: 7px;
  padding: 5px 8px;
  transform: translateY(-1.4em);
  border: 1px solid rgba(167, 255, 53, .45);
  border-radius: 5px;
  color: var(--accent);
  background: rgba(167, 255, 53, .06);
  font-size: .58rem;
  letter-spacing: .12em;
}

.tool-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.drop-zone {
  position: relative;
  isolation: isolate;
  min-height: 490px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px dashed #394537;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 48%, rgba(167, 255, 53, .075), transparent 20rem),
    rgba(12, 15, 12, .86);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}

.drop-zone::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .025) 48%, transparent 65%);
  transform: translateX(-100%);
  transition: transform .7s;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background-color: #101510;
}

.drop-zone:hover::after,
.drop-zone.dragging::after {
  transform: translateX(100%);
}

.drop-rings,
.drop-rings i {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 380px;
  height: 380px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(167, 255, 53, .045);
  border-radius: 50%;
  pointer-events: none;
}

.drop-rings i:first-child {
  width: 270px;
  height: 270px;
}

.drop-rings i:last-child {
  width: 510px;
  height: 510px;
}

.drop-content {
  position: relative;
  z-index: 1;
  max-width: 660px;
  padding: 50px 24px;
  text-align: center;
}

.drop-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(167, 255, 53, .35);
  border-radius: 23px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(167, 255, 53, .13), rgba(167, 255, 53, .02));
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 18px 50px rgba(0, 0, 0, .42);
}

.drop-icon svg {
  width: 43px;
  height: 43px;
  stroke-width: 1.5;
}

.drop-content h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  letter-spacing: -.03em;
}

.drop-content > p {
  margin: 8px 0 17px;
  color: var(--muted);
}

.drop-content > small {
  color: var(--dim);
  font-size: .71rem;
  font-weight: 600;
  letter-spacing: .11em;
}

.drop-actions {
  margin-top: 27px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.btn {
  min-height: 42px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #dce4da;
  background: #161b16;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .17s, border-color .17s, background .17s, color .17s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #566552;
  background: #1c231b;
}

.btn.primary {
  border-color: var(--accent);
  color: #0a0d08;
  background: var(--accent);
  box-shadow: 0 8px 30px rgba(167, 255, 53, .12);
}

.btn.primary:hover:not(:disabled) {
  border-color: #c3ff7b;
  background: #b9ff68;
}

.btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.btn.cancel {
  min-height: 34px;
  margin-top: 18px;
  padding: 0 13px;
  border-color: rgba(255, 101, 119, .35);
  color: #ff8e9b;
  background: rgba(255, 101, 119, .08);
  font-size: .72rem;
}

.privacy {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #768174;
  font-size: .74rem;
}

.privacy svg {
  width: 14px;
  height: 14px;
  color: var(--accent-2);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 17, 14, .95);
  box-shadow: 0 15px 45px rgba(0, 0, 0, .19);
}

.panel-head {
  min-height: 74px;
  padding: 18px 18px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.panel-head > div:last-child,
.preview-head > div:last-child {
  display: flex;
  gap: 5px;
}

.panel-head em,
.result em {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: .58rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .14em;
}

.panel-head h2 {
  margin: 0;
  font-size: .96rem;
  font-weight: 600;
}

.panel-head h2 span {
  margin-left: 5px;
  color: var(--muted);
  font-size: .72rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #111511;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}

.icon-btn:hover {
  border-color: #485546;
  color: var(--text);
  background: #181d18;
}

.icon-btn.danger:hover {
  border-color: rgba(255, 101, 119, .4);
  color: var(--danger);
}

.setting {
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}

.setting.compact {
  padding-top: 5px;
  padding-bottom: 5px;
}

.setting-title,
.slider-title {
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.block-label,
.setting-title label,
.slider-title label {
  display: block;
  color: #ccd4c9;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.setting-title span {
  padding: 3px 6px;
  border: 1px solid rgba(167, 255, 53, .25);
  border-radius: 4px;
  color: var(--accent);
  background: rgba(167, 255, 53, .05);
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.preset-grid,
.format-grid {
  display: grid;
  gap: 6px;
}

.preset-grid { grid-template-columns: repeat(2, 1fr); }
.format-grid { grid-template-columns: repeat(4, 1fr); margin-top: 10px; }

.preset,
.format {
  min-width: 0;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #c8d0c5;
  background: #111511;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}

.preset b,
.preset small,
.format b,
.format small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset b {
  font-size: .72rem;
  font-weight: 600;
}

.preset small,
.format small {
  margin-top: 2px;
  color: #657063;
  font-size: .58rem;
}

.format {
  min-height: 49px;
  padding: 8px 6px;
  text-align: center;
}

.format b {
  font-size: .69rem;
}

.preset:hover,
.format:hover {
  border-color: #4c5949;
}

.preset.active,
.format.active {
  border-color: rgba(167, 255, 53, .7);
  color: var(--accent);
  background: rgba(167, 255, 53, .065);
  box-shadow: inset 0 0 0 1px rgba(167, 255, 53, .04);
}

.tabs {
  height: 45px;
  padding: 0 18px;
  display: flex;
  align-items: end;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.tab {
  height: 45px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #717b6f;
  background: none;
  font-size: .71rem;
  font-weight: 700;
  cursor: pointer;
}

.tab:hover { color: #bdc6ba; }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }

.select-row,
.toggle {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(37, 44, 37, .75);
}

.select-row:last-child,
.toggle:last-child {
  border-bottom: 0;
}

.select-row > span,
.toggle > span {
  min-width: 0;
  color: #cbd3c8;
  font-size: .75rem;
}

.select-row small,
.toggle small {
  display: block;
  margin-top: 2px;
  color: #606b5e;
  font-size: .59rem;
}

select {
  width: 148px;
  height: 34px;
  padding: 0 29px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #cdd5cb;
  background: #151a15;
  font-size: .68rem;
  cursor: pointer;
}

.toggle {
  position: relative;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle i {
  position: relative;
  flex: 0 0 auto;
  width: 37px;
  height: 21px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #171b17;
  transition: background .2s, border-color .2s;
}

.toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #6e786c;
  transition: transform .2s, background .2s;
}

.toggle input:checked + i {
  border-color: var(--accent);
  background: rgba(167, 255, 53, .17);
}

.toggle input:checked + i::after {
  transform: translateX(16px);
  background: var(--accent);
}

.slider-title output {
  color: var(--accent);
  font-size: .67rem;
  font-weight: 600;
}

.pro-slider {
  width: 100%;
  height: 4px;
  margin: 4px 0;
  cursor: pointer;
}

.range-labels {
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
  color: #596256;
  font-size: .55rem;
}

.command {
  margin: 13px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.command summary {
  padding: 10px 11px;
  color: #9ea79b;
  background: #111511;
  font-size: .64rem;
  cursor: pointer;
  user-select: none;
}

.command summary b {
  float: right;
  color: var(--accent);
  font-size: .5rem;
}

.command code {
  display: block;
  max-height: 130px;
  overflow: auto;
  padding: 11px;
  color: #a8b8a4;
  background: #090c09;
  font: .61rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.estimate {
  margin: 15px 18px 20px;
  overflow: hidden;
  border: 1px solid #33402f;
  border-radius: 9px;
  background: linear-gradient(140deg, rgba(167, 255, 53, .055), rgba(255, 255, 255, .01));
}

.estimate header {
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(167, 255, 53, .13);
  color: #899585;
  font-size: .54rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.estimate header b { color: var(--accent); }

.estimate > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.estimate > div span {
  min-width: 0;
  padding: 12px 8px;
  border-right: 1px solid rgba(167, 255, 53, .1);
}

.estimate > div span:last-child { border-right: 0; }

.estimate small,
.estimate b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate small {
  margin-bottom: 3px;
  color: #647061;
  font-size: .51rem;
}

.estimate b {
  color: #d8e2d4;
  font-size: .71rem;
}

.estimate p {
  margin: 0;
  padding: 9px 11px;
  border-top: 1px solid rgba(167, 255, 53, .1);
  color: #778273;
  font-size: .59rem;
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  max-width: min(430px, calc(100vw - 32px));
  padding: 12px 16px;
  transform: translateX(-50%);
  border: 1px solid #3d493a;
  border-radius: 8px;
  color: #dce5d9;
  background: rgba(19, 24, 18, .97);
  box-shadow: 0 15px 50px rgba(0, 0, 0, .5);
  font-size: .76rem;
}

.toast.error {
  border-color: rgba(255, 101, 119, .45);
  color: #ffabb5;
}

@media (max-width: 720px) {
  .app-container {
    width: min(100% - 22px, 1680px);
    padding-top: 38px;
  }

  .drop-zone { min-height: 450px; }
  .drop-actions { flex-direction: column; }
  .drop-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
