/* Composition 3: the certified presence report (cover + one record page). */
.v3-report-section {
  --rep-navy: #0b1124;
  --rep-blue: #1e3fae;
  --rep-blue-2: #2b55d6;
  --rep-ink: #101828;
  --rep-mute: #6b7385;
  --rep-line: #e3e6ec;
  --rep-paper: #f8f9fb;
  --rep-green: #16a37a;
  --rep-day: #e7eefc;
  margin: 0;
}

.rep-lead {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--v3-copy);
  font-size: 16px;
  line-height: 1.6;
}

.rep {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  margin-top: 28px;
  padding: clamp(18px, 3vw, 40px) clamp(14px, 2.4vw, 32px) clamp(28px, 4vw, 56px);
  border-radius: 24px;
  background: #e9ecf2;
}

.rep-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 6px;
  background: var(--rep-paper);
  color: var(--rep-ink);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 24px 60px rgba(11, 17, 36, 0.18), 0 3px 10px rgba(11, 17, 36, 0.08);
}

.rep-sheet--cover {
  z-index: 2;
  margin-right: -18px;
}

.rep-sheet--record {
  z-index: 1;
  margin-top: 44px;
  margin-left: -18px;
}

.rep-sheet small,
.rep-sheet h3,
.rep-sheet h4,
.rep-sheet dt {
  font-family: var(--v3-mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rep-sheet h3,
.rep-sheet h4 {
  margin: 0;
}

/* ---- Header ---- */
.rep-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(100deg, #0f1c52 0%, var(--rep-blue) 62%, var(--rep-blue-2) 100%);
  color: #fff;
}

.rep-top--slim {
  padding-block: 14px;
}

.rep-top > div {
  display: grid;
  gap: 2px;
  text-align: right;
}

.rep-top small {
  font-size: 8.500px;
  opacity: 0.75;
}

.rep-top strong {
  font-size: 15px;
  font-weight: 700;
}

.rep-top > div > span {
  font-size: 10.500px;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.rep-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rep-logo em {
  color: #6fa0ff;
  font-style: italic;
}

/* ---- KPI band ---- */
.rep-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 12px 8px;
  background: var(--rep-navy);
  color: #fff;
  list-style: none;
  text-align: center;
}

.rep-kpis li {
  display: grid;
  gap: 3px;
  padding: 2px 4px;
}

.rep-kpis li + li {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.rep-kpis b {
  font-size: 22px;
  font-weight: 750;
  line-height: 1;
}

.rep-kpis .is-key b {
  color: #34d399;
}

.rep-kpis span {
  font-family: var(--v3-mono);
  font-size: 7.500px;
  letter-spacing: 0.1em;
  opacity: 0.6;
  text-transform: uppercase;
}

/* ---- Body ---- */
.rep-body {
  flex: 1;
  padding: 18px 22px 22px;
}

.rep-rule {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rep-line);
}

.rep-rule--center {
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  padding-bottom: 12px;
  border-top: 1px solid var(--rep-line);
  border-bottom: 0;
}

.rep-rule h3 {
  color: #5d6577;
  font-size: 9.500px;
}

.rep-rule small {
  color: var(--rep-mute);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.rep-id {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  margin-top: 14px;
}

.rep-id-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.22;
  border: 1px solid var(--rep-line);
  border-radius: 6px;
  object-fit: cover;
  object-position: 50% 26%;
}

.rep-id-photo small {
  display: block;
  margin: 6px 0 8px;
  color: var(--rep-mute);
  font-size: 7px;
  text-align: center;
}

.rep-badge {
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px solid #c9d6f5;
  border-radius: 6px;
  background: #eef3ff;
  color: #3e4a66;
  font-family: var(--v3-mono);
  font-size: 7px;
  line-height: 1.35;
}

.rep-badge b {
  display: block;
  color: var(--rep-ink);
  font-family: var(--v3-font);
  font-size: 9px;
}

.rep-badge--ok {
  border-color: #a8e6cf;
  background: #ecfdf5;
  color: #0f7a5a;
}

.rep-id-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-content: start;
  margin: 0;
}

.rep-id-data .is-wide {
  grid-column: 1 / -1;
}

.rep-sheet dt {
  color: var(--rep-mute);
  font-size: 7px;
}

.rep-sheet dd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 11.500px;
  font-weight: 650;
}

.rep-sheet dd.is-mono,
.rep-sheet code {
  font-family: var(--v3-mono);
}

.rep-sheet dd .country-flag-v3 {
  width: 15px;
  height: 10px;
  border-radius: 1.500px;
}

/* ---- Period summary ---- */
.rep-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
}

.rep-summary h4 {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rep-line);
  color: #5d6577;
  font-size: 8.500px;
}

.rep-week,
.rep-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  text-align: center;
}

