/* Copyright (C) Rein Ytterberg */
.chain-opening {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 45px;
  padding-top: 45px;
  padding-bottom: 28px;
}
.chain-opening h1 {
  font-size: clamp(3.4rem, 6vw, 6rem);
}
.chain-opening em,
.chain-heading em,
.chain-close em {
  color: var(--blue);
}
.chain-opening p {
  font-size: 1.2rem;
  max-width: 390px;
}
.assembly-section,
.marketplace-section {
  padding-top: 38px;
  padding-bottom: 38px;
}
.chain-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 50px;
  margin-bottom: 32px;
}
.chain-heading h2 {
  font-size: clamp(2.4rem, 3.8vw, 3.9rem);
}
.chain-heading p {
  max-width: 380px;
}
.build-controls,
.feedback-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-bottom: 25px;
}
.build-controls button,
.feedback-controls button {
  padding: 9px 0;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: inherit;
  font-weight: 700;
}
.build-controls button[aria-pressed='true'],
.feedback-controls button[aria-pressed='true'] {
  border-color: var(--blue);
  color: var(--blue);
}
.assembly-board {
  display: grid;
  grid-template-columns: 1fr 40px 0.85fr 1.15fr;
  align-items: stretch;
  min-height: 0;
}
.supplier-tree {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
}
.source-node {
  padding: 10px 14px;
  background: #edf3fe;
  border-left: 4px solid var(--blue);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.source-node > span {
  font-size: 0.875rem;
  color: #344c70;
}
.source-node b {
  font-size: 1.15rem;
}
.source-node ul {
  font-size: 0.875rem;
  margin: 6px 0;
  padding-left: 20px;
}
.source-node small {
  font-size: 0.875rem;
}
.merge-lines svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.merge-lines path {
  stroke: #7e9acb;
  stroke-width: 2;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.merge-lines .signal-path {
  stroke: var(--blue);
  stroke-width: 4;
  stroke-dasharray: 9 5;
}
.assembled-product {
  text-align: center;
  background: #f5f8fd;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.product-owner {
  font-size: 0.875rem;
}
.assembled-product img {
  width: 100%;
  max-width: 120px;
  height: 120px;
  aspect-ratio: 1;
  object-fit: contain;
}
.assembled-product h3 {
  font-size: 1.8rem;
  margin: 5px 0 12px;
}
.variant-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.variant-switch button {
  font-size: 0.875rem;
  padding: 7px 11px;
  border: 1px solid #a8b9d2;
  background: white;
  color: var(--ink);
}
.variant-switch button[aria-pressed='true'] {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
#product-config {
  font-size: 0.9375rem;
}
.assembly-recipe {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}
.assembly-recipe > span {
  background: #dce8ff;
  padding: 5px 7px;
  font-size: 0.875rem;
}
.customer-gate {
  padding: 18px;
  background: #103955;
  color: white;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;
}
.customer-gate > span {
  font-size: 0.875rem;
}
.gate-symbol {
  display: none;
  font-size: 2.5rem;
  color: #94ecc8;
}
.customer-gate h3 {
  font-size: 1.4rem;
}
.customer-gate p {
  font-size: 0.9375rem;
}
.gate-rule {
  border-top: 1px solid #ffffff55;
  padding-top: 15px;
}
.gate-rule b {
  font-size: 0.875rem;
  color: #bed7f5;
  display: block;
  margin-bottom: 8px;
}
.customer-gate a {
  font-size: 0.875rem;
  text-underline-offset: 4px;
}
.assembly-board[data-state='restricted'] .electronic-node {
  background: #ffe4dc;
  border-color: #b42620;
}
.assembly-board[data-state='restricted'] .signal-path {
  stroke: #b42620;
}
.assembly-board[data-state='restricted'] .customer-gate {
  background: #792b29;
}
.assembly-board[data-state='restricted'] .gate-symbol {
  display: none;
  color: #ffb69f;
}
.assembly-board[data-state='revision'] .battery-node {
  background: #e0f3e7;
  border-color: #167849;
}
.build-explanation {
  min-height: 0;
  background: #eaf0ff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
}
.build-explanation p {
  max-width: none;
}
.history-comparison {
  display: grid;
  grid-template-columns: 1fr 40px 1fr 1.2fr;
  gap: 24px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.history-comparison span {
  display: block;
  font-size: 0.875rem;
}
.history-comparison b {
  font-size: 1.25rem;
  display: block;
}
.history-comparison p {
  font-size: 0.9375rem;
}
.history-link {
  font-size: 1.8rem;
  color: var(--blue);
}
.media-bridge {
  display: grid;
  grid-template-columns: 0.85fr 0.45fr 1.2fr;
  align-items: center;
  gap: 28px;
}
.manufacturer-media {
  border-top: 3px solid var(--blue);
  padding: 18px 15px;
  background: #f0f4fc;
}
.manufacturer-media > span {
  font-size: 0.9375rem;
  font-weight: 700;
}
.manufacturer-media img {
  width: 100%;
  height: 125px;
  object-fit: contain;
}
.media-docs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.media-docs span {
  font-size: 0.875rem;
  background: white;
  border-bottom: 2px solid #b4c8ed;
  padding: 8px;
}
.api-bridge {
  text-align: center;
  color: var(--blue);
}
.api-bridge > b {
  font-size: 1.5rem;
}
.api-bridge p {
  font-size: 0.875rem;
  line-height: 1.7;
}
.api-bridge button {
  font-size: 0.875rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 5px 0;
  background: none;
  color: var(--blue);
  margin-top: 20px;
}
.media-line {
  height: 2px;
  background: #8faee8;
  position: relative;
  margin: 20px 0;
}
.media-line i {
  position: absolute;
  width: 12px;
  height: 12px;
  top: -5px;
  left: 0;
  background: var(--orange);
  border-radius: 50%;
}
.media-bridge.is-transferring .media-line i {
  animation: transfer 1.6s ease forwards;
}
@keyframes transfer {
  to {
    left: calc(100% - 12px);
  }
}
.marketplace-window {
  border: 1px solid #bac6d9;
  box-shadow: 12px 12px 0 #eaf0ff;
}
.shop-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  background: #142647;
  color: white;
  padding: 16px;
}
.shop-top b {
  font-size: 1rem;
}
.shop-top span {
  font-size: 0.875rem;
}
.shop-product {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 15px;
  padding: 16px;
  align-items: center;
}
.shop-product img {
  width: 100%;
  height: 125px;
  aspect-ratio: 1;
  object-fit: contain;
}
.shop-product h3 {
  font-size: 2rem;
  margin: 10px 0;
}
.shop-product span,
.shop-product p {
  font-size: 0.875rem;
}
.shop-document {
  display: block;
  color: var(--blue);
  margin-top: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.shop-provenance {
  padding: 13px 16px;
  border-top: 1px solid #bac6d9;
  font-size: 0.875rem;
}
.media-note {
  margin-top: 18px;
  min-height: 0;
  max-width: none;
  font-size: 0.9375rem;
}
.life-section {
  background: #eaf1fc;
  padding: 55px 0;
}
.life-art img {
  width: 100%;
  aspect-ratio: 2/1;
  object-fit: cover;
}
.feedback-controls {
  margin-top: 25px;
}
.feedback-stage {
  display: grid;
  grid-template-columns: 1fr 30px 1.05fr 30px 1fr;
  gap: 20px;
  align-items: stretch;
}
.feedback-source,
.feedback-action {
  padding: 22px 0;
  display: grid;
  grid-template-rows: 38px 78px 1fr;
  gap: 10px;
}
.feedback-stage span {
  font-size: 0.875rem;
  color: #335578;
}
.feedback-stage h3 {
  font-size: 1.7rem;
}
.feedback-stage p {
  font-size: 1rem;
}
.feedback-connector {
  align-self: center;
  color: var(--blue);
  font-size: 1.6rem;
}
.twin-record {
  background: white;
  padding: 22px;
  border-top: 4px solid var(--blue);
}
.twin-record h3 {
  font-size: 2rem;
  margin: 13px 0;
}
.twin-record ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}
.twin-record li {
  border-bottom: 1px solid #c5d1e5;
  padding: 13px 0;
  font-size: 0.9375rem;
}
.twin-record .new-event {
  color: var(--blue);
  font-weight: 700;
}
.return-caption {
  border-top: 1px solid #b8cae7;
  margin-top: 30px;
  padding-top: 20px;
}
.return-caption p {
  margin-top: 5px;
  max-width: none;
}
.chain-close {
  padding-top: 60px;
  padding-bottom: 65px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}
.chain-close h2 {
  font-size: clamp(2.5rem, 4vw, 4rem);
}
.chain-close .cta {
  margin-top: 25px;
}
@media (max-width: 1000px) {
  .assembly-board {
    grid-template-columns: 1fr 40px 1fr;
  }
  .customer-gate {
    grid-column: 1/-1;
    margin-top: 18px;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto auto auto;
    gap: 15px 25px;
  }
  .customer-gate > span {
    grid-column: 1/-1;
  }
  .gate-symbol {
    display: none;
    display: none;
  }
  .customer-gate h3 {
    grid-column: 1;
  }
  .gate-rule {
    grid-column: 2;
    grid-row: 2/4;
    border: 0;
    padding: 0;
  }
  .customer-gate a {
    grid-column: 1;
  }
  .chain-heading {
    gap: 30px;
  }
  .media-bridge {
    gap: 18px;
  }
  .shop-product {
    grid-template-columns: 1fr;
  }
  .shop-product img {
    height: 170px;
  }
  .feedback-stage {
    gap: 12px;
  }
  .history-comparison {
    grid-template-columns: 1fr 30px 1fr;
  }
  .history-comparison > p {
    grid-column: 1/-1;
  }
}
@media (max-width: 720px) {
  .chain-opening,
  .chain-heading {
    display: block;
  }
  .chain-opening p,
  .chain-heading p {
    margin-top: 20px;
    max-width: 100%;
  }
  .assembly-section,
  .marketplace-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }
  .assembly-board {
    grid-template-columns: 1fr 25px 1fr;
  }
  .source-node {
    padding: 12px 10px;
  }
  .source-node b {
    font-size: 1rem;
  }
  .source-node ul {
    padding-left: 15px;
  }
  .assembled-product {
    padding: 15px 10px;
  }
  .assembled-product h3 {
    font-size: 2rem;
  }
  .variant-switch {
    flex-wrap: wrap;
    justify-content: center;
  }
  .customer-gate {
    display: flex;
    flex-direction: column;
    min-height: 345px;
  }
  .customer-gate h3 {
    min-height: 56px;
  }
  .customer-gate > p {
    min-height: 75px;
  }
  .gate-rule {
    min-height: 105px;
  }
  .build-explanation {
    min-height: 155px;
    padding: 18px;
  }
  .media-bridge {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .manufacturer-media img {
    height: 210px;
  }
  .api-bridge {
    display: grid;
    grid-template-columns: 60px 1fr 110px;
    align-items: center;
    gap: 15px;
  }
  .api-bridge p {
    line-height: 1.5;
  }
  .api-bridge button {
    grid-column: 1/-1;
    margin: 0;
    justify-self: center;
  }
  .shop-product {
    grid-template-columns: 1fr 1fr;
  }
  .media-note {
    min-height: 4.5em;
  }
  .feedback-stage {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .feedback-source,
  .feedback-action {
    grid-template-rows: 25px 55px 1fr;
    min-height: 225px;
  }
  .feedback-connector {
    display: none;
  }
  .twin-record {
    min-height: 270px;
  }
  .chain-close {
    grid-template-columns: 1fr;
    gap: 25px;
    padding-top: 40px;
    padding-bottom: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .media-bridge.is-transferring .media-line i {
    animation: none;
    left: calc(100% - 12px);
  }
}

/* Intrinsic size reservation keeps all interactive text and its neighbours still. */
.product-chain-page .reserved-copy {
  display: grid;
}
.reserved-copy > .live-value,
.reserved-copy > .size-reserve {
  grid-area: 1/1;
  min-width: 0;
}
.reserved-copy > .size-reserve {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}
.life-art {
  position: relative;
}
.life-paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.life-paths > path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-dasharray: 7 5;
  vector-effect: non-scaling-stroke;
}
.life-paths .packaging-path {
  opacity: 0.25;
}
.life-art[data-event='packaging'] .packaging-path {
  opacity: 1;
  stroke-width: 4;
}
.life-art[data-event='packaging'] .data-path {
  opacity: 0.2;
}
.life-identity {
  position: absolute;
  left: 40%;
  top: 31%;
  width: 24%;
  text-align: center;
  color: var(--blue);
}
.life-identity b {
  font-size: 1.5rem;
}
.life-identity > span {
  display: block;
  font-size: 0.875rem;
}
@media (max-width: 720px) {
  .life-identity b {
    font-size: 1rem;
  }
  .life-identity > span {
    display: none;
  }
}

/* A compact illustrated fishbone exposes who joins the chain and where. */
.fishbone-key {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  margin-bottom: 10px;
}
.fishbone-key span {
  display: flex;
  gap: 9px;
  align-items: center;
}
.fishbone-key i {
  width: 25px;
  height: 3px;
  background: var(--blue);
}
.fishbone-key .key-return {
  background: #bd4816;
}
.fishbone-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
}
.fishbone-scroll:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
.fishbone {
  position: relative;
  height: 440px;
  min-width: 960px;
  background: #f4f8ff;
  border-bottom: 1px solid #c1cfe4;
}
.fish-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fish-connections > path {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.fish-spine {
  stroke: var(--blue);
  stroke-width: 5;
}
.fish-bone {
  stroke: #7098d9;
  stroke-width: 2;
}
.fish-back {
  stroke: #bd4816;
  stroke-width: 2;
  stroke-dasharray: 7 5;
}
.fish-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: 145px;
  text-align: center;
  background: #f4f8ff;
  padding: 3px 5px;
}
.fish-node b {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.2;
}
.fish-node > span {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25;
  margin-top: 4px;
}
.fish-node.main-node {
  width: 150px;
  background: white;
  border-bottom: 3px solid var(--blue);
  padding-bottom: 8px;
}
.fish-thumb {
  height: 55px;
  background-image: url('assets/chain-businesses.webp');
  background-repeat: no-repeat;
  background-size: 570% auto;
  background-position: 0 50%;
  margin-bottom: 4px;
}
.art-shell {
  background-position: 0 50%;
}
.art-electronics {
  background-position: 24% 50%;
}
.art-battery {
  background-position: 45% 50%;
}
.art-manufacturer {
  background-position: 68% 50%;
}
.art-warehouse {
  background-position: 91% 50%;
}
.art-retailer {
  background-position: 100% 50%;
}
.art-owner {
  background-image: url('assets/chain-lifecycle.webp');
  background-size: 300% auto;
  background-position: 100% 40%;
}
.art-logistics {
  background-image: url('assets/ai-trade.webp');
  background-size: 300% auto;
  background-position: 0 65%;
}
.art-insurer {
  background-image: url('assets/agreement-claims.webp');
  background-size: 320% auto;
  background-position: 50% 45%;
}
.art-marketplace {
  background-image: url('assets/retail-edi.webp');
  background-size: cover;
  background-position: 80% 50%;
}
.art-service {
  background-image: url('assets/chain-lifecycle.webp');
  background-size: 300% auto;
  background-position: 0 40%;
}
.fish-merge {
  position: absolute;
  left: 16%;
  top: 44%;
  font-size: 0.875rem;
  background: #f4f8ff;
  padding: 0 5px;
  color: var(--blue);
}
.fish-return-label {
  position: absolute;
  bottom: 0;
  left: 61%;
  transform: translateX(-50%);
  background: #f4f8ff;
  color: #974018;
  font-size: 0.875rem;
  padding: 0 10px;
  white-space: nowrap;
}
.assembly-recipe {
  align-items: stretch;
}
.assembly-recipe > span {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 32px;
}
.assembly-recipe > span.reserved-copy {
  align-items: center;
}
.assembly-recipe > span > span {
  padding: 0;
  background: none;
  align-self: center;
}
.source-node ul {
  margin: 3px 0;
}
.chain-heading {
  margin-bottom: 22px;
}
.marketplace-section .chain-heading h2 {
  font-size: clamp(2rem, 3.3vw, 3.3rem);
}
@media (min-width: 1001px) {
  .marketplace-section .media-bridge {
    grid-template-columns: 1fr 150px 1.35fr;
  }
  .marketplace-section .shop-product {
    grid-template-columns: 140px 1fr;
  }
  .marketplace-section .shop-product img {
    height: 120px;
  }
  .marketplace-section .manufacturer-media {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 8px;
  }
  .manufacturer-media > span {
    grid-column: 1/-1;
  }
  .marketplace-section .media-docs {
    display: grid;
  }
  .marketplace-section .media-docs span {
    padding: 5px 8px;
  }
}
@media (max-width: 1000px) {
  .assembly-board {
    grid-template-columns: 1fr 25px 0.8fr 1fr;
  }
  .customer-gate {
    grid-column: auto;
    margin-top: 0;
    display: flex;
    flex-direction: column;
  }
  .gate-rule {
    border-top: 1px solid #ffffff55;
    padding-top: 10px;
  }
  .customer-gate h3 {
    min-height: 0;
  }
  .customer-gate > p {
    min-height: 0;
  }
  .customer-gate {
    min-height: 0;
  }
  .gate-rule {
    min-height: 0;
  }
  .shop-product {
    grid-template-columns: 120px 1fr;
  }
  .media-bridge {
    grid-template-columns: 1fr 100px 1.3fr;
  }
  .manufacturer-media img {
    height: 120px;
  }
  .shop-product img {
    height: 110px;
  }
  .shop-top {
    flex-wrap: wrap;
    gap: 3px;
  }
}
@media (max-width: 720px) {
  .assembly-board {
    grid-template-columns: 1fr 25px 1fr;
  }
  .customer-gate {
    grid-column: 1/-1;
  }
  .media-bridge {
    grid-template-columns: 1fr;
  }
  .manufacturer-media {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    align-items: center;
  }
  .manufacturer-media > span {
    grid-column: 1/-1;
  }
  .media-docs {
    display: grid;
  }
  .marketplace-section .api-bridge {
    grid-template-columns: 60px 1fr 110px;
  }
  .build-explanation {
    min-height: 0;
  }
  .media-note {
    min-height: 0;
  }
  .history-comparison {
    gap: 12px;
  }
  .fishbone-key {
    gap: 8px 20px;
  }
}

/* Interactive component trace and local owner-service previews */
.script-notice {
  padding: 12px 16px;
  background: #fff1bb;
  color: #503b00;
}
[hidden] {
  display: none !important;
}
.assembly-switch {
  display: grid;
}
.assembly-switch > * {
  grid-area: 1 / 1;
  min-width: 0;
}
.trace-replaced {
  visibility: hidden;
  pointer-events: none;
}
.restriction-trace {
  z-index: 1;
  align-self: stretch;
  background: #fff7f6;
  padding: 22px;
  border-top: 4px solid #b91c35;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.trace-heading {
  display: flex;
  gap: 16px;
  align-items: center;
}
.trace-heading h3 {
  color: #a3142e;
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}
.trace-heading p {
  margin: 0;
  max-width: 78ch;
  color: #3e2830;
}
.trace-stop {
  font-size: 42px;
  color: #b91c35;
}
.trace-scroll {
  overflow-x: auto;
}
.restriction-map {
  width: 100%;
  min-width: 740px;
  display: block;
  margin-top: 12px;
}
.trace-major circle {
  fill: #b91c35;
  stroke: #fff7f6;
  stroke-width: 4;
}
.trace-symbol {
  fill: white;
  font-weight: 800;
  font-size: 16px;
  text-anchor: middle;
}
.trace-label {
  fill: #432a31;
  font-size: 15px;
  font-weight: 650;
  text-anchor: middle;
}
.trace-minor {
  fill: #5b6775;
  font-size: 15px;
}
.trace-red {
  fill: #b91c35;
}
.trace-caption {
  margin: 0;
  font-weight: 700;
  color: #a3142e;
}
.chain-dialog {
  position: fixed;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  box-sizing: border-box;
  border: 0;
  border-radius: 16px;
  padding: clamp(24px, 4vw, 40px);
  color: #122c43;
  background: #fff;
  overflow-y: auto;
  box-shadow: 0 24px 100px #07183355;
}
.chain-dialog::backdrop {
  background: #081b39b8;
}
.chain-dialog h2 {
  margin: 12px 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}
.chain-dialog p {
  line-height: 1.55;
}
.dialog-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 30px;
  cursor: pointer;
  color: #122c43;
}
.dialog-unit {
  color: #174ec3;
  font-weight: 700;
}
.chain-dialog label {
  display: block;
  font-weight: 750;
  margin: 22px 0 8px;
}
.chain-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font: inherit;
  line-height: 1.5;
  color: #122c43;
  border: 1px solid #8ca1b5;
  border-radius: 6px;
  resize: vertical;
}
.chain-dialog input[type='file'] {
  width: 100%;
  font: inherit;
  padding: 10px 0;
}
.chain-dialog small {
  display: block;
  line-height: 1.5;
}
.chain-dialog .cta {
  display: inline-flex;
  border: 0;
  cursor: pointer;
}
.sensor-attached {
  padding: 10px 12px;
  background: #edf4ff;
  font-size: 14px;
}
.photo-previews {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.photo-previews figure {
  margin: 0;
  min-width: 0;
}
.photo-previews img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 5px;
}
.photo-previews figcaption {
  font-size: 12px;
  overflow-wrap: anywhere;
}
#report-status > * {
  display: block;
  margin-top: 10px;
}
.return-steps {
  padding-left: 22px;
  margin: 24px 0;
}
.return-steps li {
  padding: 0 0 16px 8px;
}
.return-steps span {
  display: block;
  margin-top: 5px;
}
.return-packaging-note {
  border-top: 1px solid #dbe3ee;
  padding-top: 18px;
}
@media (max-width: 720px) {
  .restriction-trace {
    padding: 18px 12px;
    justify-content: flex-start;
  }
  .trace-heading {
    align-items: flex-start;
  }
  .trace-caption {
    font-size: 14px;
  }
}
/* Both views contribute their natural height, so switching never moves the section below. */
#restriction-trace[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

