.lens-section {
  margin: 0 22px 18px;
  padding: 22px;
  border: 1px solid rgba(184, 151, 84, 0.23);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(18, 45, 35, 0.9), rgba(8, 27, 21, 0.94)),
    #0b211a;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.lens-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 6px 26px;
  align-items: end;
  margin-bottom: 18px;
}

.lens-section-head .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}

.lens-section-head h2 {
  margin: 0;
  color: #f1ead7;
  font: 600 clamp(1.2rem, 2vw, 1.65rem) / 1.2 ui-serif, "Songti SC", serif;
}

.lens-note {
  margin: 0;
  color: #aebeb5;
  font-size: 0.84rem;
  line-height: 1.55;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-button,
.route-card,
.panorama-domain,
.panorama-cell,
.dce-card,
.role-chip {
  min-width: 0;
  font: inherit;
  overflow-wrap: anywhere;
}

.task-button {
  min-height: 112px;
  padding: 14px;
  color: #dde7df;
  text-align: left;
  border: 1px solid rgba(159, 179, 166, 0.2);
  border-radius: 13px;
  background: rgba(5, 24, 18, 0.76);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.task-button:hover,
.task-button:focus-visible {
  border-color: rgba(213, 177, 98, 0.66);
  transform: translateY(-1px);
}

.task-button.is-active {
  border-color: #c49b4f;
  background: linear-gradient(145deg, rgba(70, 57, 25, 0.72), rgba(10, 35, 26, 0.9));
  box-shadow: 0 0 0 1px rgba(196, 155, 79, 0.14);
}

.task-button span,
.task-button strong,
.task-button small {
  display: block;
}

.task-index {
  margin-bottom: 12px;
  color: #c8a45e;
  font: 700 0.72rem/1 ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.12em;
}

.task-button strong {
  color: #f0eadb;
  line-height: 1.42;
}

.task-button small {
  margin-top: 10px;
  color: #8da298;
}

.role-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-chip {
  padding: 9px 13px;
  color: #bdcbc3;
  border: 1px solid rgba(154, 176, 164, 0.22);
  border-radius: 999px;
  background: rgba(4, 23, 17, 0.72);
  cursor: pointer;
}

.role-chip:hover,
.role-chip:focus-visible,
.role-chip.is-active {
  color: #f0e6cf;
  border-color: #b99551;
  background: rgba(94, 71, 27, 0.5);
}

.route-empty,
.route-warning {
  padding: 14px 16px;
  border-radius: 12px;
}

.route-empty {
  border: 1px dashed rgba(145, 164, 153, 0.32);
  color: #aebdb5;
}

.route-empty strong,
.route-empty p {
  display: block;
  margin: 0;
}

.route-empty p {
  margin-top: 5px;
  font-size: 0.86rem;
}

.route-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(194, 123, 83, 0.48);
  background: rgba(89, 44, 28, 0.28);
}

.route-warning strong {
  color: #efc2a2;
}

.route-warning span {
  color: #c5b3a7;
  font-size: 0.83rem;
}

.route-none {
  color: #c7b9ae;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.route-card {
  display: flex;
  min-height: 235px;
  padding: 15px;
  flex-direction: column;
  align-items: flex-start;
  color: #d8e1dc;
  text-align: left;
  border: 1px solid rgba(154, 177, 164, 0.22);
  border-radius: 14px;
  background: rgba(5, 25, 19, 0.82);
  cursor: pointer;
}

.route-card:hover,
.route-card:focus-visible {
  border-color: rgba(204, 164, 83, 0.72);
}

.route-rank {
  color: #caa75d;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.route-card h3 {
  margin: 10px 0 5px;
  color: #f0e9d8;
  font-size: 1.05rem;
}

.route-card p {
  margin: 0 0 12px;
  color: #b4c2ba;
  line-height: 1.5;
}

.route-card small {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}

.route-evidence {
  color: #e0ab84;
}

.route-risk {
  color: #899c91;
}

.route-next {
  margin-top: auto;
  padding-top: 14px;
  color: #d9c18e;
  font-size: 0.82rem;
  line-height: 1.45;
}

.business-panorama {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(112px, 0.65fr));
  gap: 7px;
}

.panorama-corner,
.panorama-layer-head {
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(188, 153, 82, 0.28);
}

.panorama-corner {
  color: #b79c63;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
}

.panorama-layer-head b,
.panorama-layer-head span {
  display: block;
}

.panorama-layer-head b {
  color: #d2ae61;
}

.panorama-layer-head span {
  margin-top: 4px;
  color: #879b90;
  font-size: 0.72rem;
}

.panorama-domain,
.panorama-cell {
  min-height: 72px;
  color: #dce5df;
  border: 1px solid rgba(142, 165, 152, 0.18);
  border-radius: 10px;
  background: rgba(5, 24, 18, 0.72);
  cursor: pointer;
}

.panorama-domain {
  padding: 11px 13px;
  text-align: left;
}

.panorama-domain strong,
.panorama-domain span {
  display: block;
}

.panorama-domain span {
  margin-top: 5px;
  color: #91a49a;
  font-size: 0.72rem;
  line-height: 1.35;
}

.panorama-domain.is-routed {
  border-color: rgba(114, 167, 134, 0.5);
}

.panorama-domain.is-selected {
  border-color: #c79e50;
  background: rgba(75, 60, 28, 0.48);
}

.panorama-cell {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 3px 8px;
  padding: 10px;
  text-align: left;
}

.panorama-cell b {
  grid-row: 1 / 3;
  color: #d1aa5c;
  font-size: 1rem;
}

.panorama-cell span {
  color: #c5d1ca;
  font: 0.72rem/1.25 ui-monospace, SFMono-Regular, monospace;
}

.panorama-cell small {
  color: #8ea096;
  font-size: 0.68rem;
}

