.sd-surface[hidden], [data-map-layout][hidden] { display:none!important }
.sd-surface {max-width:1100px;margin:24px auto;color:#2c2c2a}
.sd-rail>header {border-bottom:1px solid #dcd8cc;margin:20px 0 14px}
.sd-rail h3 {margin:0;color:#1d7a92}.sd-rail p {font-size:14px;line-height:1.5}
.sd-cards {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:20px}
.sd-card {min-width:0;background:#fff;border:1px solid #dedbd2;border-top:5px solid var(--sd-hue);border-radius:12px;padding:16px;break-inside:avoid}
.sd-card h4 {font-size:20px;margin:0 0 8px}.sd-card>p {font-size:13px;line-height:1.5}
.sd-grid {position:relative;isolation:isolate;display:grid;grid-template-columns:var(--sd-outer) var(--sd-centre) var(--sd-outer);grid-template-rows:var(--sd-outer) var(--sd-centre) var(--sd-outer);aspect-ratio:1;box-sizing:border-box;border:1px solid #aaa;background:#fcfbf8;margin:8px 0}
.sd-cell {min-width:0;min-height:0;border:1px solid #ddd;display:flex;align-items:flex-start;justify-content:center;padding:3px 2px;box-sizing:border-box;outline-offset:-3px}
/* Very narrow cards use a readable full-name key. */
.sd-cell-number{font:600 12px/1.2 sans-serif;color:#565951;align-self:flex-start;margin-right:auto}
.sd-cell-key{list-style:none;padding:0;margin:14px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px}
.sd-key-item{display:flex;align-items:center;gap:6px;border:0;background:transparent;color:inherit;padding:5px 0;width:100%;text-align:left;cursor:help;font:inherit}
.sd-key-number{flex:0 0 20px;text-align:center;border:1px solid #cbc9c1;border-radius:4px;font:600 11px/18px sans-serif}
.sd-key-item--selected .sd-key-number{background:var(--sd-hue);border-color:var(--sd-hue)}
.sd-cell-label{font-size:13px;line-height:1.4;font-weight:600;white-space:nowrap;word-break:normal;overflow-wrap:normal}
.sd-key-item:focus-visible{outline:3px solid #1d7a92;outline-offset:2px}
.sd-cell--selected {background:color-mix(in srgb,var(--sd-hue) 22%,white);box-shadow:inset 0 0 0 2px var(--sd-hue)}
.sd-cell--other {border:2px dashed #34475f}
.sd-cell:focus-visible,.sd-dot:focus-visible {outline:3px solid #1d7a92}
.sd-tip{display:none}
.sd-tooltip{position:fixed;box-sizing:border-box;width:max-content;max-width:min(320px,calc(100vw - 24px));margin:0;padding:12px 14px;background:#252b30;color:white;border:0;border-radius:8px;box-shadow:0 4px 15px #0003;font:400 14px/1.5 sans-serif;text-align:left;z-index:2147483647;overflow:auto}
.sd-tooltip[hidden]{display:none}
.sd-dot {position:absolute;transform:translate(-50%,-50%);border:2px solid white;border-radius:50%;background:var(--sd-hue);box-shadow:0 1px 4px #0008;color:#17202a;width:25px;height:25px;padding:0;display:grid;place-items:center;font:700 11px sans-serif;z-index:4;cursor:help}
.sd-dot--other {background:#34475f;color:white;z-index:3}
.sd-dot--shared {width:42px;height:28px;grid-template-columns:1fr 1fr;overflow:hidden;background:transparent;font-size:10px}
.sd-shared-half{align-self:stretch;display:grid;place-items:center;width:100%;font:700 10px/1 sans-serif}
.sd-shared-half--a{background:var(--sd-hue);color:#17202a}
.sd-shared-half--b{background:#34475f;color:#fff}
.sd-connector {position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}
.sd-axis {text-align:center;font-size:10px!important;color:#68675e}.sd-horizontal {display:flex;justify-content:space-between;gap:18px;font-size:10px;color:#68675e}.sd-horizontal span {max-width:48%}.sd-horizontal span:last-child {text-align:right}
.sd-placement {margin:8px 0 0;font-size:12px!important}
.sd-reading,.sd-detail {max-width:760px;margin:24px auto;padding:22px;background:#faf8f3;border-radius:10px;font-size:15px;line-height:1.7}
.sd-reading h2 {margin-top:0}.sd-reading-source {display:block;font-size:11px;color:#666}.sd-reading blockquote {margin:16px 0;border-left:3px solid #1d7a92;padding-left:16px;font-style:italic}
.sd-ai-whisper{font:400 11px/1.3 sans-serif;color:#999;margin-left:6px;white-space:nowrap;vertical-align:middle}
.sd-ai-whisper[hidden]{display:none}
.sd-synthesis p{margin:0 0 14px}.sd-synthesis p:last-child{margin-bottom:0}
.sd-detail {border-left:4px solid var(--sd-hue);background:#fff}.sd-detail h3{margin-top:0}
.sd-detail--comparison{max-width:900px}
.sd-detail-people{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0}
.sd-person{border:1px solid #dedbd2;border-top:4px solid var(--sd-hue);border-radius:9px;padding:14px;background:#faf9f5}
.sd-person h4{margin:0 0 8px}.sd-person p{margin:7px 0}.sd-person-cell{font-size:18px;font-weight:700;color:#2c2c2a}
.sd-detail-people--shared{grid-template-columns:1fr}.sd-person--shared{text-align:center}
.sd-person-names{display:flex;justify-content:center;align-items:center;gap:12px;flex-wrap:wrap}
.sd-together{border-top:1px solid #dedbd2;margin-top:16px;padding-top:14px}.sd-together h4{margin:0 0 6px}.sd-together p{margin:0}
.sd-layout-switch {display:flex;gap:8px;margin:18px 0}.sd-layout-switch button {padding:8px 14px;border:1px solid #ddd;border-radius:8px;background:#eee;cursor:pointer}.sd-layout-switch button[aria-pressed=true] {background:#fff;border-color:#1d7a92;color:#1d7a92;font-weight:700}

@media(max-width:620px){.sd-cards{grid-template-columns:1fr}.sd-card{max-width:430px;width:100%;box-sizing:border-box;margin:auto}.sd-detail-people{grid-template-columns:1fr}}

.sd-interpretations h3{margin:0 0 12px}.sd-interpretation{margin:28px 0;padding-top:18px;border-top:1px solid #dedbd2}
.sd-summary-theme{margin:20px 0 0;padding-top:16px;border-top:1px solid #dedbd2}
.sd-summary-theme:first-child{margin-top:12px}.sd-summary-theme h3{font-size:17px;margin:0 0 6px}.sd-summary-theme p{margin:0}

.sd-card{container-type:inline-size}
.sd-cell{position:relative}
.sd-cell-number,.sd-cell-key{display:none}
.sd-grid-label{position:absolute;top:6px;left:5px;white-space:nowrap;word-break:normal;overflow-wrap:normal;font:600 13px/1.35 sans-serif;background:#fcfbf8ed;padding:1px 3px;border-radius:3px;z-index:1}
.sd-cell:nth-child(3n + 2) .sd-grid-label{left:50%;transform:translateX(-50%)}
.sd-cell:nth-child(3n) .sd-grid-label{left:auto;right:5px}
.sd-cell:nth-child(n + 4):nth-child(-n + 6) .sd-grid-label{top:-20px}
@container(max-width:279px){.sd-grid-label{display:none}.sd-cell-number{display:block}.sd-cell-key{display:grid;grid-template-columns:1fr}}

.sd-print-grid{display:none}

/* SVG preserves geometry in print engines without absolute grid-child support. */
@media print{
  .sd-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sd-card{container-type:normal;padding:10px}
  .sd-tip,.sd-tooltip{display:none!important}
  .sd-grid,.sd-cell-number,.sd-cell-key{display:none}
  .sd-print-grid{display:block;width:100%;height:auto;margin:8px 0}
  .sd-detail,.sd-interpretation{break-inside:avoid}
  .sd-rail + .sd-rail{break-before:page}
  .sd-rail>header,.sd-reading h2,.sd-reading h3{break-after:avoid}
}

/* Screen overview: three compact, corresponding columns when the report has
   room for intact 13px names. Keep print geometry and pagination independent. */
@media screen {
  .sd-grids {container:sd-overview / inline-size;max-width:966px;margin-inline:auto}
  .sd-cards {grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px;row-gap:0}
  .sd-card {padding:10px;margin-bottom:12px}
  .sd-card h4 {line-height:1.4}
  .sd-card>p:not([class]) {min-height:4.5em}
  .sd-card>p {margin:0 0 8px}
  .sd-card>.sd-axis {margin:0;align-self:end}
  .sd-card>.sd-placement {margin:8px 0 0}
  @container sd-overview (min-width:930px) {
    .sd-cards {grid-template-columns:repeat(3,minmax(0,1fr))}
  }
  @container sd-overview (max-width:615px) {
    .sd-cards {grid-template-columns:1fr;row-gap:12px}
    .sd-card {max-width:430px;width:100%;box-sizing:border-box;margin:0 auto}
    .sd-card>p:not([class]) {min-height:0}
  }
}

/* Give only the desktop overview extra room; retain the original 714px
   content measure for the rest of the individual report and its pair view. */
@media screen and (min-width:1004px) {
  .page:has(#preference-view-dimensions:not([hidden])) {max-width:1004px;padding-inline:16px}
  .page:has(#preference-view-dimensions:not([hidden]))>* {max-width:714px;margin-inline:auto}
  .page:has(#preference-view-dimensions:not([hidden]))>#preference-view-dimensions {max-width:none}
}

/* cultureMAP-aligned overview ------------------------------------------------
   The surrounding report keeps the sd-* hooks used by switching, narratives
   and accessibility. The visible chassis comes from dimension-chassis.css,
   shared with cultureMAP itself. */
.sd-grids.dm-cards {
  max-width: 1100px;
  margin: 0 auto 32px;
  container-type: normal;
}

.sd-card.dm-card {
  display: block;
  padding: 0;
  margin: 0;
  border: 1px solid #ece9df;
  border-top: 1px solid #ece9df;
  border-radius: 14px;
  container-type: normal;
  color: inherit;
  text-decoration: none;
}
.sd-card.dm-card:hover { border-color: #d9d6cb; }
.sd-card.dm-card:focus-visible { outline: 3px solid #1d7a92; outline-offset: 3px; }
.sd-card.dm-card[aria-current="location"] { border-color: var(--sd-hue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sd-hue) 28%, transparent); }

.sd-mini .cm-field-svg {
  width: 100%;
  height: auto;
  display: block;
  background: #fcfbf7;
  border: 1px solid #e6e2d6;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
}

.sd-field-svg .cm-grid-line { stroke: #e6e2d6; stroke-width: .4; }
.sd-field-svg .sd-cell { fill: transparent; stroke: none; cursor: help; }
.sd-field-svg .sd-cell:focus-visible { fill: rgba(41,182,214,.08); stroke: #1d7a92; stroke-width: 1; }

.sd-connector-line {
  stroke: #76746c;
  stroke-width: .7;
  stroke-dasharray: 1.4 1.8;
  pointer-events: none;
}

.sd-marker { cursor: help; outline: none; }
.sd-marker text {
  fill: #17202a;
  font: 700 4px/1 system-ui, sans-serif;
  pointer-events: none;
}
.sd-marker text.sd-marker__light { fill: #fff; }
.sd-marker:focus-visible circle { stroke: #1a1a1a; stroke-width: 1.2; }

.sd-and { color: #c9c6ba; }
.sd-tip { display: none; }

/* Expanded dimension pages --------------------------------------------------
   The top cards follow cultureMAP's native anchor behaviour. Each link lands
   on one complete map beside the existing, already-cached interpretation. */
[data-expanded-dimension] { scroll-margin-top: 28px; }
[data-expanded-dimension]:focus { outline: none; }
[data-expanded-dimension].sd-expanded-selected {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sd-hue) 22%, transparent);
}

.sd-expanded-map {
  max-width: 860px;
  margin: 18px auto 24px;
  display: grid;
  grid-template-columns: minmax(86px, 116px) minmax(0, 1fr) minmax(86px, 116px);
  grid-template-areas: ". top ." "left field right" ". bottom .";
  gap: 14px;
  align-items: center;
  justify-items: center;
}
.sd-expanded-field {
  grid-area: field;
  width: 100%;
  position: relative;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
}
.sd-expanded-field .cm-field-svg { border-radius: 10px; }
.sd-expanded-axis {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sd-expanded-axis--top { grid-area: top; text-align: center; }
.sd-expanded-axis--bottom { grid-area: bottom; text-align: center; }
.sd-expanded-axis--left { grid-area: left; flex-direction: column; text-align: right; justify-self: end; }
.sd-expanded-axis--right { grid-area: right; flex-direction: column; text-align: left; justify-self: start; }
.sd-expanded-region {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background: #fcfbf7;
  border: 1px solid #e6e2d6;
  border-radius: 5px;
  padding: 3px 7px;
  color: #1a1a1a;
  font-size: clamp(10px, 1.4vw, 14px);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}
.sd-expanded-region--l { transform: translate(3px, 3px); }
.sd-expanded-region--c { transform: translate(-50%, 3px); }
.sd-expanded-region--r { transform: translate(calc(-100% - 3px), 3px); }

/* cultureMAP tooltip appearance with the existing viewport-safe portal. */
.sd-tooltip {
  position: fixed;
  box-sizing: border-box;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  margin: 0;
  padding: 6px 9px;
  background: #1a1a1a;
  color: #fff;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  font: 500 12px/1.35 system-ui, sans-serif;
  text-align: left;
  z-index: 2147483647;
  overflow: auto;
}
.sd-tooltip__main { display: block; }
.sd-tooltip__desc { display: block; margin-top: 2px; font-weight: 400; color: #cfccc4; }

@media screen and (min-width: 1132px) {
  .page:has(#preference-view-dimensions:not([hidden])) { max-width: 1132px; }
}

@media (max-width: 820px) {
  .sd-grids.dm-cards { max-width: 430px; }
  .sd-card.dm-card { width: 100%; max-width: 430px; margin: 0 auto; }
  .sd-expanded-map {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "top top" "field field" "bottom bottom" "left right";
  }
  .sd-expanded-axis--left { justify-self: start; align-items: flex-start; text-align: left; }
  .sd-expanded-axis--right { justify-self: end; align-items: flex-end; text-align: right; }
}

@media print {
  .sd-grids.dm-cards { display: grid; margin-bottom: 20px; }
  .sd-card.dm-card { padding: 0; }
  .sd-card.dm-card[aria-current="location"],
  [data-expanded-dimension].sd-expanded-selected { box-shadow: none; }
  .sd-expanded-map { max-width: 520px; margin: 12px auto 18px; gap: 10px; }
  [data-expanded-dimension] { break-inside: avoid; }
}
