
:root {
  --bg: #f4f7fb;
  --surface: rgba(255,255,255,0.78);
  --surface-strong: rgba(255,255,255,0.9);
  --surface-soft: rgba(255,255,255,0.66);
  --text: #213042;
  --text-soft: rgba(33, 48, 66, 0.88);
  --text-faint: rgba(33, 48, 66, 0.68);
  --brand: #12395f;
  --accent: #0056b3;
  --brand-soft: rgba(0, 86, 179, 0.12);
  --border: rgba(16, 33, 60, 0.14);
  --border-strong: rgba(16, 33, 60, 0.22);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.08);
  --page-max: 1120px;
  --content-max: 860px;
}

html.dark {
  --bg: #0b1220;
  --surface: rgba(8,16,26,0.72);
  --surface-strong: rgba(8,16,26,0.84);
  --surface-soft: rgba(8,16,26,0.62);
  --text: #edf4fb;
  --text-soft: rgba(237,244,251,0.88);
  --text-faint: rgba(237,244,251,0.68);
  --brand: #f3f7fb;
  --accent: #8abcff;
  --brand-soft: rgba(138,188,255,0.16);
  --border: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.22);
  --shadow: 0 28px 90px rgba(0,0,0,0.34);
  --shadow-soft: 0 18px 48px rgba(0,0,0,0.28);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0,86,179,0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(0,86,179,0.05), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.62), transparent 24%),
    var(--bg);
}
html.dark body {
  background:
    radial-gradient(circle at top left, rgba(138,188,255,0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(138,188,255,0.04), transparent 22%),
    linear-gradient(180deg, rgba(8,16,26,0.4), transparent 24%),
    var(--bg);
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 12px;
  z-index: 3000;
  padding: 12px 20px 0;
}
.topbar-inner {
  width: min(100%, var(--page-max));
  margin: 0 auto;
  min-height: 56px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.topbar.scrolled .topbar-inner { background: var(--surface-strong); box-shadow: var(--shadow); }
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}
.brand-main {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.66rem;
  color: var(--text-faint);
}
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 86, 179, 0.3);
  color: var(--brand);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 160ms ease, transform 160ms ease;
}
.header-cta:hover { background: var(--brand-soft); transform: translateY(-1px); }
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.24);
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}
.theme-toggle:hover { background: var(--brand-soft); }
.theme-toggle svg { position: absolute; inset: 0; width: 18px; height: 18px; margin: auto; transition: opacity 180ms ease, transform 180ms ease; }
.icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
.icon-sun { opacity: 0; transform: rotate(-18deg) scale(0.92); }
html.dark .icon-moon { opacity: 0; transform: rotate(18deg) scale(0.92); }
html.dark .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }

