:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5b6573;
  --line: #d9d5cc;
  --brand: #0f4c5c;
  --brand-ink: #ffffff;
  --accent: #e36414;
  --error: #b42318;
  --focus: #f4b400;
  --hero-bg: #0f4c5c;
  --hero-text: #f6f4ef;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171d;
    --card: #1b222b;
    --text: #e8ebef;
    --muted: #a2acb8;
    --line: #333d49;
    --brand: #5fb3c6;
    --brand-ink: #0b1a1f;
    --accent: #f08a4b;
    --error: #ff8a80;
    --hero-bg: #0b3540;
    --hero-text: #eef3f4;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--brand); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.hero { background: var(--hero-bg); color: var(--hero-text); padding: 40px 0 44px; margin-bottom: 24px; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); line-height: 1.15; margin: 8px 0 14px; letter-spacing: -0.01em; }
.hero .lead { font-size: 1.08rem; margin: 0; opacity: 0.95; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 20px;
  margin-bottom: 18px;
}
.card h2 { font-size: 1.3rem; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  font-size: 0.95rem; flex: none;
}

label { display: block; font-weight: 600; margin: 14px 0 6px; }
.opt { font-weight: 400; color: var(--muted); font-size: 0.9em; }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
textarea { resize: vertical; line-height: 1.5; }
#body { font-size: 0.95rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--brand);
}

.row { display: flex; gap: 10px; }
.row input { flex: 1; min-width: 0; text-transform: uppercase; }
.wrap-row { flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid var(--brand);
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.big { width: 100%; padding: 15px 18px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.6; cursor: wait; }

.link {
  font: inherit; background: none; border: 0; padding: 0;
  color: var(--brand); text-decoration: underline; cursor: pointer;
}
#reset-letter { margin-top: 8px; font-size: 0.9rem; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.error { color: var(--error); font-weight: 600; margin: 10px 0 0; }
.hint { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; padding: 10px 12px; font-size: 0.92rem; }

#address-select-wrap { margin-top: 4px; }
#address-select { border-color: var(--brand); }

.mp { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mp img { border-radius: 50%; object-fit: cover; flex: none; background: var(--line); }
.mp p { margin: 0; }
.mp-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.mp-name { font-size: 1.25rem; font-weight: 700; }
.mp-mail { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; word-break: break-all; margin-top: 4px !important; }

fieldset.roles { border: 0; padding: 0; margin: 18px 0 0; }
fieldset.roles legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.choice { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 6px 0; cursor: pointer; }
.choice input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }

.field-note { margin: 6px 0 0; }
#salary-hint { margin-top: 8px; }

details.personal { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.personal summary { font-weight: 700; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.send { margin-top: 18px; }
.send .alt { text-align: center; margin: 12px 0; }

.share-preview {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.facts { padding: 6px 4px 0; }
.facts h2 { font-size: 1.15rem; }
.facts li { margin-bottom: 8px; }

footer { padding: 8px 4px 40px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  max-width: calc(100% - 32px);
}

@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .row:not(.wrap-row) { flex-direction: column; }
  .card { padding: 18px 16px; }
  .hero { padding: 28px 0 32px; }
}
