:root {
  color-scheme: light;
  --ink: #19342f;
  --muted: #5a6b63;
  --green: #17654d;
  --line: #d6e0d8;
  --paper: #fff;
  --bg: #f3f6f1;
  font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, summary { outline-offset: 3px; }
button { background: #fff; border: 1px solid #bfcfc3; border-radius: 8px; color: var(--ink); padding: 8px 14px; font-weight: 650; cursor: pointer; white-space: nowrap; }
button:hover { background: #eaf3eb; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--green); border-color: var(--green); color: #fff; }
.primary:hover { background: #124e3c; }
.topbar { position: sticky; top: 0; z-index: 2; min-height: 64px; padding: 8px clamp(12px, 3vw, 40px); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff; border-bottom: 1px solid var(--line); }
.brand, nav, .top-actions { display: flex; align-items: center; gap: 10px; }
.mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--green); color: #fff; font-size: 19px; }
nav { gap: 3px; background: var(--bg); padding: 4px; border-radius: 10px; }
[role="tab"] { border-color: transparent; background: transparent; padding: 6px 16px; }
[aria-selected="true"] { background: #fff; border-color: var(--line); color: var(--green); }
.quiet { border-color: transparent; font-size: 13px; }
.local, .badge { font-size: 12px; background: #e7f1e8; border: 1px solid #cfe1d3; border-radius: 100px; padding: 5px 9px; white-space: nowrap; }
iframe { width: 100%; height: calc(100dvh - 64px); border: 0; display: block; background: var(--bg); }
main { max-width: 1390px; margin: auto; padding: 28px clamp(12px, 3vw, 38px) 40px; }
.heading, .result-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.heading { margin-bottom: 20px; }
.eyebrow { color: var(--green); font-size: 11px; letter-spacing: 1.5px; font-weight: 750; margin: 0 0 4px; }
h1 { margin: 0; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.6px; }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
.subtitle, .card p { color: var(--muted); }
.workspace { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.settings-column, fieldset, #settings-groups { display: grid; gap: 12px; min-width: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card summary { font-weight: 700; cursor: pointer; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px 12px; }
.top-gap, details .fields { margin-top: 12px; }
.path-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 5px 0 10px; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 650; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; padding: 8px; border-radius: 7px; border: 1px solid #bfcfc3; background: #fff; color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { opacity: .65; }
.check { display: flex; align-items: center; align-self: end; min-height: 36px; }
.check input { accent-color: var(--green); }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline label { flex: 1 1 130px; }
.job-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.result { position: sticky; top: 80px; }
.result-title h2 { margin-bottom: 0; }
#job-message { margin: 10px 0; }
pre { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7faf7; overflow: auto; max-height: 52vh; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, Consolas, monospace; }
.confirmation { background: #fff7df; border: 1px solid #e4d49f; border-radius: 8px; padding: 12px; }
#output-files { padding-left: 20px; max-height: 160px; overflow: auto; overflow-wrap: anywhere; }
.error { color: #a53226 !important; }
#session-message { padding: 12px 24px; }
.login-page { display: grid; place-items: center; min-height: 85vh; }
.login-form { display: grid; gap: 16px; padding: 26px; width: min(100%, 440px); }
.users-page { max-width: 1040px; }
.users-form { display: grid; gap: 12px; }
.user-list { margin: 0; padding: 0; list-style: none; }
.user-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.download-output { display: inline-block; padding: 8px 14px; border-radius: 8px; background: var(--green); color: white; font-weight: 650; }
#upload-status { margin-top: 8px; }
@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .result { position: static; }
}
@media (max-width: 560px) {
  .topbar { gap: 6px; }
  .top-actions { margin-left: auto; }
  .local { display: none; }
  nav { order: 2; width: 100%; }
  nav button { flex: 1; }
  iframe { height: calc(100dvh - 104px); }
  .heading { align-items: flex-start; flex-direction: column; }
}
