:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #172033;
  background: #f5f7fb;
  --brand: #0b5cab;
  --brand-dark: #083f76;
  --border: #d7deea;
  --muted: #667085;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
.app-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  color: white;
  background: linear-gradient(135deg, #083f76, #0b78cf);
}
.app-header h1 { margin: 0; font-size: 20px; }
.app-header p { margin: 2px 0 0; opacity: .85; font-size: 12px; }
main { padding: 14px; display: grid; gap: 14px; }
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 3px 14px rgb(16 24 40 / 7%);
}
label { display: block; margin: 12px 0 5px; font-size: 12px; font-weight: 650; }
label:first-child { margin-top: 0; }
select, textarea, input {
  width: 100%;
  border: 1px solid #aeb8c8;
  border-radius: 7px;
  padding: 9px 10px;
  background: white;
  color: inherit;
  font: inherit;
}
textarea { resize: vertical; min-height: 115px; }
select:focus, textarea:focus, input:focus, button:focus-visible {
  outline: 2px solid #66a9e8;
  outline-offset: 1px;
}
.button-row { display: flex; gap: 8px; margin-top: 14px; }
button {
  flex: 1;
  border-radius: 7px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
.primary { border: 1px solid var(--brand); color: white; background: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.secondary { border: 1px solid #aeb8c8; color: #24324a; background: white; }
.result-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.result-heading h2 { margin: 0; font-size: 16px; }
#resultStatus { color: var(--muted); font-size: 11px; }
#resultText {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 330px;
  overflow: auto;
  padding: 10px;
  background: #f7f9fc;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
}
.safety-note { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.error { margin: 0; padding: 10px; border-radius: 7px; color: #8a1c1c; background: #ffe7e7; }
.hidden { display: none !important; }

@media (prefers-color-scheme: dark) {
  :root { color: #edf2f8; background: #171b24; --border: #384253; --muted: #aeb8c8; }
  .card, select, textarea, input, .secondary { background: #222936; color: #edf2f8; }
  #resultText { background: #171d27; }
}