.rep-week {
  margin: 8px 0 4px;
  color: var(--rep-mute);
  font-family: var(--v3-mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rep-days > span {
  display: grid;
  min-height: 27px;
  place-content: center;
  justify-items: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #9aa1b0;
  font-size: 9px;
}

.rep-days .is-on {
  border-color: #c5d5f7;
  background: var(--rep-day);
  color: #1b2a6b;
}

.rep-days .is-on b {
  font-size: 8.500px;
  line-height: 1;
}

.rep-days .country-flag-v3 {
  width: 11px;
  height: 7.500px;
  border-radius: 1px;
}

.rep-countries small {
  display: block;
  margin: 8px 0 7px;
  color: var(--rep-mute);
  font-size: 7px;
}

.rep-countries ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rep-countries li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 6px;
  border: 1px solid var(--rep-line);
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  font-weight: 600;
}

.rep-countries li .country-flag-v3 {
  width: 13px;
  height: 9px;
  border-radius: 1.500px;
}

.rep-countries li code {
  color: var(--rep-mute);
  font-size: 9px;
  font-weight: 500;
}

.rep-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--rep-mute);
  font-size: 8.500px;
}

.rep-legend i {
  width: 10px;
  height: 10px;
  border: 1px solid #c5d5f7;
  border-radius: 2px;
  background: var(--rep-day);
}

/* ---- Footer ---- */
.rep-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: var(--rep-navy);
  color: #fff;
}

.rep-foot .rep-logo {
  font-size: 12px;
}

.rep-foot > div {
  display: grid;
  gap: 2px;
  text-align: right;
}

.rep-foot small {
  font-size: 6.500px;
  opacity: 0.55;
}

.rep-foot code {
  font-size: 9px;
  font-weight: 600;
}

/* ---- Record page ---- */
.rep-record {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--rep-line);
  border-radius: 8px;
  background: #fff;
}

.rep-record > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #eef2fb;
}

.rep-record > header > b {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--rep-blue);
  color: #fff;
  font-size: 10px;
}

.rep-record > header > div {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.rep-record > header strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.500px;
}

.rep-record > header strong .country-flag-v3 {
  width: 15px;
  height: 10px;
  border-radius: 1.500px;
}

.rep-record > header code {
  overflow: hidden;
  color: var(--rep-mute);
  font-size: 7.500px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rep-cert {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #a8e6cf;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f7a5a;
  font-family: var(--v3-mono);
  font-size: 6.500px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rep-record-main {
  display: grid;
  grid-template-columns: 38% minmax(0, 1fr);
  gap: 14px;
  padding: 14px 12px;
}

.rep-record-main figure {
  margin: 0;
}

.rep-record-main img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.3;
  border-radius: 6px;
  object-fit: cover;
  object-position: 50% 28%;
}

.rep-record-main figcaption {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  color: var(--rep-mute);
  font-family: var(--v3-mono);
  font-size: 6.500px;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.rep-record-main figcaption b {
  color: #0f7a5a;
}

.rep-record-main dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  align-content: start;
  margin: 0;
}

.rep-record-main dd {
  font-size: 10.500px;
}

.rep-hash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 12px;
  padding: 11px 12px;
  border: 1px solid var(--rep-line);
  border-radius: 6px;
  background: #f1f3f7;
}

.rep-hash > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rep-hash small {
  color: var(--rep-mute);
  font-size: 6.500px;
}

.rep-hash code {
  overflow-wrap: anywhere;
  font-size: 8.500px;
  font-weight: 700;
}

.rep-hash span {
  color: var(--rep-mute);
  font-family: var(--v3-mono);
  font-size: 7.500px;
}

.rep-hash svg {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  padding: 4px;
  border-radius: 4px;
  background: #fff;
  fill: var(--rep-navy);
}

/* ---- Assembly: the cover lands, its days fill in, the record page slides out ---- */
.rep.is-armed .rep-sheet--cover {
  opacity: 0;
  transform: translateY(16px);
}

.rep.is-armed .rep-sheet--record {
  opacity: 0;
  transform: translateX(-34%);
}

.rep.is-armed .rep-days .is-on {
  border-color: transparent;
  background: transparent;
  color: #9aa1b0;
}

.rep.is-armed .rep-days .is-on .country-flag-v3 {
  opacity: 0;
}

.rep.is-playing .rep-sheet--cover {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rep.is-playing .rep-days .is-on {
  border-color: #c5d5f7;
  background: var(--rep-day);
  color: #1b2a6b;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  transition-delay: calc(450ms + var(--i) * 34ms);
}

.rep.is-playing .rep-days .is-on .country-flag-v3 {
  opacity: 1;
  transition: opacity 0.25s ease;
  transition-delay: calc(450ms + var(--i) * 34ms);
}

.rep.is-playing .rep-sheet--record {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: 1.5s;
}

@media (max-width: 860px) {
  .rep {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .rep-sheet--cover,
  .rep-sheet--record {
    margin: 0;
  }

  .rep.is-armed .rep-sheet--record {
    transform: translateY(-40px);
  }
}

@media (max-width: 460px) {
  .rep-top {
    padding: 16px 14px;
  }

  .rep-body {
    padding: 14px;
  }

  .rep-id {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
  }

  .rep-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .rep-record-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .rep-record-main img {
    aspect-ratio: 1.3 / 1;
  }

  .rep-cert {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rep * {
    transition: none !important;
  }
}
