/* Layout: one narrow column. Brand bar, two tool tabs, one active tool panel. Everything runs in the browser. */
:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --ink: #12201a;
  --muted: #5a6a62;
  --line: #d5dfd9;
  --accent: #0a7a55;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe6;
  --warn: #a8480f;
  --warn-soft: #f8e6d8;
  --font-display: "Space Grotesk", "Hind Siliguri", system-ui, sans-serif;
  --r: 16px;
  --font-body: "Inter", "Hind Siliguri", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1511; --surface: #15201a; --ink: #e6efe9; --muted: #96a89e; --line: #263329;
    --accent: #3ec58f; --accent-ink: #06130d; --accent-soft: #17382b; --warn: #f0a46c; --warn-soft: #3a2616;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1511; --surface: #15201a; --ink: #e6efe9; --muted: #96a89e; --line: #263329;
  --accent: #3ec58f; --accent-ink: #06130d; --accent-soft: #17382b; --warn: #f0a46c; --warn-soft: #3a2616;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 880px; margin: 0 auto; }
h1, h2 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang button { border: 0; background: transparent; padding: 5px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; min-height: 32px; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.intro { padding-bottom: 24px; }
.intro h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; font-weight: 700; max-width: 18ch; }
.intro p { color: var(--muted); max-width: 52ch; margin: 12px 0 0; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { flex: 1 1 200px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: calc(var(--r) * .75); padding: 12px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tab b { font-family: var(--font-display); font-size: 16px; }
.tab span { color: var(--muted); font-size: 13px; }
.tab[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 4vw, 28px); }
.panel h2 { font-size: 22px; }
.panel .lead { color: var(--muted); margin: 6px 0 18px; max-width: 60ch; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 32px 16px; border: 2px dashed var(--line); border-radius: calc(var(--r) * .75); cursor: pointer; background: var(--bg); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-family: var(--font-display); font-size: 17px; }
.drop small { color: var(--muted); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: calc(var(--r) * .6); font-weight: 600; cursor: pointer; min-height: 42px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: calc(var(--r) * .75); margin-bottom: 14px; }
.file .name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.file .meta { color: var(--muted); font-size: 13px; }
.bar { height: 8px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.msg { color: var(--muted); font-size: 14px; min-height: 1.5em; }
.msg.err { color: var(--warn); }
.note { background: var(--warn-soft); color: var(--ink); border-radius: calc(var(--r) * .6); padding: 10px 12px; font-size: 13.5px; margin-top: 14px; }
.privacy { color: var(--muted); font-size: 13px; margin-top: 16px; display: flex; gap: 8px; align-items: flex-start; }

.img-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 720px) { .img-grid { grid-template-columns: minmax(0, 1fr); } }
.ctrl { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.in { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 10px; min-height: 40px; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; min-height: 32px; }
.chip:hover { border-color: var(--accent); }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.preview { background: var(--bg); border: 1px solid var(--line); border-radius: calc(var(--r) * .75); padding: 10px; display: grid; place-items: center; min-height: 220px; overflow: hidden; }
.preview img { max-width: 100%; max-height: 420px; border-radius: 6px; display: block; }
.stats { display: flex; gap: 8px 24px; flex-wrap: wrap; margin: 12px 0; font-variant-numeric: tabular-nums; }
.stats div { display: flex; flex-direction: column; }
.stats small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stats b { font-family: var(--font-display); font-size: 18px; }
.good { color: var(--accent); }
footer { color: var(--muted); font-size: 13px; padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.brand .logo { height: 34px; max-width: 170px; width: auto; object-fit: contain; display: block; }
.brand-name { min-width: 0; overflow-wrap: anywhere; }
.tab[hidden] { display: none; }
