.page--detail {
  align-items: start;
  gap: 1rem;
}

.topbar--detail-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 249, 252, 0.92) 100%);
  border-color: rgba(175, 194, 212, 0.82);
  box-shadow: 0 20px 45px rgba(16, 33, 49, 0.09);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.topbar--detail-page .topbar__brand {
  gap: 0;
}

.topbar--detail-page .topbar__title {
  font-size: clamp(1.34rem, 2.2vw, 1.72rem);
  letter-spacing: -0.03em;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-4);
}

.page--detail .panel {
  gap: 0.95rem;
  padding: 1.35rem;
}

.page--detail .panel__header {
  align-items: center;
}

.page--detail .panel__header h2 {
  font-size: 1.08rem;
}

.page--detail .panel--detail-flow {
  gap: 0.8rem;
  grid-template-rows: auto minmax(0, 1fr);
}

.detail-flow-toggle {
  display: none;
}

.detail-panel-topline {
  display: block;
  margin-top: -0.1rem;
  margin-bottom: 0.2rem;
}

.detail-code-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.75rem;
  min-width: 0;
  min-height: 210px;
  padding: 1.05rem 1.2rem 1.15rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(31, 65, 94, 0.98) 0%, rgba(24, 51, 76, 0.98) 100%);
  border: 1px solid rgba(30, 70, 103, 0.32);
  box-shadow:
    0 14px 28px rgba(16, 33, 49, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.detail-code-card__header {
  display: block;
  justify-self: center;
  text-align: center;
}

.detail-code-card__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-code-card__value {
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: clamp(2.25rem, 3.6vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.02;
  text-align: center;
  justify-self: center;
  align-self: center;
  margin-top: 0.05rem;
  text-shadow: 0 10px 18px rgba(7, 17, 27, 0.22);
}

.detail-code-card__date {
  display: grid;
  gap: 0.24rem;
  justify-items: center;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.detail-code-card__date-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-code-card__date-value {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.22rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.page--detail .detail-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
}

.page--detail .key-value-card {
  gap: 0.45rem;
  padding: 1rem 1.05rem;
  background: linear-gradient(180deg, rgba(249, 251, 253, 0.98) 0%, rgba(242, 246, 250, 0.95) 100%);
  border-color: rgba(184, 199, 215, 0.78);
  box-shadow:
    0 10px 20px rgba(16, 33, 49, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.page--detail .key-value-card__label {
  font-size: 0.74rem;
  color: #5d6f81;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page--detail .key-value-card__value {
  font-size: 1rem;
  line-height: 1.4;
  color: #1f2f3f;
}

.page--detail .key-value-card[data-tone] {
  position: relative;
  overflow: hidden;
}

.page--detail .key-value-card[data-tone]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 999px;
  opacity: 0.92;
}

.page--detail .key-value-card--version {
  background: linear-gradient(180deg, rgba(230, 240, 250, 0.98) 0%, rgba(220, 234, 247, 0.96) 100%);
  border-color: rgba(104, 143, 184, 0.46);
}

.page--detail .key-value-card--version::before {
  background: linear-gradient(180deg, #2d618a 0%, #1f4f78 100%);
}

.page--detail .key-value-card--version .key-value-card__value {
  color: #18334c;
}

.page--detail .key-value-card--qa {
  background: linear-gradient(180deg, rgba(232, 246, 241, 0.98) 0%, rgba(222, 240, 233, 0.96) 100%);
  border-color: rgba(87, 160, 122, 0.42);
}

.page--detail .key-value-card--qa::before {
  background: linear-gradient(180deg, #2f8f62 0%, #236f4b 100%);
}

.page--detail .key-value-card--qa .key-value-card__value {
  color: #1a5f41;
}

.page--detail .key-value-card--qa-start {
  background: linear-gradient(180deg, rgba(239, 243, 252, 0.98) 0%, rgba(231, 238, 249, 0.96) 100%);
  border-color: rgba(108, 123, 194, 0.38);
}

.page--detail .key-value-card--qa-start::before {
  background: linear-gradient(180deg, #5468b4 0%, #45589f 100%);
}

.page--detail .key-value-card--qa-start .key-value-card__value {
  color: #394d91;
}

.page--detail .key-value-card--qa-end {
  background: linear-gradient(180deg, rgba(252, 244, 235, 0.98) 0%, rgba(248, 238, 224, 0.96) 100%);
  border-color: rgba(193, 147, 90, 0.38);
}

.page--detail .key-value-card--qa-end::before {
  background: linear-gradient(180deg, #c08a3d 0%, #a96f23 100%);
}

.page--detail .key-value-card--qa-end .key-value-card__value {
  color: #8d5b1e;
}

.page--detail .key-value-card--state {
  background: linear-gradient(180deg, rgba(234, 242, 249, 0.98) 0%, rgba(225, 236, 246, 0.96) 100%);
  border-color: rgba(103, 139, 174, 0.38);
}

.page--detail .key-value-card--state::before {
  background: linear-gradient(180deg, #45749d 0%, #345c82 100%);
}

.page--detail .key-value-card--state .key-value-card__value {
  color: #234563;
}

.page--detail .key-value-card--tentative {
  background: linear-gradient(180deg, rgba(252, 245, 233, 0.98) 0%, rgba(248, 239, 224, 0.96) 100%);
  border-color: rgba(188, 151, 86, 0.34);
}

.page--detail .key-value-card--tentative::before {
  background: linear-gradient(180deg, #bf8b3a 0%, #a56d24 100%);
}

.page--detail .key-value-card--tentative .key-value-card__value {
  color: #8e5a1c;
}

.page--detail .key-value-card--final {
  background: linear-gradient(180deg, rgba(233, 243, 238, 0.98) 0%, rgba(223, 236, 229, 0.96) 100%);
  border-color: rgba(89, 146, 111, 0.34);
}

.page--detail .key-value-card--final::before {
  background: linear-gradient(180deg, #3d8a5e 0%, #2c6c47 100%);
}

.page--detail .key-value-card--final .key-value-card__value {
  color: #23593c;
}

.page--detail .key-value-card--context {
  background: linear-gradient(180deg, rgba(247, 249, 252, 0.98) 0%, rgba(240, 244, 248, 0.95) 100%);
}

.page--detail .key-value-card--context::before {
  background: linear-gradient(180deg, rgba(125, 145, 165, 0.75) 0%, rgba(99, 118, 136, 0.72) 100%);
}

.page--detail .key-value-card--observation {
  grid-column: span 2;
  min-height: 132px;
  background: linear-gradient(180deg, rgba(243, 247, 251, 0.98) 0%, rgba(235, 241, 247, 0.96) 100%);
  border-color: rgba(148, 168, 188, 0.42);
}

.page--detail .key-value-card--observation::before {
  background: linear-gradient(180deg, #5d6f81 0%, #48596b 100%);
}

.page--detail .key-value-card--observation .key-value-card__value {
  line-height: 1.55;
  white-space: pre-line;
}

.polygon-flow,
.polygon-history {
  display: grid;
  gap: 0.95rem;
}

.polygon-flow__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.polygon-flow__rail {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 100%;
}

.polygon-flow__line {
  width: 2px;
  height: calc(100% + 1.1rem);
  background: linear-gradient(180deg, rgba(125, 145, 165, 0.72) 0%, rgba(187, 202, 217, 0.3) 100%);
  margin-top: 0.3rem;
}

.polygon-flow__node {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #8ea2b6;
  border: 4px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(124, 145, 167, 0.3);
  position: relative;
  z-index: 1;
}

.polygon-flow__item--conforme .polygon-flow__node {
  background: #2f8f62;
}

.polygon-flow__item--con-observacion .polygon-flow__node {
  background: #d39a3a;
}

.polygon-flow__item--no-conforme .polygon-flow__node {
  background: #c45a63;
}

.polygon-flow__item--en-proceso .polygon-flow__node {
  background: #45749d;
}

.polygon-flow__item--cerrado .polygon-flow__node {
  background: #6b8298;
}

.polygon-flow__item--cambio-version .polygon-flow__node {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #8f61c5;
  transform: rotate(45deg);
}

.polygon-flow__card,
.polygon-history__entry {
  background: linear-gradient(180deg, rgba(249, 251, 253, 0.99) 0%, rgba(241, 246, 250, 0.96) 100%);
  border: 1px solid rgba(182, 199, 215, 0.8);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  box-shadow:
    0 14px 26px rgba(17, 34, 51, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.polygon-flow__item--cambio-version .polygon-flow__card {
  background: linear-gradient(180deg, rgba(246, 241, 252, 0.99) 0%, rgba(239, 233, 248, 0.97) 100%);
  border-color: rgba(173, 146, 205, 0.55);
}

.polygon-flow__item--stage .polygon-flow__card {
  border-top: 4px solid rgba(69, 116, 157, 0.32);
}

.polygon-flow__item--conforme .polygon-flow__card {
  background: linear-gradient(180deg, rgba(239, 248, 243, 0.99) 0%, rgba(232, 244, 237, 0.97) 100%);
  border-color: rgba(94, 156, 117, 0.38);
}

.polygon-flow__item--con-observacion .polygon-flow__card {
  background: linear-gradient(180deg, rgba(252, 247, 238, 0.99) 0%, rgba(248, 241, 228, 0.97) 100%);
  border-color: rgba(201, 155, 75, 0.38);
}

.polygon-flow__item--no-conforme .polygon-flow__card {
  background: linear-gradient(180deg, rgba(252, 241, 242, 0.99) 0%, rgba(247, 234, 236, 0.97) 100%);
  border-color: rgba(196, 106, 115, 0.4);
}

.polygon-flow__item--en-proceso .polygon-flow__card {
  background: linear-gradient(180deg, rgba(239, 245, 251, 0.99) 0%, rgba(231, 239, 247, 0.97) 100%);
  border-color: rgba(93, 132, 168, 0.4);
}

.polygon-flow__card-top,
.polygon-history__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.9rem;
}

.polygon-flow__headline,
.polygon-history__header-copy {
  display: grid;
  gap: 0.35rem;
}

.polygon-flow__headline strong,
.polygon-history__header-copy strong {
  color: #1a2f43;
  font-size: 1rem;
  line-height: 1.3;
}

.polygon-flow__qa-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(72, 141, 104, 0.12);
  color: #2f8f62;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: fit-content;
}

.polygon-flow__state {
  white-space: nowrap;
}

.polygon-flow__subtitle,
.polygon-history__subtitle {
  color: #617284;
  font-size: 0.86rem;
  line-height: 1.4;
}

.polygon-flow__timestamp,
.polygon-history__timestamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(223, 232, 240, 0.72);
  color: #496175;
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.detail-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 0.9rem;
}

.detail-facts-grid__item {
  display: grid;
  gap: 0.22rem;
  padding: 0.72rem 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(205, 216, 226, 0.8);
}

.detail-facts-grid__label {
  color: #698091;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-facts-grid__value {
  color: #21384d;
  font-size: 0.93rem;
  line-height: 1.35;
}

.polygon-flow__note,
.polygon-history__description,
.polygon-history__secondary {
  margin: 0.9rem 0 0;
  color: #43596d;
  line-height: 1.6;
}

.polygon-history__secondary {
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(168, 184, 199, 0.72);
}

.polygon-history__eyebrow {
  color: #617284;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.polygon-history__entry {
  position: relative;
  overflow: hidden;
  padding: 0.95rem 1rem;
  border-radius: 16px;
}

.polygon-history__entry::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 999px;
  background: rgba(125, 145, 165, 0.72);
}

.polygon-history__entry--qa::before {
  background: linear-gradient(180deg, #45749d 0%, #345c82 100%);
}

.polygon-history__entry--actividad::before {
  background: linear-gradient(180deg, #2d6f8c 0%, #22566e 100%);
}

.polygon-history__entry--version::before {
  background: linear-gradient(180deg, #2f8f62 0%, #236f4b 100%);
}

.polygon-history__entry--transicion::before {
  background: linear-gradient(180deg, #8f61c5 0%, #7448a8 100%);
}

.polygon-history__entry--documento::before {
  background: linear-gradient(180deg, #c08a3d 0%, #a96f23 100%);
}

.polygon-history__entry--qa {
  background: linear-gradient(180deg, rgba(243, 248, 252, 0.99) 0%, rgba(236, 242, 248, 0.97) 100%);
}

.polygon-history__entry--actividad {
  background: linear-gradient(180deg, rgba(239, 249, 252, 0.99) 0%, rgba(231, 243, 247, 0.97) 100%);
}

.polygon-history__entry--version {
  background: linear-gradient(180deg, rgba(242, 249, 245, 0.99) 0%, rgba(234, 244, 238, 0.97) 100%);
}

.polygon-history__entry--transicion {
  background: linear-gradient(180deg, rgba(247, 243, 252, 0.99) 0%, rgba(239, 234, 248, 0.97) 100%);
}

.polygon-history__entry--documento {
  background: linear-gradient(180deg, rgba(251, 247, 240, 0.99) 0%, rgba(246, 240, 229, 0.97) 100%);
}

.polygon-history__badges {
  margin-top: 0.55rem;
}

.polygon-history__secondary-block {
  margin-top: 0.75rem;
  padding-top: 0.72rem;
  border-top: 1px dashed rgba(168, 184, 199, 0.72);
}

.polygon-history__secondary-label {
  display: inline-flex;
  margin-bottom: 0.4rem;
  color: #617284;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.polygon-history__facts-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin-top: 0.7rem;
}

.polygon-history__fact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(205, 216, 226, 0.82);
  color: #486075;
  line-height: 1.2;
}

.polygon-history__fact-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.polygon-history__fact-value {
  color: #1f3549;
  font-size: 0.82rem;
  font-weight: 700;
}

.polygon-history__description,
.polygon-history__secondary {
  font-size: 0.92rem;
  white-space: pre-line;
}

.polygon-history__entry--start {
  background: linear-gradient(180deg, rgba(238, 246, 252, 0.99) 0%, rgba(230, 240, 248, 0.97) 100%);
  border-color: rgba(112, 149, 184, 0.44);
}

.polygon-history__entry--start::before {
  background: linear-gradient(180deg, #2d618a 0%, #1f4f78 100%);
}

.polygon-history__stage {
  position: relative;
  display: grid;
  gap: 0.95rem;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(249, 251, 253, 0.99) 0%, rgba(241, 246, 250, 0.96) 100%);
  border: 1px solid rgba(182, 199, 215, 0.8);
  box-shadow:
    0 14px 26px rgba(17, 34, 51, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.polygon-history__stage::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, rgba(125, 145, 165, 0.92) 0%, rgba(171, 188, 204, 0.55) 100%);
}

.polygon-history__stage--conforme {
  background: linear-gradient(180deg, rgba(239, 248, 243, 0.99) 0%, rgba(232, 244, 237, 0.97) 100%);
  border-color: rgba(94, 156, 117, 0.38);
}

.polygon-history__stage--conforme::before {
  background: linear-gradient(90deg, #2f8f62 0%, rgba(47, 143, 98, 0.38) 100%);
}

.polygon-history__stage--con-observacion {
  background: linear-gradient(180deg, rgba(252, 247, 238, 0.99) 0%, rgba(248, 241, 228, 0.97) 100%);
  border-color: rgba(201, 155, 75, 0.38);
}

.polygon-history__stage--con-observacion::before {
  background: linear-gradient(90deg, #d39a3a 0%, rgba(211, 154, 58, 0.38) 100%);
}

.polygon-history__stage--no-conforme {
  background: linear-gradient(180deg, rgba(252, 241, 242, 0.99) 0%, rgba(247, 234, 236, 0.97) 100%);
  border-color: rgba(196, 106, 115, 0.4);
}

.polygon-history__stage--no-conforme::before {
  background: linear-gradient(90deg, #c45a63 0%, rgba(196, 90, 99, 0.38) 100%);
}

.polygon-history__stage--en-proceso {
  background: linear-gradient(180deg, rgba(239, 245, 251, 0.99) 0%, rgba(231, 239, 247, 0.97) 100%);
  border-color: rgba(93, 132, 168, 0.4);
}

.polygon-history__stage--en-proceso::before {
  background: linear-gradient(90deg, #45749d 0%, rgba(69, 116, 157, 0.4) 100%);
}

.polygon-history__stage--cerrado::before,
.polygon-history__stage--neutral::before {
  background: linear-gradient(90deg, #6b8298 0%, rgba(107, 130, 152, 0.38) 100%);
}

.polygon-history__stage-topline,
.polygon-history__stage-header,
.polygon-history__subentry-top,
.polygon-history__section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.polygon-history__pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.polygon-history__version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(47, 97, 138, 0.12);
  border: 1px solid rgba(76, 118, 155, 0.24);
  color: #1f4f78;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.polygon-history__section {
  display: grid;
  gap: 0.72rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(168, 184, 199, 0.72);
}

.polygon-history__section--results .detail-facts-grid__item {
  border-width: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 14px rgba(38, 62, 84, 0.1);
}

.polygon-history__section--results .detail-facts-grid__item:nth-child(odd) {
  background: linear-gradient(180deg, rgba(255, 244, 223, 0.98) 0%, rgba(248, 232, 201, 0.96) 100%);
}

.polygon-history__section--results .detail-facts-grid__item:nth-child(even) {
  background: linear-gradient(180deg, rgba(230, 248, 240, 0.98) 0%, rgba(215, 239, 228, 0.96) 100%);
}

.polygon-history__section--results .detail-facts-grid__item--result-tentative {
  background: linear-gradient(180deg, rgba(247, 239, 217, 0.99) 0%, rgba(240, 226, 188, 0.97) 100%);
  border: 1px solid rgba(186, 154, 86, 0.44);
}

.polygon-history__section--results .detail-facts-grid__item--result-final {
  background: linear-gradient(180deg, rgba(214, 235, 255, 0.99) 0%, rgba(191, 219, 247, 0.97) 100%);
  border: 1px solid rgba(76, 122, 167, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 16px rgba(38, 78, 118, 0.14);
}

.polygon-history__section--results .detail-facts-grid__label {
  color: #4a5f73;
}

.polygon-history__section--results .detail-facts-grid__value {
  color: #16324b;
}

.polygon-history__section--results .detail-facts-grid__item--result-final .detail-facts-grid__value {
  color: #0f2f4b;
  font-size: 1rem;
}

.polygon-history__comment-box {
  padding: 0.88rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(172, 190, 207, 0.82);
  background: linear-gradient(180deg, rgba(244, 248, 252, 0.98) 0%, rgba(236, 243, 249, 0.96) 100%);
}

.polygon-history__comment-box .polygon-history__description {
  margin: 0;
}

.polygon-history__section-title {
  color: #31495e;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.polygon-history__section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(225, 234, 242, 0.88);
  color: #425a6d;
  font-size: 0.76rem;
  font-weight: 700;
}

.polygon-history__subentries {
  display: grid;
  gap: 0.75rem;
}

.polygon-history__subentry {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 0.88rem 0.95rem 0.92rem 1rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(205, 216, 226, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
  overflow: hidden;
}

.polygon-history__subentry::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 999px;
  background: rgba(125, 145, 165, 0.72);
}

.polygon-history__subentry--actividad::before {
  background: linear-gradient(180deg, #2d6f8c 0%, #22566e 100%);
}

.polygon-history__subentry--version::before {
  background: linear-gradient(180deg, #2f8f62 0%, #236f4b 100%);
}

.polygon-history__subentry--transicion::before {
  background: linear-gradient(180deg, #8f61c5 0%, #7448a8 100%);
}

.polygon-history__subentry--documento::before {
  background: linear-gradient(180deg, #c08a3d 0%, #a96f23 100%);
}

.polygon-history__subentry-copy {
  display: grid;
  gap: 0.28rem;
}

.polygon-history__subentry-copy strong {
  color: #1a2f43;
  font-size: 0.94rem;
  line-height: 1.35;
}

.polygon-history__mini-label {
  color: #617284;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.polygon-history__timestamp--subentry {
  min-height: 28px;
  padding-inline: 0.65rem;
  font-size: 0.73rem;
}

.polygon-history__description--subentry {
  margin-top: 0.1rem;
}

.polygon-history__empty {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(244, 248, 251, 0.92);
  border: 1px dashed rgba(173, 188, 201, 0.86);
  color: #5a6f82;
  font-size: 0.9rem;
  line-height: 1.55;
}

.page--detail .timeline-list {
  gap: 0.85rem;
}

.page--detail .timeline-item {
  gap: 0.5rem;
  padding: 1rem 1.05rem;
  border-left-color: rgba(46, 110, 143, 0.34);
  background: linear-gradient(180deg, rgba(247, 250, 253, 0.96) 0%, rgba(240, 245, 249, 0.94) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.page--detail .timeline-item__header strong {
  color: var(--color-heading);
}

.detail-scroll-block {
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.detail-scroll-block::-webkit-scrollbar {
  width: 10px;
}

.detail-scroll-block::-webkit-scrollbar-track {
  background: rgba(226, 234, 242, 0.78);
  border-radius: 999px;
}

.detail-scroll-block::-webkit-scrollbar-thumb {
  background: rgba(95, 111, 129, 0.5);
  border-radius: 999px;
  border: 2px solid rgba(226, 234, 242, 0.78);
}

.detail-scroll-block::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 110, 143, 0.6);
}

@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-code-card__header {
    display: block;
  }

  .detail-code-card__date {
    justify-items: center;
  }

  .page--detail .key-value-card--observation {
    grid-column: span 1;
  }

  .polygon-flow__card-top,
  .polygon-history__header {
    display: grid;
  }

  .polygon-history__stage-topline,
  .polygon-history__stage-header,
  .polygon-history__subentry-top,
  .polygon-history__section-head {
    display: grid;
  }
}

@media (max-width: 680px) {
  .detail-flow-toggle {
    display: inline-flex;
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
  }

  .page--detail .panel--detail-flow.is-collapsed #detail-polygon-flow {
    display: none;
  }

  .page--detail .panel--detail-flow.is-collapsed {
    gap: 0;
  }

  .page--detail .panel__header {
    align-items: center;
  }

  .detail-facts-grid {
    grid-template-columns: 1fr;
  }

  .polygon-flow__item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0.65rem;
  }

  .polygon-flow__headline strong,
  .polygon-history__header-copy strong {
    font-size: 0.92rem;
  }

  .polygon-history__stage,
  .polygon-history__subentry {
    padding-inline: 0.9rem;
  }

  .polygon-history__pill-row {
    gap: 0.45rem;
  }

  .polygon-history__version-pill,
  .polygon-flow__qa-pill {
    min-height: 26px;
    font-size: 0.74rem;
  }
}
