#especificacao h2 { max-width: none; font-size: clamp(1.86rem, 4vw, 3.95rem); margin-bottom: .55rem; text-wrap: pretty; }
.spec-intro { max-width: 72ch; color: var(--muted); font-size: clamp(.9rem, 1.5vw, 1.22rem); line-height: 1.38; }
.spec-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.5rem, 1.35vw, 1.22rem); margin: clamp(.7rem, 2.5vh, 1.45rem) 0 .85rem; }
.spec-flow button, .spec-family, .spec-action { border: 1px solid #4c7180; border-radius: 9px; color: var(--ink); background: #112c3a; }
.spec-flow button { position: relative; display: flex; align-items: center; gap: clamp(.35rem, 1vw, .83rem); padding: clamp(.55rem, 1.24vw, .93rem); text-align: left; }
.spec-flow button:not(:last-child)::after { content: "›"; position: absolute; left: calc(100% + clamp(.12rem,.49vw,.47rem)); color: #9bc0c7; line-height: 1; pointer-events: none; }
.spec-flow button[aria-pressed="true"], .spec-catalog-mode button[aria-pressed="true"] { border-color: var(--cyan); background: #1b4a50; box-shadow: inset 0 -2px var(--cyan); }
.spec-flow strong { color: var(--cyan); font-size: clamp(1.35rem, 3.3vw, 3.3rem); line-height: .95; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.spec-flow span { font-size: clamp(.77rem, 1.55vw, 1.26rem); font-weight: 750; }
.spec-flow small { display: block; margin-top: .23rem; font-size: clamp(.64rem, 1.08vw, .87rem); font-weight: 500; color: var(--muted); }
.spec-flow button:hover, .spec-family:hover, .spec-action:hover { border-color: var(--cyan); background: #1c4856; }
.spec-stage { min-height: clamp(256px, 37vh, 350px); }
.spec-panel { padding: clamp(.65rem, 1.5vw, 1.3rem); border: 1px solid #466d7a; border-radius: 12px; background: #0b2533; animation: spec-enter .32s ease-out both; }
@keyframes spec-enter { from { opacity: .45; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.spec-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .26rem 1rem; margin-bottom: .72rem; }
#especificacao .spec-panel-head h3 { font-size: clamp(1.1rem, 2.12vw, 1.74rem); }
.spec-panel-head p, .spec-note, .spec-family small { color: var(--muted); font-size: clamp(.76rem, 1.08vw, .91rem); line-height: 1.4; }
.spec-families, .spec-exchange { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.45rem, 1vw, .8rem); }
.spec-family { min-width: 0; min-height: 58px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: .45rem; padding: .52rem .62rem; text-align: left; animation: spec-enter .27s both; animation-delay: calc(var(--i) * 23ms); }
.spec-family-code, .spec-kicker { color: var(--cyan); font-size: .76rem; line-height: 1.35; font-weight: 760; letter-spacing: .05em; }
.spec-family strong { display: block; margin-bottom: .2rem; font-size: clamp(.75rem, 1.11vw, .96rem); line-height: 1.26; }
.spec-arrow { color: var(--cyan); font-size: .78rem; }
.spec-feature { padding: .8rem .92rem; border-left: 3px solid var(--cyan); background: #153541; border-radius: 0 8px 8px 0; line-height: 1.38; }
.spec-feature-title { font-size: clamp(.98rem, 1.66vw, 1.35rem); font-weight: 740; margin: .2rem 0; }
#spec-requirement-context { color: var(--muted); font-size: clamp(.8rem, 1.16vw, .98rem); }
.spec-note { margin-top: .68rem; }
.spec-actions { display: flex; flex-wrap: wrap; gap: .48rem; margin-top: .78rem; }
.spec-action { min-height: 38px; padding: .44rem .69rem; font-size: clamp(.74rem, 1.13vw, .92rem); font-weight: 740; background: #1d4951; }
.spec-action.secondary { background: #142d3a; }
.spec-examples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .62rem; }
.spec-examples div, .spec-exchange > div { padding: .6rem .68rem; border-top: 2px solid #5b979b; border-radius: 0 0 7px 7px; background: #132f3d; }
.spec-examples dt { color: var(--muted); font-size: .77rem; margin: .23rem 0 .26rem; }
.spec-examples dd { font-size: clamp(.81rem, 1.35vw, 1.1rem); font-weight: 740; }
.spec-exchange span { display: block; color: var(--cyan); font-size: .76rem; font-weight: 700; }
.spec-exchange strong { display: block; margin: .27rem 0; font-size: clamp(.88rem, 1.43vw, 1.15rem); }
.spec-exchange p { color: var(--muted); font-size: clamp(.8rem, 1.18vw, .97rem); line-height: 1.4; }
.spec-error { margin-top: .4rem; color: var(--amber); }
#spec-catalog { width: min(calc(100% - 24px), 940px); max-height: min(90dvh, 810px); overflow: hidden; }
#spec-catalog[open] { display: grid; grid-template-rows: auto auto auto minmax(75px, 1fr); }
.spec-catalog-tools { display: grid; grid-template-columns: auto minmax(0, 1.14fr) minmax(0, 1fr); align-items: end; gap: .72rem; }
.spec-catalog-mode { display: flex; gap: .35rem; }
.spec-catalog-tools label { min-width: 0; color: var(--muted); font-size: .8rem; }
.spec-catalog-tools select, .spec-catalog-tools input { display: block; width: 100%; min-width: 0; min-height: 38px; padding: .4rem; margin-top: .18rem; border: 1px solid #577580; border-radius: 7px; color: var(--ink); background: #0e2330; font: inherit; font-size: .88rem; }
.spec-catalog-tools :focus-visible, .spec-results :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.spec-results { overflow-y: auto; overscroll-behavior: contain; margin: .55rem 0 0; padding: .22rem .4rem .2rem .22rem; scrollbar-color: #5d8a95 #102b38; }
.spec-results details { border-bottom: 1px solid var(--line); }
.spec-results summary { cursor: pointer; padding: .63rem .45rem; font-size: .91rem; font-weight: 640; line-height: 1.35; overflow-wrap: anywhere; }
.spec-results summary:hover { background: #193d4a; }
.spec-results summary .spec-kicker { margin-inline: .2rem .42rem; }
.spec-result-body { padding: 0 .6rem .7rem 1.4rem; color: var(--muted); font-size: .84rem; line-height: 1.42; }
.spec-result-body p { margin-top: .32rem; }
.spec-result-body strong { color: var(--ink); }
.spec-result-body .spec-action { margin-top: .52rem; }
@media (max-width: 850px) {
  .spec-family { grid-template-columns: auto 1fr; }
  .spec-arrow { display: none; }
}
@media (max-width: 660px) {
  .spec-flow, .spec-families, .spec-examples, .spec-catalog-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-flow button:nth-child(2)::after { display: none; }
  .spec-exchange { grid-template-columns: 1fr; }
  .spec-catalog-mode { grid-column: 1 / -1; }
}
@media (max-width: 370px) {
  .spec-families { grid-template-columns: 1fr; }
  .spec-family { min-height: 45px; }
}
@media print {
  .spec-panel, .spec-family, .spec-flow button, .spec-flow button[aria-pressed="true"], .spec-feature, .spec-examples div, .spec-exchange > div { background: #eef5f4; }
  .spec-actions { display: none; }
}
/* Presentation mode: one motion sequence for each selected stage. */
.spec-flow button { isolation: isolate; }
.spec-flow button::before {
  content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit;
  background: #76dfd71c; transform-origin: left; transform: scaleX(var(--spec-progress, 0)); pointer-events: none;
}
.spec-flow button.spec-passed::before { transform: scaleX(1); background: #76dfd70d; }
.spec-journey { display: flex; justify-content: space-between; align-items: center; gap: .45rem; margin: -.19rem 0 .65rem; }
.spec-play { display: inline-flex; align-items: center; gap: .48rem; border-color: #77c9c5; color: #d5fff7; }
.spec-play-icon { color: var(--cyan); min-width: 1rem; text-align: center; }
.spec-journey-nav { display: flex; align-items: center; gap: .4rem; }
.spec-journey-nav .spec-action { min-width: 38px; }
.spec-journey-step { min-width: 3.4rem; text-align: center; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.spec-presentation { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(230px, 1fr); align-items: start; gap: clamp(.62rem, 1.2vw, 1.15rem); }
.spec-stage { min-height: clamp(238px, 34vh, 335px); }
.spec-stage, .spec-scene { min-width: 0; }
.spec-scene {
  border: 1px solid #466d7a; border-radius: 12px; padding: .75rem;
  background: radial-gradient(ellipse at top right, #1d4151, #0a1e2a 75%);
}
.spec-scene-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .5rem; }
.spec-scene-head span { font-size: clamp(.58rem, 1.05vw, .73rem); color: #acd0d4; font-weight: 780; letter-spacing: .10em; }
.spec-scene-head strong, .spec-model-tag { padding: .24rem .41rem; border: 1px solid #477d82; border-radius: 5px; color: #c2fff2; background: #0d2b37; font-size: clamp(.58rem, 1.0vw, .72rem); font-weight: 760; white-space: nowrap; }
.spec-visual { position: relative; isolation: isolate; aspect-ratio: 360 / 174; overflow: hidden; border: 1px solid #4d727e; border-radius: 8px; background: #0b202d; }
.spec-illustration, .spec-model-frame { position: absolute; width: 100%; height: 100%; inset: 0; }
.spec-illustration text { fill: #adc9ce; font: 700 9px 'Segoe UI', sans-serif; letter-spacing: .045em; }
.spec-visual-card { fill: url(#eri-spec-light); stroke: #8ed5d2; stroke-width: 1.8; stroke-linejoin: round; }
.spec-visual-detail { fill: none; stroke: #b6e7e5; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.spec-visual-pin { fill: #205968; stroke: #76dfd7; stroke-width: 1.3; }
.spec-visual-rows path { stroke: #75e0d4; stroke-width: 4; stroke-linecap: round; opacity: .22; }
.spec-visual-route, .spec-visual-link, .spec-visual-beam { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spec-visual-route { stroke: #527f8c; stroke-dasharray: 3 5; }
.spec-visual-link { stroke: #76dfd7; stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.spec-visual-beam { stroke: #76dfd7; stroke-width: 3.6; opacity: .24; }
.spec-visual-source, .spec-visual-form, .spec-visual-bridge { opacity: .43; transition: opacity .32s ease; }
[data-spec-current="families"] .spec-visual-source,
[data-spec-current="requirements"] :is(.spec-visual-source, .spec-visual-form),
[data-spec-current="fields"] :is(.spec-visual-source, .spec-visual-form),
[data-spec-current="exchange"] :is(.spec-visual-source, .spec-visual-form, .spec-visual-bridge) { opacity: 1; }
[data-spec-current="requirements"] .spec-visual-link.first,
[data-spec-current="exchange"] .spec-visual-link.second { animation: spec-draw .62s ease-out both; }
[data-spec-current="fields"] .spec-visual-link.first,
[data-spec-current="exchange"] .spec-visual-link.first { stroke-dashoffset: 0; }
[data-spec-current="fields"] .spec-visual-rows path { animation: spec-row .36s ease-out both; animation-delay: calc(var(--row) * .13s); }
[data-spec-current="exchange"] :is(.spec-visual-rows path,.spec-visual-beam) { opacity: 1; }
@keyframes spec-draw { to { stroke-dashoffset: 0; } }
@keyframes spec-row { to { opacity: 1; } }
.spec-model-frame { visibility: hidden; background: #0e2b36; }
.spec-model-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 38% 58%; }
.spec-model-tag { position: absolute; bottom: .38rem; left: .38rem; }
.spec-model-sweep { position: absolute; inset: 0 auto 0 0; width: 22%; opacity: 0; pointer-events: none; background: linear-gradient(90deg, transparent, #76dfd751 91%, #b4fff8 99%); }
[data-spec-current="exchange"] .spec-model-frame { visibility: visible; animation: spec-model-in .48s ease-out .63s both; }
[data-spec-current="exchange"] .spec-model-sweep { animation: spec-scan .82s ease-in-out 1.03s both; }
@keyframes spec-model-in { from { opacity: 0; transform: scale(1.045); } to { opacity: 1; transform: scale(1); } }
@keyframes spec-scan { from { transform: translateX(-100%); opacity: .84; } to { transform: translateX(450%); opacity: 0; } }
.spec-scene-caption { margin-top: .54rem; min-height: 2.6em; color: var(--muted); font-size: clamp(.76rem, 1.12vw, .91rem); line-height: 1.37; }
.spec-scene-caption code { display: block; margin-top: .21rem; color: var(--cyan); overflow-wrap: anywhere; }
.spec-family.is-example { border-color: #74b6b9; box-shadow: inset 2px 0 #6fc6c4; }
.spec-examples div { min-width: 0; animation: spec-enter .32s ease-out both; animation-delay: calc(var(--i) * .085s); }
.spec-field-code { display: block; margin-bottom: .18rem; }
.spec-field-rule { display: block; margin-top: .42rem; border: 0; padding: .28rem 0; min-height: 32px; background: transparent; color: #acefe7; font-size: .73rem; font-weight: 650; text-align: left; }
.spec-field-rule:hover { color: #fff; text-decoration: underline; }
@media (max-width: 1030px) {
  .spec-presentation { grid-template-columns: minmax(0, 2.6fr) minmax(188px, 1fr); }
  .spec-examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 730px) {
  .spec-presentation { grid-template-columns: 1fr; }
  .spec-stage { min-height: 0; }
  .spec-scene { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: .43rem .66rem; }
  .spec-scene-head { grid-column: 1 / -1; margin: 0; }
  .spec-scene-caption { margin: 0; }
}
@media (min-width: 800px) and (max-height: 850px) {
  #especificacao { padding-block: 19px; }
  #especificacao h2 { font-size: clamp(1.86rem, 3.75vw, 3.4rem); margin-bottom: .4rem; }
  .spec-intro { max-width: none; font-size: clamp(.83rem, 1.4vw, 1.1rem); }
  .spec-flow { margin: .63rem 0 .57rem; }
  .spec-flow button { padding: .54rem .64rem; }
  .spec-flow strong { font-size: clamp(1.35rem, 3vw, 2.8rem); }
  .spec-journey { margin-bottom: .55rem; }
  .spec-panel { padding: .69rem .77rem; }
  .spec-panel-head { margin-bottom: .5rem; }
  .spec-families { gap: .45rem; }
  .spec-family { grid-template-columns: auto minmax(0, 1fr); min-height: 55px; padding: .38rem .52rem; }
  .spec-family strong { font-size: clamp(.69rem, 1.1vw, .9rem); line-height: 1.2; margin-bottom: .13rem; }
  .spec-family small { font-size: .76rem; }
  .spec-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spec-flow button::before { transform: none; background: none; }
  .spec-visual-link { animation: none !important; }
  [data-spec-current="requirements"] .spec-visual-link.first,
  [data-spec-current="exchange"] .spec-visual-link.second { stroke-dashoffset: 0; }
  [data-spec-current="fields"] .spec-visual-rows path { opacity: 1; }
  [data-spec-current="exchange"] .spec-model-frame { animation: none !important; }
  .spec-model-sweep { display: none; }
}
@media print {
  .spec-journey { display: none; }
  .spec-presentation { grid-template-columns: 1fr; }
  .spec-scene { display: none; }
}
