:root {
  color-scheme: light dark;
  --ink: #15312f;
  --muted: #536765;
  --panel: #f7fbf8;
  --field: #fff;
  --line: #b8c9c1;
  --brand: #0e5b55;
  --brand-dark: #083d39;
  --accent: #d9ff76;
  --danger: #9b2c20;
  --focus: #ef7d00;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); background: var(--panel); font: 16px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 44px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#tool-root { padding: clamp(17px, 4vw, 30px); }
.loading { color: var(--muted); text-align: center; }
.tool-head { margin-bottom: 20px; }
.tool-head h2 { margin: 0 0 6px; font-size: clamp(1.35rem, 4vw, 2rem); line-height: 1.15; }
.tool-head p { margin: 0; color: var(--muted); }
.output-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-bottom: 14px; }
.output, textarea.output { width: 100%; min-width: 0; padding: 12px 14px; border: 2px solid var(--brand); border-radius: 11px; color: var(--ink); background: var(--field); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; }
textarea.output { min-height: 180px; resize: vertical; }
.controls { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.field { display: grid; gap: 5px; }
.field > span, fieldset legend { font-size: .86rem; font-weight: 720; }
input[type="number"], input[type="text"], input[type="password"], select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--field); }
input[type="range"] { width: 100%; }
fieldset { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px 12px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.check input { width: 18px; height: 18px; min-height: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 5px; }
button { padding: 9px 15px; border: 1px solid var(--brand); border-radius: 10px; color: #fff; background: var(--brand); font-weight: 720; cursor: pointer; }
button:hover { background: var(--brand-dark); }
button.secondary { color: var(--brand-dark); background: transparent; }
.presets { display: flex; flex-wrap: wrap; gap: 7px; }
.presets button { min-height: 36px; padding: 5px 11px; color: var(--ink); border-color: var(--line); background: var(--field); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.metric { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); }
.metric strong { display: block; font-size: 1.04rem; }
.metric span { color: var(--muted); font-size: .75rem; }
.feedback { min-height: 24px; margin: 8px 0 0; color: var(--brand); font-size: .88rem; }
.error { color: var(--danger); font-weight: 650; }
.note { margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; color: var(--muted); background: color-mix(in srgb, var(--brand) 7%, transparent); font-size: .84rem; }
.bar { height: 11px; overflow: hidden; border-radius: 999px; background: #d8e1dc; }
.bar > span { display: block; width: 0; height: 100%; background: var(--danger); transition: width .15s ease; }
ul.feedback-list { margin: 9px 0 0; padding-left: 20px; color: var(--muted); }
@media (max-width: 540px) { .grid-2, .metrics { grid-template-columns: 1fr; } .checks { grid-template-columns: 1fr; } .output-row { grid-template-columns: 1fr; } #tool-root { padding: 16px; } }
@media (prefers-color-scheme: dark) { :root { --ink: #e9f4ef; --muted: #aabdb6; --panel: #0d201e; --field: #142c29; --line: #3a5751; --brand: #4ab5a6; --brand-dark: #3c9a8d; --danger: #ff9387; } button.secondary { color: #d9ff76; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