.panorama-cell.tone-bad {
  border-color: rgba(193, 101, 77, 0.45);
}

.panorama-cell.tone-warn {
  border-color: rgba(196, 148, 74, 0.42);
}

.domain-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 24px;
  margin-bottom: 14px;
}

.domain-summary h2 {
  margin: 3px 0 7px;
  color: #f0e8d6;
  font: 600 clamp(1.35rem, 2.2vw, 1.8rem) / 1.2 ui-serif, "Songti SC", serif;
}

.domain-promise {
  max-width: 720px;
  margin: 0;
  color: #b6c5bc;
  line-height: 1.55;
}

.domain-facts {
  display: grid;
  gap: 7px;
}

.domain-fact {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(151, 172, 160, 0.12);
}

.domain-fact span {
  color: #8ea197;
  font-size: 0.74rem;
}

.domain-fact strong {
  color: #d3ddd7;
  font-size: 0.79rem;
  line-height: 1.4;
}

.dce-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dce-card {
  display: flex;
  min-height: 270px;
  padding: 16px;
  flex-direction: column;
  align-items: flex-start;
  color: #d7e1db;
  text-align: left;
  border: 1px solid rgba(150, 172, 159, 0.22);
  border-radius: 14px;
  background: rgba(5, 24, 18, 0.78);
  cursor: pointer;
}

.dce-card:hover,
.dce-card:focus-visible {
  border-color: rgba(202, 162, 81, 0.72);
}

.dce-code {
  color: #d1aa5b;
  font: 700 0.78rem/1 ui-monospace, SFMono-Regular, monospace;
}

.dce-card h3 {
  margin: 9px 0 11px;
  color: #f0e9d9;
  font-size: 1rem;
}

.dce-card p {
  margin: 0;
  line-height: 1.52;
}

.dce-objective {
  color: #c7d2cc;
}

.dce-result {
  margin-top: 10px !important;
  color: #93a79c;
  font-size: 0.8rem;
}

.dce-evidence {
  margin-top: 14px;
  color: #d9a77f;
  font-size: 0.76rem;
}

.dce-next {
  margin-top: auto;
  padding-top: 14px;
  color: #d8bf88;
  font-size: 0.79rem;
  line-height: 1.45;
}

.lens-details {
  margin-top: 10px;
  border: 1px solid rgba(148, 169, 156, 0.18);
  border-radius: 12px;
  background: rgba(4, 21, 16, 0.5);
}

.lens-details > summary {
  padding: 14px 16px;
  color: #d9c99f;
  cursor: pointer;
  font-weight: 650;
}

.legacy-grid,
.foundation-grid {
  display: grid;
  gap: 9px;
  padding: 0 14px 14px;
}

.legacy-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.legacy-link {
  display: flex;
  min-height: 88px;
  padding: 12px;
  flex-direction: column;
  color: #d9e2dd;
  text-decoration: none;
  border: 1px solid rgba(151, 174, 160, 0.2);
  border-radius: 10px;
  background: rgba(9, 35, 26, 0.66);
}

.legacy-link:hover,
.legacy-link:focus-visible {
  border-color: #b89450;
}

.legacy-link span {
  margin-top: 4px;
  color: #bca66f;
  font-size: 0.78rem;
}

.legacy-link small {
  margin-top: auto;
  color: #83978c;
}

.foundation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.foundation-card {
  padding: 14px;
  border: 1px solid rgba(151, 174, 160, 0.16);
  border-radius: 10px;
  background: rgba(7, 30, 22, 0.6);
}

.foundation-card h3,
.foundation-card p {
  margin: 0;
}

.foundation-card h3 {
  color: #e5dcc5;
}

.foundation-card p {
  margin-top: 5px;
  color: #8ea197;
  font-size: 0.78rem;
}

.foundation-cell {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 9px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 169, 156, 0.12);
}

.foundation-cell b {
  grid-row: 1 / 3;
  color: #c9a75e;
}

.foundation-cell span {
  color: #c3cec8;
  font-size: 0.78rem;
  line-height: 1.4;
}

.foundation-cell small {
  color: #7e9187;
  font-size: 0.7rem;
}

.canonical-details .matrix-section {
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(148, 169, 156, 0.16);
  border-radius: 0 0 12px 12px;
  box-shadow: none;
}

.task-button:focus-visible,
.role-chip:focus-visible,
.route-card:focus-visible,
.panorama-domain:focus-visible,
.panorama-cell:focus-visible,
.dce-card:focus-visible,
.legacy-link:focus-visible {
  outline: 3px solid rgba(224, 185, 97, 0.82);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-grid,
  .dce-grid {
    grid-template-columns: 1fr;
  }

  .route-card,
  .dce-card {
    min-height: 0;
  }

  .domain-summary {
    grid-template-columns: 1fr;
  }

  .legacy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .lens-section {
    margin: 0 10px 12px;
    padding: 15px;
    border-radius: 14px;
  }

  .lens-section-head {
    grid-template-columns: 1fr;
  }

  .task-grid,
  .legacy-grid,
  .foundation-grid {
    grid-template-columns: 1fr;
  }

  .task-button {
    min-height: 92px;
  }

  .route-warning {
    grid-template-columns: 1fr;
  }

  .business-panorama {
    display: block;
  }

  .panorama-corner,
  .panorama-layer-head {
    display: none;
  }

  .panorama-domain {
    width: 100%;
    margin-top: 10px;
  }

  .panorama-cell {
    display: inline-grid;
    width: calc(33.333% - 6px);
    min-height: 78px;
    margin: 6px 6px 0 0;
    vertical-align: top;
  }

  .panorama-cell:nth-of-type(4n) {
    margin-right: 0;
  }

  .domain-fact {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-button {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
