.portrait-panel {
  clear: both;
  max-width: 390px;
  margin: 18px auto 25px;
}
.result-portrait {
  width: 100%;
  max-width: 390px;
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid #cbd9cb;
  border-radius: 19px;
  background: #fffef8;
  color: #204138;
  box-shadow: 0 12px 35px #23473518;
  line-height: 1.6;
}
.result-portrait p { margin: 0; }
.portrait-hero {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 15px 17px 18px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 41%, #fffdf1 0, transparent 60%), linear-gradient(145deg, #e2efdf, #f5eacb);
}
.portrait-kicker {
  justify-self: start;
  font-size: 13px;
  font-weight: 750;
  text-align: start;
}
.portrait-character {
  width: min(68%, 206px);
  height: 203px;
  object-fit: contain;
  transform: rotate(-6deg);
  filter: drop-shadow(0 8px 7px #23473526);
}
.portrait-mark {
  width: 108px;
  height: 155px;
  transform: none;
}
.result-portrait .portrait-type {
  color: #1d4e38;
  font-size: clamp(47px, 17vw, 69px);
  line-height: 1.03;
  letter-spacing: -.045em;
  margin: 0 0 3px;
}
.portrait-name { font-size: 15px; font-weight: 700; }
.result-portrait .portrait-count { font-size: 12px; color: #3f624c; margin-top: 6px; }
.portrait-axes { padding: 13px 15px; }
.portrait-axes h3 { font-size: 15px; margin: 0 0 5px; }
.portrait-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.portrait-axis {
  display: grid;
  align-content: start;
  margin: 0;
  border: 1px solid #d7e2d4;
  border-radius: 9px;
  padding: 6px 2px;
  background: #f0f5eb;
  text-align: center;
}
.portrait-figure { display: flex; justify-content: center; align-items: baseline; gap: 3px; white-space: nowrap; }
.portrait-figure strong { font-size: clamp(12px, 4.2vw, 19px); font-variant-numeric: tabular-nums; line-height: 1.35; }
.portrait-letter { font-size: 11px; font-weight: 750; }
.portrait-axis-label { font-size: 10px; color: #456351; overflow-wrap: anywhere; }
.portrait-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e0e8db;
  padding: 11px 17px;
  font-size: 12px;
  color: #456351;
}
.portrait-brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.portrait-brand img { border-radius: 5px; }
.portrait-capture { display: block; margin: 12px auto 0; }
body:has(.portrait-dialog[open]) { overflow: hidden; }
.portrait-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 12px 10px;
  border: 0;
  margin: 0;
  overflow: auto;
  background: #ecf0e8;
  color: #204138;
}
.portrait-back { display: block; margin: 10px auto 0; }
