/* CodBio Hub 2.0 — Privacy & Governance route */

.workspace-privacy-v2 {
    --gov-accent: #aa96ff;
    --gov-accent-soft: rgba(170, 150, 255, .14);
    --gov-cyan: #72c8ff;
    --gov-amber: #e4a46c;
    --gov-line: #2d3742;
    --gov-panel: #0d1217;
    --gov-panel-2: #111820;
    background: #090d11;
}

.workspace-privacy-v2 .ws-governance-content {
    background:
        radial-gradient(circle at 8% 0%, rgba(170,150,255,.055), transparent 28%),
        linear-gradient(180deg, #0a0f13, #090d11);
}

.ws-governance-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr);
    gap: clamp(40px, 7vw, 104px);
    align-items: end;
    padding: 48px clamp(36px, 5vw, 74px) 44px;
    border-bottom: 1px solid var(--ws-line);
    background:
        linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px),
        radial-gradient(circle at 12% 6%, rgba(170,150,255,.075), transparent 32%);
    background-size: 28px 28px, 28px 28px, auto;
}

.ws-governance-path,
.ws-governance-kicker,
.ws-governance-tools label,
.ws-governance-toc > div > p {
    margin: 0;
    font: 700 9px/1.3 var(--ws-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.ws-governance-path {
    color: #60707a;
}

.ws-governance-kicker {
    margin-top: 10px;
    color: var(--gov-accent);
}

.ws-governance-hero h1 {
    max-width: 11ch;
    margin: 15px 0 0;
    color: #edf2ef;
    font-size: clamp(46px, 5.4vw, 78px);
    font-weight: 650;
    line-height: .93;
    letter-spacing: -.055em;
}

.ws-governance-hero h1 em {
    color: var(--gov-amber);
    font-style: normal;
    font-weight: 450;
}

.ws-governance-lede {
    max-width: 780px;
    margin: 22px 0 0;
    color: #9eaab2;
    font-size: 14px;
    line-height: 1.72;
}

.ws-governance-meta {
    margin: 0;
    border-top: 1px solid #3b4651;
}

.ws-governance-meta div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding: 9px 0;
    border-bottom: 1px solid #29333d;
    font: 9px var(--ws-mono);
}

.ws-governance-meta dt {
    color: #6e7a84;
}

.ws-governance-meta dd {
    margin: 0;
    color: #c8cfcc;
    text-align: right;
}

.ws-governance-meta dd.is-ok {
    color: var(--ws-mint);
}

.ws-governance-tools {
    display: grid;
    grid-template-columns: minmax(320px, 1.45fr) minmax(180px, .72fr) minmax(180px, .72fr);
    gap: 14px 16px;
    padding: 18px clamp(36px, 5vw, 74px) 20px;
    border-bottom: 1px solid var(--ws-line);
    background:
        linear-gradient(180deg, rgba(170,150,255,.025), transparent),
        #0c1116;
}

.ws-governance-tools label {
    display: block;
    margin-bottom: 7px;
    color: #73808a;
}

.ws-governance-input-shell {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid #34414c;
    border-radius: 6px;
    background: #0a0f13;
}

.ws-governance-input-shell > span {
    color: var(--gov-accent);
    font: 13px var(--ws-mono);
}

.ws-governance-input-shell input,
.ws-governance-tools select {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    border: 1px solid #34414c;
    border-radius: 6px;
    background: #0a0f13;
    color: #dce3df;
    outline: none;
    font: 11px var(--ws-mono);
}

.ws-governance-input-shell input {
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
}

.ws-governance-tools select {
    padding: 0 10px;
    color-scheme: dark;
}

.ws-governance-input-shell:focus-within,
.ws-governance-tools select:focus-visible {
    border-color: rgba(170,150,255,.8);
    box-shadow: 0 0 0 2px rgba(170,150,255,.07);
}

.ws-governance-input-shell input::placeholder {
    color: #55636e;
}

.ws-governance-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.ws-governance-actions button,
.policy-pagination button,
.policy-section-actions button,
.policy-section-actions a {
    min-height: 32px;
    padding: 7px 10px;
    border: 1px solid #34414c;
    border-radius: 5px;
    background: #10171d;
    color: #aab4ba;
    cursor: pointer;
    font: 9px var(--ws-mono);
    text-decoration: none;
}

.ws-governance-actions button:hover,
.ws-governance-actions button:focus-visible,
.policy-pagination button:hover:not(:disabled),
.policy-pagination button:focus-visible:not(:disabled),
.policy-section-actions button:hover,
.policy-section-actions button:focus-visible,
.policy-section-actions a:hover,
.policy-section-actions a:focus-visible {
    border-color: #5b5877;
    background: #171725;
    color: #ece9ff;
    outline: none;
}

.ws-governance-tools > [data-policy-status] {
    grid-column: 1 / -1;
    min-height: 1.1em;
    margin: 0;
    color: #697680;
    font: 9px var(--ws-mono);
}

.ws-governance-workspace {
    width: min(1320px, calc(100% - 70px));
    height: calc(100vh - 246px);
    min-height: 580px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(220px, 270px) minmax(0, 900px);
    justify-content: center;
    gap: clamp(28px, 5vw, 72px);
    padding: 26px 0 0;
    overflow: hidden;
}

.ws-governance-toc {
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.ws-governance-toc > div {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ws-governance-toc > div > p {
    margin-bottom: 12px;
    color: var(--gov-accent);
}

.ws-governance-toc nav {
    display: grid;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

.ws-governance-toc a {
    padding: 7px 9px;
    border-left: 1px solid #26313a;
    color: #77848e;
    font: 9px/1.45 var(--ws-mono);
    transition:
        border-color .15s ease,
        background-color .15s ease,
        color .15s ease;
}

.ws-governance-toc a:hover,
.ws-governance-toc a:focus-visible {
    border-left-color: var(--gov-accent);
    background: rgba(170,150,255,.045);
    color: #e6e1ff;
    outline: none;
}

.ws-governance-toc a.is-active {
    border-left-color: var(--gov-cyan);
    background:
        linear-gradient(90deg, rgba(114,200,255,.07), transparent 80%);
    color: #e8f4fb;
    font-weight: 700;
}

.ws-governance-stream {
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    padding: 0 16px 72px 0;
}

.ws-governance-document {
    min-width: 0;
}

.policy-loading,
.policy-error {
    padding: 26px;
    border: 1px solid #34414b;
    border-radius: 7px;
    background: #0f151b;
    color: #89969e;
    text-align: center;
    font: 10px var(--ws-mono);
}

.policy-section {
    margin-bottom: 10px;
    border: 1px solid #303b46;
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(170,150,255,.018), transparent 28%),
        #0f151a;
    overflow: hidden;
    scroll-margin-top: 12px;
    box-shadow: none;
}

.policy-section[hidden] {
    display: none;
}

.policy-section[open] {
    border-color: #4d4c67;
    box-shadow:
        inset 2px 0 0 rgba(170,150,255,.72),
        0 12px 30px rgba(0,0,0,.12);
}

.policy-section:focus {
    outline: 2px solid rgba(170,150,255,.3);
    outline-offset: 2px;
}

.policy-section summary {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 15px;
    cursor: pointer;
    list-style: none;
}

.policy-section summary::-webkit-details-marker {
    display: none;
}

.policy-section summary > span:first-child {
    color: var(--gov-accent);
    font: 700 8px var(--ws-mono);
    letter-spacing: .08em;
}

.policy-section summary > span[role="heading"] {
    color: #dbe2de;
    font-size: 13px;
    font-weight: 650;
}

.policy-section summary > b {
    color: #6f7b85;
    font: 16px var(--ws-mono);
    transition: transform .18s ease, color .18s ease;
}

.policy-section[open] summary > b {
    transform: rotate(45deg);
    color: var(--gov-accent);
}

.policy-section-body {
    padding: 6px 22px 24px 48px;
    border-top: 1px solid #26313a;
    color: #99a5ad;
}

.policy-section-body > dl {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 24px;
    padding: 12px 0;
    border-bottom: 1px solid #26313a;
}

.policy-section-body > dl div {
    min-width: 90px;
    padding: 0 12px;
    border-left: 1px solid #2a3540;
}

.policy-section-body > dl div:first-child {
    padding-left: 0;
    border-left: 0;
}

.policy-section-body dt {
    color: #66737d;
    font: 700 7px var(--ws-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.policy-section-body dd {
    margin: 4px 0 0;
    color: #c5ceca;
    font: 9px var(--ws-mono);
}

.policy-section-body h3,
.policy-section-body h4 {
    margin: 26px 0 0;
    color: #e7ece9;
    line-height: 1.2;
}

.policy-section-body h3 {
    font-size: 21px;
}

.policy-section-body h4 {
    font-size: 15px;
}

.policy-section-body p,
.policy-section-body li {
    max-width: 760px;
    color: #9aa6ad;
    font-size: 13px;
    line-height: 1.72;
}

.policy-section-body p {
    margin: 12px 0 0;
}

.policy-section-body ul {
    padding-left: 20px;
}

.policy-section-body a {
    color: var(--gov-cyan);
    text-decoration: underline;
    text-decoration-color: rgba(114,200,255,.3);
    text-underline-offset: 3px;
}

.policy-section-body a:hover,
.policy-section-body a:focus-visible {
    color: #dceffc;
    text-decoration-color: currentColor;
    outline: none;
}

.policy-search-hit {
    padding: .05em .18em;
    border-radius: 3px;
    background: rgba(228,164,108,.18);
    color: #ffe2c7;
    font-weight: 700;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.policy-section-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 22px;
    padding-top: 13px;
    border-top: 1px solid #26313a;
}

.policy-section-actions nav {
    display: flex;
    gap: 7px;
}

.policy-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin: 18px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid #26313a;
    color: #7d8992;
    font: 9px var(--ws-mono);
}

.policy-pagination[hidden] {
    display: none;
}

.policy-pagination button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* Hover/focus-only themed scrollbars */
.ws-governance-stream,
.ws-governance-toc nav {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.ws-governance-stream:hover,
.ws-governance-stream:focus-within,
.ws-governance-toc nav:hover,
.ws-governance-toc nav:focus-within {
    scrollbar-color: rgba(170,150,255,.44) transparent;
}

.ws-governance-stream::-webkit-scrollbar,
.ws-governance-toc nav::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.ws-governance-stream::-webkit-scrollbar-track,
.ws-governance-toc nav::-webkit-scrollbar-track {
    background: transparent;
}

.ws-governance-stream::-webkit-scrollbar-thumb,
.ws-governance-toc nav::-webkit-scrollbar-thumb {
    min-height: 34px;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}

.ws-governance-stream:hover::-webkit-scrollbar-thumb,
.ws-governance-stream:focus-within::-webkit-scrollbar-thumb,
.ws-governance-toc nav:hover::-webkit-scrollbar-thumb,
.ws-governance-toc nav:focus-within::-webkit-scrollbar-thumb {
    background: rgba(170,150,255,.38);
    box-shadow:
        inset 0 0 0 1px rgba(224,216,255,.08),
        0 0 8px rgba(170,150,255,.08);
}

.ws-governance-stream::-webkit-scrollbar-thumb:hover,
.ws-governance-toc nav::-webkit-scrollbar-thumb:hover {
    background: rgba(170,150,255,.6);
}

.ws-governance-stream::-webkit-scrollbar-corner,
.ws-governance-toc nav::-webkit-scrollbar-corner {
    background: transparent;
}

@media (max-width: 980px) {
    .ws-governance-hero,
    .ws-governance-tools {
        grid-template-columns: 1fr;
    }

    .ws-governance-actions,
    .ws-governance-tools > [data-policy-status] {
        grid-column: auto;
    }

    .ws-governance-workspace {
        width: min(820px, calc(100% - 44px));
        height: auto;
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 26px;
        padding-bottom: 56px;
        overflow: visible;
    }

    .ws-governance-toc,
    .ws-governance-stream {
        height: auto;
        overflow: visible;
    }

    .ws-governance-toc > div {
        height: auto;
        display: block;
    }

    .ws-governance-toc nav {
        grid-template-columns: repeat(2, minmax(0,1fr));
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .ws-governance-stream {
        padding-right: 0;
        scroll-behavior: auto;
    }
}

@media (max-width: 650px) {
    .ws-governance-hero,
    .ws-governance-tools {
        padding-left: 22px;
        padding-right: 22px;
    }

    .ws-governance-hero h1 {
        font-size: 42px;
    }

    .ws-governance-workspace {
        width: calc(100% - 44px);
    }

    .ws-governance-toc nav {
        grid-template-columns: 1fr;
    }

    .policy-section-body {
        padding: 4px 16px 22px 38px;
    }

    .policy-section-body > dl {
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .policy-section-body > dl div,
    .policy-section-body > dl div:first-child {
        padding: 7px 8px;
        border-left: 0;
        border-bottom: 1px solid #26313a;
    }

    .policy-section-actions,
    .policy-section-actions nav {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ws-governance-stream {
        scroll-behavior: auto;
    }
}

@media print {
    .workspace-privacy-v2 .ws-topbar,
    .workspace-privacy-v2 .ws-rail,
    .workspace-privacy-v2 .ws-rail-menu,
    .workspace-privacy-v2 .ws-explorer,
    .workspace-privacy-v2 .ws-inspector,
    .workspace-privacy-v2 .ws-tabs,
    .workspace-privacy-v2 .ws-governance-tools,
    .workspace-privacy-v2 .ws-governance-toc,
    .workspace-privacy-v2 .workspace-footer {
        display: none !important;
    }

    .workspace-privacy-v2 .ws-main,
    .workspace-privacy-v2 .ws-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .workspace-privacy-v2 .ws-governance-workspace,
    .workspace-privacy-v2 .ws-governance-stream {
        width: auto;
        height: auto;
        display: block;
        overflow: visible;
    }

    .workspace-privacy-v2 .policy-section,
    .workspace-privacy-v2 .policy-section-body {
        break-inside: avoid;
        background: #fff;
        color: #111;
    }
}