/* Copyright (C) Rein Ytterberg */
#owner-dialog.report-window {
  width: min(980px, calc(100vw - 32px));
  padding: 0;
  border-radius: 14px;
  background: white;
}
.report-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: #edf2f8;
  border-bottom: 1px solid #d5dfea;
  font-size: 14px;
}
.window-dot {
  width: 10px;
  height: 10px;
  background: #235bdd;
  border-radius: 50%;
}
.preview-label {
  margin-left: auto;
  margin-right: 32px;
  color: #4a6076;
  font-size: 13px;
}
.report-body {
  padding: 24px 30px;
}
.report-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.report-heading img {
  width: 88px;
  height: 80px;
  object-fit: contain;
}
.report-kicker {
  font-size: 14px;
  color: #2459bd;
  font-weight: 700;
}
#owner-dialog h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 8px 0;
  letter-spacing: -0.03em;
}
.report-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
#owner-dialog label {
  margin: 0 0 10px;
  font-size: 16px;
}
#owner-dialog textarea {
  display: block;
  font-size: 17px;
  padding: 16px;
  min-height: 216px;
  background: #fbfcff;
  border: 1px solid #869cb9;
  border-radius: 8px;
}
#owner-dialog textarea:focus {
  outline: 3px solid #bdd2ff;
  border-color: #2459dd;
}
.report-context {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 12px;
  background: #eaf7f0;
  border-radius: 8px;
  color: #17603e;
}
.context-check {
  font-size: 22px;
}
.report-context small {
  margin-top: 4px;
  font-size: 13px;
}
#owner-dialog .photo-previews {
  margin: 0 0 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#owner-dialog .photo-previews figure:only-child {
  grid-column: 1 / -1;
}
#owner-dialog .photo-previews img {
  width: 100%;
  height: 178px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  display: block;
}
#owner-dialog .photo-previews figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  padding: 9px 10px;
  font-size: 13px;
  background: #edf2f8;
  border-radius: 0 0 8px 8px;
}
#owner-dialog .photo-previews figcaption b {
  color: #17603e;
}
#owner-dialog label.add-photos {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 2px dashed #91ace0;
  border-radius: 8px;
  color: #194dbb;
  cursor: pointer;
  background: #f4f8ff;
}
.add-photos > span {
  font-size: 30px;
  line-height: 1;
}
.add-photos small {
  font-size: 13px;
  font-weight: 400;
  margin-top: 3px;
}
#owner-dialog .report-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  overflow: hidden;
}
.report-photos:focus-within .add-photos {
  outline: 2px solid #235bdd;
  outline-offset: 2px;
}
#photo-guidance {
  color: #50647b;
  font-size: 12px;
}
.report-footer {
  padding: 18px 30px;
  border-top: 1px solid #dce4ed;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.report-footer > span {
  color: #50647b;
  font-size: 13px;
}
#owner-dialog .cta {
  background: #174ee0;
  color: white;
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  border-radius: 7px;
}
#owner-dialog #report-status {
  margin: 0;
  padding: 0;
}
#owner-dialog #report-status:not(:empty) {
  padding: 16px 30px;
  background: #edf7f1;
}
.return-visual {
  display: grid;
  grid-template-columns: 1fr 20px 1fr 20px 1fr;
  align-items: center;
  gap: 6px;
  margin: 24px 0;
  text-align: center;
}
.return-visual > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.return-visual img {
  width: 105px;
  height: 90px;
  object-fit: contain;
}
.return-visual b {
  font-size: 14px;
}
.return-visual span {
  font-size: 13px;
}
.return-visual .return-arrow {
  font-size: 24px;
  color: #174ee0;
}
.return-visual .receipt-icon {
  height: 90px;
  display: grid;
  place-items: center;
  font-size: 50px;
  color: #188154;
}
@media (max-width: 650px) {
  .report-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .report-body {
    padding: 18px;
  }
  .report-titlebar {
    padding: 14px 18px;
  }
  .report-footer {
    padding: 16px 18px;
    flex-wrap: wrap;
  }
  .report-heading img {
    width: 66px;
  }
  .preview-label {
    font-size: 11px;
  }
  #owner-dialog textarea {
    min-height: 150px;
  }
  .return-visual img {
    width: 75px;
  }
}
