:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, a { font: inherit; }
.topbar {
  min-height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e7eaf0;
}
.brand { color: inherit; text-decoration: none; font-weight: 800; letter-spacing: .05em; }
.link-button { border: 0; background: transparent; color: #3452a5; cursor: pointer; font-weight: 700; }
.shell { width: min(820px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 80px; }
.hero { margin-bottom: 28px; }
.hero h1 { margin: 8px 0 12px; font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.04em; }
.hero p:not(.eyebrow) { max-width: 680px; color: #5e687b; line-height: 1.7; }
.eyebrow { margin: 0; font-size: .75rem; font-weight: 800; letter-spacing: .12em; color: #5670bb; }
.panel {
  background: #fff;
  border: 1px solid #e4e8f0;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 36px rgba(32, 48, 84, .06);
}
.panel + .panel { margin-top: 16px; }
.panel h2 { margin-top: 0; }
.muted { color: #6d7687; }
.account-card { display: flex; gap: 18px; align-items: center; justify-content: space-between; }
.account-card strong { display: block; margin-top: 5px; font-size: 1.05rem; }
.account-card p { margin-bottom: 0; }
.badge { padding: 7px 10px; border-radius: 999px; background: #eef2ff; color: #3a53a4; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.result-list { display: grid; gap: 16px; margin-top: 16px; }
.result-notice { padding: 13px 15px; border: 1px solid #d9e5f3; border-radius: 13px; background: #f3f8fd; color: #315b7d; font-size: .9rem; line-height: 1.5; }
.result-card { background: #fff; border: 1px solid #e4e8f0; border-radius: 18px; padding: 24px; }
.result-head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.result-card h2 { margin: 6px 0 5px; font-size: 1.25rem; }
.reference { margin: 0; color: #727b8b; font-size: .9rem; }
.status { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; font-size: .76rem; font-weight: 900; }
.status.success { background: #edf8f1; color: #176a3b; }
.status.fail { background: #f4f5f7; color: #4d5665; }
.placement { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid #edf0f5; }
.placement span { display: block; color: #70798a; font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.placement strong { display: block; margin-top: 7px; line-height: 1.5; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.download { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 11px 15px; border: 0; border-radius: 10px; background: #243f91; color: #fff; text-decoration: none; font-weight: 800; cursor: pointer; }
.download:hover { filter: brightness(.96); }
.download:disabled { cursor: wait; opacity: .68; }
.generate-letter { appearance: none; }
.letter-state { flex: 1 1 260px; color: #647286; font-size: .84rem; line-height: 1.45; }
.letter-state.error { color: #9b2f2f; }
.message-title { margin-top: 0; }
@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 820px); padding-top: 34px; }
  .topbar { padding: 0 14px; }
  .panel, .result-card { padding: 18px; border-radius: 14px; }
  .result-head, .account-card { align-items: flex-start; flex-direction: column; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .download { width: 100%; }
  .letter-state { flex-basis: auto; }
}