.brand-link:focus-visible,
.header-cta:focus-visible,
.theme-toggle:focus-visible,
.modal-close:focus-visible,
.ghost-btn:focus-visible,
.send-btn:focus-visible,
.back-top:focus-visible,
.footer-sub a:focus-visible,
.breadcrumbs a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.article-shell {
  width: min(calc(100% - 40px), var(--page-max));
  margin: 22px auto 48px;
}
.article-frame {
  border: 1px solid var(--border);
  border-radius: 30px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 92%, transparent), color-mix(in srgb, var(--surface) 88%, transparent));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.article-header { padding: 24px 28px 8px; }
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: var(--text-faint);
  font-size: 0.92rem;
}
.breadcrumbs a { color: var(--text-faint); }
.breadcrumbs span:last-child { color: var(--text); }
.article-meta {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 0.9rem;
  font-weight: 700;
}
.article-headline {
  width: 100%;
  max-width: none;
  margin: 0 0 14px;
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-size: clamp(2.1rem, 5vw, 4.15rem);
  color: var(--brand);
  text-wrap: balance;
}
.article-lead {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.45vw, 1.12rem);
  line-height: 1.74;
}
.hero-figure-wrap { padding: 0 28px 16px; }
.hero-figure {
  margin: 16px 0 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, white), color-mix(in srgb, var(--surface) 96%, transparent));
}
.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 6.6;
  object-fit: cover;
}
.hero-figure figcaption {
  padding: 12px 16px;
  color: var(--text-faint);
  font-size: 0.92rem;
  border-top: 1px solid var(--border);
}
.article-content {
  width: min(calc(100% - 56px), var(--content-max));
  margin: 0 auto;
  padding: 6px 0 34px;
}
.article-content h2 {
  width: 100%;
  margin: 34px 0 14px;
  font-size: clamp(1.42rem, 2.2vw, 1.72rem);
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--brand);
}
.article-content h3 {
  margin: 26px 0 12px;
  font-size: 1.16rem;
  line-height: 1.32;
  color: var(--brand);
}
.article-content p,
.article-content li {
  font-size: 1.03rem;
  line-height: 1.8;
  color: var(--text);
}
.article-content p { margin: 0 0 16px; }
.article-content ul,
.article-content ol { margin: 0 0 18px; padding-left: 1.28rem; }
.article-content li + li { margin-top: 8px; }
.article-content blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  background: var(--brand-soft);
  border-radius: 0 18px 18px 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.72;
}
.callout,
.note-box,
.article-footer-cta {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 70%, transparent), color-mix(in srgb, var(--surface) 94%, transparent));
}
.callout strong,
.note-box strong { display: block; margin-bottom: 6px; }
.table-like {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-soft);
}
.table-like .row {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
  border-top: 1px solid var(--border);
}
.table-like .row:first-child { border-top: none; }
.table-like .row > div { padding: 14px 16px; line-height: 1.66; }
.table-like .row > div:first-child {
  font-weight: 700;
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
}
.formula-grid { display: grid; gap: 16px; margin: 24px 0; }
.formula-card {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 20px;
  padding: 16px 18px;
}
.formula-title { margin: 0 0 8px; font-weight: 700; color: var(--brand); }
.references {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.references h3 { margin-top: 0; }
.references a { color: var(--accent); }
.references a:hover { text-decoration: underline; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 16, 26, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(760px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.modal-kicker {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 800;
}
.modal-title {
  margin: 4px 0 0;
  color: var(--brand);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  letter-spacing: -0.03em;
}
.modal-close {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.28);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--brand);
}
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--brand); }
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.28);
  color: var(--text);
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: 2px solid rgba(0,86,179,0.18); border-color: var(--accent); }
.consent-wrap { margin-top: 2px; }
.consent-label { display: flex; align-items: flex-start; gap: 10px; color: var(--text-soft); line-height: 1.52; }
.form-error {
  display: none;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.16);
}
.form-error.show { display: block; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.ghost-btn, .send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.ghost-btn { background: rgba(255,255,255,0.18); color: var(--brand); }
.send-btn { background: var(--brand); color: white; border-color: transparent; font-weight: 800; }
.send-btn[disabled] { opacity: 0.7; cursor: wait; }
.send-btn.success { background: #15803d; }
.modal-note { margin: 8px 0 0; color: var(--text-faint); font-size: 0.92rem; }

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2800;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--brand);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.footer {
  width: min(calc(100% - 40px), var(--page-max));
  margin: 0 auto 22px;
  padding: 16px 18px 14px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow: var(--shadow-soft);
}
.footer-mainline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  color: var(--text-soft);
  text-align: center;
  font-size: 0.95rem;
}
.footer-motto { white-space: nowrap; }
.footer-logo-wrap { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.footer-logo-wrap img { width: 20px; height: 20px; object-fit: contain; }
.footer-divider { margin: 12px 0 10px; border-top: 1px solid var(--border); }
.footer-sub { text-align: center; color: var(--text-faint); font-size: 0.88rem; }
.footer-sub a:hover { color: var(--brand); }

@media (max-width: 900px) {
  .footer-mainline { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .topbar { top: 8px; padding: 8px 10px 0; }
  .topbar-inner {
    padding: 10px 12px;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }
  .topbar-actions { justify-content: space-between; }
  .brand-sub { display: none; }
  .header-cta { flex: 1 1 auto; }
  .article-shell { width: min(calc(100% - 20px), var(--page-max)); margin: 16px auto 36px; }
  .article-frame { border-radius: 24px; }
  .article-header { padding: 20px 18px 8px; }
  .hero-figure-wrap { padding: 0 18px 12px; }
  .hero-figure { border-radius: 18px; }
  .hero-figure img { aspect-ratio: 4 / 3; }
  .article-content { width: min(calc(100% - 28px), var(--content-max)); padding-bottom: 26px; }
  .article-content h2 { margin-top: 30px; }
  .table-like .row { grid-template-columns: 1fr; }
  .table-like .row > div:first-child { padding-bottom: 4px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer { width: min(calc(100% - 20px), var(--page-max)); }
  .footer-mainline { font-size: 0.9rem; gap: 8px; }
}


.bento-kicker {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 800;
}
.topics-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.topic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
  color: var(--brand);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}
.topic-chip:hover { transform: translateY(-1px); background: rgba(0,86,179,0.08); }
.topic-chip.active { background: #dcecff; border-color: rgba(0,86,179,0.28); }
.field-error {
  display: none;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #7f1d1d;
  line-height: 1.25;
}
.field-error.show { display: block; }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: rgba(255,255,255,0.95);
  animation: spin 0.8s linear infinite;
  display: none;
}
.send-btn.loading .spinner { display: inline-block; }
.send-btn.loading .send-label { opacity: 0.88; }
.send-btn.is-disabled { opacity: 0.72; cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal.is-success {
  border-color: rgba(22, 163, 74, 0.34);
  box-shadow: 0 0 0 1px rgba(22,163,74,0.1), var(--shadow);
}
html.dark .topic-chip {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: #dbeafe;
}
html.dark .topic-chip.active {
  background: rgba(59,130,246,0.18);
  border-color: rgba(96,165,250,0.38);
}



/* ===== Shared contact modal UX from homepage ===== */
.topics-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.topic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: #003366;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}
.topic-chip:hover { transform: translateY(-1px); background: rgba(0, 86, 179, 0.08); }
.topic-chip.active { background: #dcecff; border-color: rgba(0, 86, 179, 0.28); }
.form-error {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #7f1d1d;
  font-weight: 800;
  line-height: 1.35;
}
.form-error.show { display: block; }
.field-error {
  display: none;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #7f1d1d;
  line-height: 1.25;
}
.field-error.show { display: block; }
.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(236, 253, 245, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  color: #064e3b;
  font-weight: 800;
  max-width: min(420px, calc(100vw - 36px));
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast .toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
  flex: 0 0 auto;
}
.input[aria-invalid='true'] {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}
#contactConsent[aria-invalid='true'] {
  outline: 2px solid rgba(239, 68, 68, 0.7);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
  border-radius: 4px;
}
@supports selector(label:has(input)) {
  label[for='contactConsent']:has(#contactConsent[aria-invalid='true']) {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
    border-radius: 12px;
    padding: 10px 12px;
  }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 18px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(920px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.modal-head {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}
.modal-title { margin: 0; font-size: 1.1rem; color: #003366; letter-spacing: normal; }
.modal-close {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 900;
  width: auto;
  height: auto;
}
.modal-close:hover { background: rgba(0, 86, 179, 0.1); }
.contact-modal-body { padding: 14px 16px 18px; }
.modal.is-success {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), 0 0 0 6px rgba(16, 185, 129, 0.14);
  transition: box-shadow 220ms ease, border-color 220ms ease;
}
.modal.is-success .modal-head {
  background: rgba(214, 255, 233, 0.88);
  border-bottom-color: rgba(16, 185, 129, 0.22);
}
.modal.is-success .contact-modal-body { background: rgba(214, 255, 233, 0.35); }
.send-btn.success {
  border-color: rgba(16, 185, 129, 0.55);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.96) 0%, rgba(16, 185, 129, 0.82) 100%);
}
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-grid .full { grid-column: 1 / -1; }
.input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.75);
  color: #333;
  outline: none;
}
.input:focus {
  border-color: rgba(0, 86, 179, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.12);
  background: rgba(255, 255, 255, 0.92);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.ghost-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: #003366;
}
.send-btn {
  border: 1px solid rgba(0, 86, 179, 0.25);
  background: linear-gradient(180deg, #0056b3 0%, #004494 100%);
  color: white;
  font-weight: 800;
}
.ghost-btn, .send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.ghost-btn:hover { background: rgba(0, 86, 179, 0.08); }
.send-btn:hover { filter: brightness(1.02); }
.send-btn[disabled] { opacity: 0.7; cursor: wait; }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: spin 0.8s linear infinite;
  display: none;
  margin-right: 8px;
}
.send-btn.loading .spinner { display: inline-block; }
.send-btn.loading .send-label { opacity: 0.88; }
.send-btn.is-disabled { opacity: 0.72; cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }
html.dark .modal {
  background: rgba(17, 24, 39, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
}
html.dark .modal-head {
  background: rgba(17, 24, 39, 0.86);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
html.dark .input {
  background: rgba(31, 41, 55, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}
html.dark .input::placeholder { color: rgba(229, 231, 235, 0.55); }
html.dark .ghost-btn {
  background: rgba(17, 24, 39, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}
html.dark .ghost-btn:hover { background: rgba(138, 188, 255, 0.12); }
html.dark .topic-chip {
  border-color: rgba(255,255,255,0.12);
  background: rgba(17, 24, 39, 0.35);
  color: #e5e7eb;
}
html.dark .topic-chip.active {
  background: rgba(138, 188, 255, 0.16);
  border-color: rgba(138, 188, 255, 0.28);
}
html.dark .app-toast {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(5, 46, 22, 0.78);
  color: rgba(236, 253, 245, 0.92);
}
html.dark .app-toast .toast-icon {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.16);
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
    background: rgba(0, 0, 0, 0.38);
  }
  .modal {
    width: 100%;
    max-height: 86vh;
    border-radius: 18px 18px 0 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .modal-head { padding: 14px 14px 12px; }
  .contact-modal-body { padding: 12px 14px 16px; }
}
