/* OSPRE CASTLE KEEP DevSecOps integration mockup - concept prototype.
   Palette per templates/submission/STYLE-GUIDE.md plus sky tones. Gold is never text on white. */
:root {
  --navy: #0f2742; --navy-2: #173a5e; --gold: #b8932f; --gold-2: #d9a92e; --gold-tint: #f6efdc;
  --ink: #1a1a1a; --slate: #4a5568; --rule: #c5ccd6; --tint: #e9eef5; --band: #f5f7fa;
  --sky: #5fa8d3; --sky-2: #a9d4ec; --sky-dark: #1d5f86; --sky-tint: #e3f1f9;
  --pass: #2e7d4f; --fail: #b3261e; --hold: #6b520d;
  --font: Arial, "Liberation Sans", Helvetica, sans-serif;
  --radius: 8px; --shadow: 0 1px 2px rgba(15,39,66,.08), 0 2px 8px rgba(15,39,66,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 48px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--band); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { color: var(--navy); margin: 0; }
button, input, select { font: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; color: var(--navy); padding: 8px 12px; z-index: 100; border: 2px solid var(--navy); border-radius: 4px; font-weight: 700; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--sky-dark); outline-offset: 2px; }
.top :focus-visible { outline-color: var(--gold-2); }

.banner { position: sticky; top: 0; z-index: 50; background: var(--gold-2); color: var(--navy); font-weight: 700; text-align: center; padding: 6px 12px; font-size: 14px; border-bottom: 1px solid var(--gold); }
.top { background: var(--navy); color: #fff; padding: 16px 24px 14px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--gold); }
.brand { display: flex; gap: 20px; align-items: center; min-width: 0; flex: 1 1 620px; }
.brand img { flex: none; width: 190px; height: auto; }
.titles { border-left: 1px solid rgba(255,255,255,.25); padding-left: 20px; min-width: 0; }
.top h1 { color: #fff; font-size: 22px; line-height: 1.2; }
.h1-sub { color: var(--gold-2); }
.lede { margin: 4px 0 0; color: #dfe7f1; font-size: 13.5px; max-width: 80ch; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 6px; padding: 7px 12px; cursor: pointer; min-height: 36px; }
.btn:hover { background: rgba(255,255,255,.1); }
.btn-primary { background: var(--gold-2); color: var(--navy); border-color: var(--gold-2); font-weight: 700; min-width: 96px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.btn-primary:hover { background: #e6b94a; }
.btn-ico { width: 12px; height: 12px; display: inline-block; background: var(--navy); clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); }
.paused .btn-ico { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.speed { display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 6px; overflow: hidden; }
.ctl-label { padding: 0 8px; font-size: 13px; color: #dfe7f1; }
.speed label { position: relative; cursor: pointer; }
.speed input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.speed span { display: block; padding: 8px 10px; border-left: 1px solid rgba(255,255,255,.3); font-size: 13px; min-width: 40px; text-align: center; }
.speed input:checked + span { background: #fff; color: var(--navy); font-weight: 700; }
.speed input:focus-visible + span { outline: 3px solid var(--gold-2); outline-offset: -3px; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: #dfe7f1; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--gold-2); }

main { max-width: 1680px; margin: 0 auto; padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 370px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.panel h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-head { margin-bottom: 10px; }
.panel-note { margin: 3px 0 0; color: var(--slate); font-size: 13px; }
.pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--tint); color: var(--navy); border-radius: 999px; padding: 2px 8px; }

/* Scene */
.scene-panel { padding: 12px; }
.scene-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
.views { display: flex; flex-wrap: wrap; gap: 6px; }
.vbtn { border: 1px solid var(--rule); background: #fff; color: var(--navy); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; min-height: 32px; }
.vbtn[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.viewer-wrap { position: relative; height: clamp(460px, 64vh, 700px); border-radius: 6px; overflow: hidden; background: #eef3f8; border: 1px solid var(--rule); }
.viewer { position: absolute; inset: 0; touch-action: none; }
.viewer:focus-visible { outline: 3px solid var(--sky-dark); outline-offset: -3px; }
#scene-canvas { width: 100%; height: 100%; display: block; }
.marker-layer { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 5px; background: #fff; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 999px; padding: 3px 9px 3px 5px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 26px; box-shadow: 0 1px 4px rgba(15,39,66,.25); }
.marker .m-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tint); border: 2px solid var(--slate); flex: none; }
.marker[hidden] { display: none; }
.marker.compact { padding: 3px; }
.marker.compact .m-label { display: none; }
.marker.compact:hover .m-label, .marker.compact:focus-visible .m-label { display: inline; }
.marker.compact:hover, .marker.compact:focus-visible { padding: 3px 9px 3px 5px; z-index: 3; }
.marker.is-active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,169,46,.55); z-index: 2; }
.marker:focus-visible { outline: 3px solid var(--sky-dark); outline-offset: 2px; z-index: 4; }
.marker[aria-expanded="true"] { background: var(--navy); color: #fff; }
[data-status="pass"] .m-dot, [data-status="done"] .m-dot, .kd-pass { background: var(--pass); border-color: var(--pass); }
[data-status="fail"] .m-dot, [data-status="alert"] .m-dot, .kd-fail { background: var(--fail); border-color: var(--fail); }
[data-status="hold"] .m-dot, [data-status="scan"] .m-dot, .kd-hold { background: var(--gold-2); border-color: var(--hold); }
[data-status="active"] .m-dot, [data-status="next"] .m-dot, .kd-active { background: var(--sky); border-color: var(--sky-dark); }
.now-chip { position: absolute; left: 10px; right: 10px; top: 10px; margin: 0; pointer-events: none; background: rgba(15,39,66,.9); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 6px; border-left: 4px solid var(--gold-2); width: fit-content; max-width: calc(100% - 20px); }
.now-chip:empty { display: none; }
.key { position: absolute; left: 10px; bottom: 10px; margin: 0; padding: 5px 8px; list-style: none; display: flex; gap: 10px; background: rgba(255,255,255,.92); border-radius: 6px; font-size: 12px; color: var(--navy); pointer-events: none; }
.key li { display: inline-flex; align-items: center; gap: 4px; }
.kd { width: 11px; height: 11px; border-radius: 50%; border: 2px solid; display: inline-block; }
.loading { position: absolute; inset: 0; display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--navy); font-weight: 700; background: rgba(238,243,248,.8); }
.loading[hidden] { display: none; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--sky-2); border-top-color: var(--navy); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-status { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: #fff; color: var(--ink); }
.viewer-status[hidden] { display: none; }
.viewer-status h3 { margin-bottom: 6px; }
.viewer-help { margin: 10px 4px 2px; font-size: 13px; color: var(--slate); }
a { color: var(--sky-dark); }

/* Side column */
.side { display: flex; flex-direction: column; gap: 12px; }
.rel-id { margin: 8px 0 0; font-size: 20px; font-weight: 700; color: var(--navy); }
.rel-title { font-size: 15px; font-weight: 400; color: var(--ink); }
.rel-meta { margin: 2px 0 6px; font-size: 13px; color: var(--slate); }
.rel-stage { margin: 0 0 8px; font-size: 13.5px; background: var(--band); border-left: 3px solid var(--sky); padding: 6px 8px; min-height: 3.2em; }
.gate-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 13px; }
.gate-list li { display: flex; align-items: center; gap: 6px; }
.g-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--slate); background: var(--tint); flex: none; }
.g-st { color: var(--slate); margin-left: auto; font-size: 12px; }
.gate-list [data-status="pass"] .g-dot { background: var(--pass); border-color: var(--pass); }
.gate-list [data-status="fail"] .g-dot { background: var(--fail); border-color: var(--fail); }
.gate-list [data-status="fail"] .g-st { color: var(--fail); font-weight: 700; }
.gate-list [data-status="scan"] .g-dot, .gate-list [data-status="hold"] .g-dot { background: var(--gold-2); border-color: var(--hold); }
.gate-list [data-status="hold"] .g-st { color: var(--hold); font-weight: 700; }
.rel-finding { margin: 8px 0 0; font-size: 13px; color: var(--fail); background: #fbeceb; border-radius: 4px; padding: 6px 8px; }
.approval[data-state="hold"] { background: var(--gold-tint); box-shadow: inset 4px 0 0 var(--gold), var(--shadow); }
.appr-status { margin: 6px 0; font-size: 13.5px; }
.approval[data-state="hold"] .appr-status { font-weight: 700; color: var(--navy); }
.appr-track { height: 8px; background: var(--tint); border-radius: 4px; overflow: hidden; }
.appr-bar { height: 100%; width: 0; background: var(--gold); }
.appr-actions { margin: 8px 0 4px; }
.btn-approve { background: var(--navy); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 700; cursor: pointer; min-height: 36px; }
.btn-approve:disabled { background: var(--tint); color: var(--slate); cursor: not-allowed; }
.appr-note { margin: 4px 0 0; font-size: 12px; color: var(--slate); }
.meter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 0; }
.meter-grid div { background: var(--band); border-radius: 6px; padding: 8px 10px; }
.meter-grid dt { font-size: 12px; color: var(--slate); font-weight: 700; }
.meter-grid dd { margin: 2px 0 0; font-size: 24px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.docs-q { margin: 6px 0; font-size: 13px; color: var(--slate); }
.docs-list { margin: 0; padding: 0 0 0 18px; font-size: 13px; }
.docs-list li { margin: 2px 0; }
.docs-list li.pkg { font-weight: 700; color: var(--navy); }
.docs-list .q { font-size: 11px; background: var(--gold-tint); border: 1px solid var(--gold); border-radius: 999px; padding: 0 6px; color: var(--navy); }
.docs-empty { color: var(--slate); list-style: none; margin-left: -18px; }

/* Info buttons + tooltip */
.info { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--sky-dark); background: #fff; color: var(--sky-dark); font: italic 700 12px/1 Georgia, "Times New Roman", serif; cursor: help; padding: 0; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.info::after { content: ""; position: absolute; inset: -6px; }
.info:hover, .info[aria-expanded="true"] { background: var(--sky-dark); color: #fff; }
.tip { position: absolute; z-index: 80; background: var(--navy); color: #fff; border-radius: 8px; padding: 12px 14px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 8px 24px rgba(15,39,66,.3); border-top: 3px solid var(--gold-2); max-height: min(72vh, 560px); overflow: auto; }
.tip p { margin: 0 0 6px; }
.tip .tip-title { font-weight: 700; font-size: 14.5px; padding-right: 22px; }
.tip .tip-status { color: var(--sky-2); font-size: 12.5px; }
.tip .tip-h { margin-top: 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--gold-2); font-weight: 700; }
.tip .tip-ref { margin: 6px 0 2px; font-weight: 700; font-size: 12.5px; color: var(--sky-2); }
.tip blockquote { margin: 0 0 6px; padding-left: 10px; border-left: 3px solid var(--gold-2); color: #eef3f8; font-style: italic; }
.tip .tip-x { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; padding: 2px 8px; line-height: 1; }
.tip .tip-x:focus-visible { outline-color: var(--gold-2); }

/* 2D strip */
.strip-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.strip-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: 6px; padding: 7px 8px; background: #fff; font-size: 13px; }
.strip-item .s-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); color: var(--navy); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.strip-item .s-t { flex: 1; font-weight: 700; color: var(--navy); }
.strip-item .s-st { font-size: 11.5px; color: var(--slate); }
.strip-item.current { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-2); background: var(--gold-tint); }
.strip-item[data-status="pass"] .s-n, .strip-item[data-status="done"] .s-n { background: var(--pass); color: #fff; }
.strip-item[data-status="fail"] .s-n, .strip-item[data-status="alert"] .s-n { background: var(--fail); color: #fff; }
.strip-item[data-status="fail"] .s-st, .strip-item[data-status="alert"] .s-st { color: var(--fail); font-weight: 700; }
.strip-item[data-status="hold"] .s-st { color: var(--hold); font-weight: 700; }
.strip-sub { font-size: 14px; margin: 14px 0 8px; }

/* Log */
.log-scroll { max-height: 260px; overflow: auto; border: 1px solid var(--rule); border-radius: 6px; }
.log-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log-list li { padding: 6px 10px; border-bottom: 1px solid var(--tint); border-left: 4px solid var(--rule); }
.lg-tag { font-size: 11.5px; color: var(--slate); font-weight: 700; margin-right: 4px; }
.lg-pass, .lg-done { border-left-color: var(--pass) !important; }
.lg-fail { border-left-color: var(--fail) !important; background: #fdf3f2; }
.lg-hold { border-left-color: var(--gold) !important; background: var(--gold-tint); }
.lg-blue { border-left-color: var(--sky) !important; }
.lg-red { border-left-color: #9e3a33 !important; }
.lg-doc { border-left-color: var(--gold-2) !important; }

/* Text view */
.text-view h2 { font-size: 19px; }
.text-view > p { max-width: 90ch; }
#text-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.tv-item { border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; }
.tv-item h3 { font-size: 16px; margin-bottom: 4px; }
.tv-item p { margin: 6px 0; font-size: 14px; }
.tv-status { font-size: 13px !important; color: var(--slate); }
.tv-status [data-status="fail"], .tv-status [data-status="alert"] { color: var(--fail); font-weight: 700; }
.tv-quotes { margin: 0; padding-left: 18px; font-size: 14px; }
.tv-ref { font-weight: 700; margin: 6px 0 2px !important; color: var(--navy); }
.tv-quotes blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--gold); font-style: italic; }
.btn-link { background: none; border: 1px solid var(--sky-dark); color: var(--sky-dark); border-radius: 6px; padding: 5px 10px; cursor: pointer; margin-top: 4px; min-height: 32px; }
.text-view h3 { margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
caption { text-align: left; font-weight: 700; color: var(--navy); padding: 4px 0; }
th, td { border: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
thead th { background: var(--tint); color: var(--navy); }

.foot { max-width: 1680px; margin: 0 auto; padding: 0 24px 28px; font-size: 13px; color: var(--slate); }
.noscript { padding: 16px 24px; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .top { padding: 12px 14px; }
  .brand { flex-direction: column; align-items: flex-start; gap: 10px; flex-basis: 100%; }
  .brand img { width: 150px; }
  .titles { border-left: 0; padding-left: 0; }
  .top h1 { font-size: 19px; }
  main { padding: 12px 10px 20px; }
  .side { display: flex; }
  .viewer-wrap { height: 440px; }
  .key { flex-wrap: wrap; right: 10px; gap: 4px 10px; }
  #text-body { grid-template-columns: 1fr; }
  .toggle { flex-basis: 100%; }
  .banner { font-size: 12.5px; padding: 5px 8px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (max-width: 700px) { .now-chip { top: auto; bottom: 8px; font-size: 12px; } .key { display: none; } }
