/* security.html page styles. Owner: PAYROLL agent. Scoped under .pg-security.
   Authored state = finished and readable. `.is-staged` (desktop + motion) is added by security.js. */

.pg-security .sv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; color: var(--fg-2); font-size: var(--fs-sm); }
.pg-security .sv-list > li { position: relative; padding-left: 1.3rem; }
.pg-security .sv-list > li::before { content: ""; position: absolute; left: 0; top: .72em; width: .65rem; height: 1px; background: var(--accent); }
.pg-security .sv-list--dark { font-size: var(--fs-base); }

/* 1 · Hero ------------------------------------------------------------ */
.sv-hero__grid { display: grid; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: end; }
@media (min-width: 1000px) { .sv-hero__grid { grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); } }
.sv-field { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 1.1rem 1.25rem 1rem; display: grid; gap: .8rem; }
.sv-field__cap { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.sv-field__rows { margin: 0; display: grid; }
.sv-field__rows > div { display: grid; grid-template-columns: 6.5rem 1fr; grid-template-rows: auto auto; column-gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.sv-field__rows dt { grid-row: span 2; font-size: var(--fs-sm); font-weight: 600; color: var(--fg); padding-top: .1rem; }
.sv-field__plain { font-size: var(--fs-sm); color: var(--fg); letter-spacing: .04em; }
.sv-field__cipher { font-size: var(--fs-2xs); color: var(--green); letter-spacing: .02em; }
.sv-field__foot { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-xs); color: var(--fg-2); }
.sv-field__foot .icon { color: var(--green); }

/* 2 · Vault ------------------------------------------------------------ */
.sv-vault { overflow: clip; }
.sv-vault__head { max-width: 820px; }
.sv-vault__art { width: 180px; aspect-ratio: 1; position: relative; margin: 0 0 2.5rem; }
.sv-frame, .sv-door, .sv-door svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sv-frame__ring { fill: #081C15; stroke: rgba(111,209,165,.35); stroke-width: 1.5; }
.sv-frame__seat { fill: #04100C; stroke: rgba(111,209,165,.25); stroke-width: 1; }
.sv-frame__ticks line { stroke: rgba(111,209,165,.45); stroke-width: 1.2; }
.sv-bolt { fill: #1E6A52; stroke: rgba(111,209,165,.6); stroke-width: 1; }
.sv-door__face { stroke: rgba(111,209,165,.5); stroke-width: 1.5; }
.sv-door__rim { fill: none; stroke: rgba(111,209,165,.28); stroke-width: 1; }
.sv-door__dash { fill: none; stroke: rgba(111,209,165,.3); stroke-width: 1; stroke-dasharray: 2 6; }
.sv-door__text { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 3px; fill: rgba(206,236,222,.62); }
.sv-handle line { stroke: #9FDDBF; stroke-width: 7; stroke-linecap: round; }
.sv-handle circle { fill: #0B2A21; stroke: #9FDDBF; stroke-width: 3; }
.sv-handle .sv-handle__hub { fill: #0E3A2D; stroke: var(--mint); stroke-width: 3; }
.sv-handle__mark { font-family: var(--font-display); font-weight: 700; font-size: 26px; fill: var(--mint); text-anchor: middle; }
.sv-door { transform-origin: 0% 50%; }

.sv-layers { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1rem, .6rem + 1vw, 1.5rem); }
@media (min-width: 900px) {
  .sv-layers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sv-layer--core { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: clamp(2rem, 1rem + 3vw, 4rem); align-items: start; }
  .sv-layer--core > :not(.sv-list) { grid-column: 1; }
  .sv-layer--core > .sv-list { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}
.sv-layer { position: relative; background: var(--ink-2); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: clamp(1.1rem, .8rem + 1vw, 1.6rem); display: grid; gap: .55rem; align-content: start; overflow: hidden; }
.sv-layer::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(500px 200px at 100% 0%, rgba(111,209,165,.07), transparent 70%); }
.sv-layer--core { background: linear-gradient(160deg, #0E3A2D 0%, #0B1F18 70%); border-color: rgba(111,209,165,.3); }
.sv-layer__n { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); }
.sv-layer__title { font-size: var(--fs-h5); font-family: var(--font-body); font-weight: 600; color: var(--fg); }
.sv-layer__tag { font-size: clamp(1.3rem, 1rem + 1.1vw, 1.9rem); color: var(--mint); letter-spacing: -.005em; line-height: 1.1; margin-bottom: .35rem; white-space: nowrap; }
.sv-layer--core .sv-layer__tag { font-size: clamp(2rem, 1.2rem + 3vw, 3.9rem); margin: .2rem 0 0; }
.sv-layer--core .sv-list { font-size: var(--fs-sm); gap: .55rem; }
.sv-hash { font-size: var(--fs-2xs); color: var(--fg-3); background: rgba(0,0,0,.25); border: 1px solid var(--rule); border-radius: var(--r-xs); padding: .45rem .6rem; overflow-wrap: anywhere; }
.sv-hash span { color: var(--mint); }

/* Staged vault (desktop + motion) */
.sv-vault.is-staged .sv-vault__pin { height: 100svh; display: flex; align-items: center; }
.sv-vault.is-staged .sv-vault__stage { position: relative; width: 100%; perspective: 1600px; }
.sv-vault.is-staged .sv-vault__art { position: absolute; z-index: 3; left: 50%; top: 50%; width: min(560px, 70svh); margin: 0; translate: -50% -50%; }
.sv-vault.is-staged .sv-layers { position: relative; z-index: 1; }

/* 3 · Access matrix ------------------------------------------------------ */
.sv-roles { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.sv-roles__label { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); margin-right: .4rem; }
.sv-roles__btn { min-height: 40px; padding: .45rem .95rem; border-radius: var(--r-pill); border: 1px solid var(--rule-strong); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; color: var(--fg-2); transition: background var(--dur-2), color var(--dur-2), border-color var(--dur-2); }
.sv-roles__btn:hover { border-color: var(--fg); color: var(--fg); }
.sv-roles__btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sv-matrix-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.sv-matrix { width: 100%; min-width: 760px; font-size: var(--fs-sm); }
.sv-matrix th, .sv-matrix td { padding: .95rem 1rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: middle; transition: background var(--dur-3); }
.sv-matrix thead th { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-base); color: var(--fg); background: var(--surface-2); vertical-align: bottom; }
.sv-matrix thead th small { display: block; font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .06em; color: var(--fg-2); font-weight: 400; margin-top: .15rem; }
.sv-matrix tbody th { font-weight: 500; color: var(--fg); width: 32%; }
.sv-matrix tbody tr:last-child > * { border-bottom: 0; }
.sv-matrix td { color: var(--fg-2); }
.sv-matrix td::before { content: ""; display: inline-block; vertical-align: -.25em; width: 1.2em; height: 1.2em; margin-right: .5em; border-radius: 50%; background: var(--success-bg) no-repeat center / 70%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B6B3A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E"); }
.sv-matrix td.y { color: var(--fg); }
.sv-matrix td.n::before { background-color: #EEF2F6; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F7184' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 12h10'/%3E%3C/svg%3E"); }
.sv-matrix td.n { color: var(--fg-3); }
.sv-matrix td.p::before { background-color: var(--warning-bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238F5300' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E"); }
.sv-matrix td.p { color: var(--warning); font-weight: 600; }
.sv-matrix__mc > * { background: #FFFBF3; }
.sv-matrix__mc th { box-shadow: inset 3px 0 0 var(--warning); }
.sv-mc { display: inline-block; margin-left: .4rem; font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .04em; color: var(--warning); background: var(--warning-bg); border-radius: var(--r-pill); padding: .15rem .55rem; white-space: nowrap; }
.sv-matrix[data-role] tbody td:not(.is-col), .sv-matrix[data-role] thead th[data-col]:not(.is-col) { opacity: .3; }
.sv-matrix[data-role] .is-col { background: var(--blue-50); }
.sv-matrix[data-role] thead th.is-col { box-shadow: inset 0 -2px 0 var(--blue-700); }
.sv-access__note { margin-top: 1rem; }

/* 4 · Audit trail -------------------------------------------------------- */
.sv-audit__grid { display: grid; gap: clamp(2.5rem, 1.5rem + 3vw, 5rem); align-items: center; }
@media (min-width: 1000px) { .sv-audit__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.sv-cats__label { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); margin-bottom: .7rem; }
.sv-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.sv-cats li { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .06em; padding: .35rem .7rem; border-radius: var(--r-pill); border: 1px solid var(--rule-strong); color: var(--fg-2); transition: background var(--dur-3), color var(--dur-3), border-color var(--dur-3); }
.sv-cats li.is-hot { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.sv-log { background: #04120D; border: 1px solid var(--rule-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-dark); overflow: hidden; font-family: var(--font-mono); }
.sv-log__bar { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--rule); font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.sv-log__bar-r { margin-left: auto; color: var(--fg-3); }
.sv-log__list { list-style: none; margin: 0; padding: .4rem 0; height: calc(7 * 3.25rem + .8rem); overflow: hidden; position: relative; }
.sv-log__list li { display: grid; grid-template-columns: 3.4rem 8.6rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; height: 3.25rem; padding: 0 1.1rem; border-bottom: 1px dashed rgba(111,209,165,.12); font-size: var(--fs-xs); color: var(--fg-2); }
.sv-log__list time { color: var(--fg-3); }
.sv-log__cat { justify-self: start; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mint); border: 1px solid rgba(111,209,165,.35); border-radius: var(--r-pill); padding: .15rem .5rem; white-space: nowrap; }
.sv-log__what { font-family: var(--font-body); font-size: var(--fs-sm); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-log__what b { color: var(--mint); font-weight: 600; }
.sv-log__who { color: var(--fg-3); white-space: nowrap; }
@media (max-width: 699.98px) {
  .sv-log__list { height: auto; }
  .sv-log__list li { grid-template-columns: 3rem minmax(0, 1fr); grid-template-rows: auto auto; height: auto; padding: .7rem 1rem; row-gap: .3rem; }
  .sv-log__list li .sv-log__what { grid-column: 1 / -1; white-space: normal; }
  .sv-log__list li .sv-log__who { display: none; }
  .sv-log__list li:nth-child(n+6) { display: none; }
}

/* 5 · DPDP ---------------------------------------------------------------- */
.sv-dpdp__grid { display: grid; gap: clamp(2rem, 1rem + 3vw, 4rem); }
@media (min-width: 1000px) { .sv-dpdp__grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); align-items: start; } .sv-dpdp__side { position: sticky; top: calc(var(--header-h) + 2rem); } }
.sv-dpdp__side { display: grid; gap: 1.2rem; }
.sv-dpdp__side .h2 { font-size: var(--fs-h3); }
.sv-roles-diagram { display: flex; align-items: center; gap: 0; margin-top: .6rem; }
.sv-rd__node { display: grid; padding: .7rem 1rem; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--surface); }
.sv-rd__node b { font-family: var(--font-display); font-weight: 600; }
.sv-rd__node small { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--fg-3); letter-spacing: .06em; }
.sv-rd__node--s { border-color: var(--green); }
.sv-rd__wire { flex: 1; min-width: 70px; position: relative; height: 1px; background: var(--green); text-align: center; }
.sv-rd__wire::after { content: ""; position: absolute; right: -1px; top: -4px; border: 4.5px solid transparent; border-left: 7px solid var(--green); }
.sv-rd__wire small { position: absolute; left: 0; right: 0; bottom: .35rem; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--fg-3); }
.sv-dpdp__table { width: 100%; font-size: var(--fs-sm); border-top: 2px solid var(--fg); }
.sv-dpdp__table thead th { text-align: left; font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); font-weight: 500; padding: .8rem 1rem .8rem 0; border-bottom: 1px solid var(--rule); }
.sv-dpdp__table tbody th, .sv-dpdp__table tbody td { padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
.sv-dpdp__table tbody th { width: 38%; font-weight: 600; color: var(--fg); }
.sv-dpdp__table tbody th .mono { display: block; font-size: var(--fs-2xs); font-weight: 500; color: var(--accent); margin-top: .2rem; }
.sv-dpdp__table td { color: var(--fg-2); }
.sv-dpdp__note { margin-top: 1rem; }
@media (max-width: 599.98px) { .sv-dpdp__table, .sv-dpdp__table tbody, .sv-dpdp__table tr, .sv-dpdp__table th, .sv-dpdp__table td { display: block; width: auto; } .sv-dpdp__table thead { display: none; } .sv-dpdp__table tbody th { border-bottom: 0; padding-bottom: .2rem; width: auto; } .sv-dpdp__table tbody td { padding-top: 0; } }

/* 6 · App security --------------------------------------------------------- */
.sv-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); border-top: 1px solid var(--rule); }
.sv-checks li { display: grid; grid-template-columns: 2rem 1fr; gap: 1rem; align-items: start; padding: 1.2rem 1.5rem 1.2rem 0; border-bottom: 1px solid var(--rule); color: var(--fg-2); }
.sv-checks li b { color: var(--fg); font-weight: 600; }
.sv-checks__box { width: 1.6rem; height: 1.6rem; border-radius: 6px; background: var(--green); display: grid; place-items: center; }
.sv-checks__box svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* 7 · Disclosure ------------------------------------------------------------ */
.sv-disclose { overflow: clip; }
.sv-disclose__lines { position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(180deg, transparent 0 31px, var(--ledger-line) 31px 32px); mask-image: radial-gradient(70% 80% at 50% 45%, #000 15%, transparent 72%); -webkit-mask-image: radial-gradient(70% 80% at 50% 45%, #000 15%, transparent 72%); }
.sv-disclose__inner { display: grid; justify-items: center; text-align: center; gap: 1.6rem; }
.sv-disclose__title { font-size: clamp(2.6rem, 1.2rem + 5.5vw, 6.5rem); }
.sv-disclose__mail { font-family: var(--font-mono); font-size: clamp(1.05rem, .7rem + 1.6vw, 2rem); color: var(--mint); border-bottom: 1px solid rgba(111,209,165,.4); padding-bottom: .2rem; user-select: all; overflow-wrap: anywhere; }
.sv-disclose__mail:hover { border-bottom-color: var(--mint); }

/* Workaround (foundation request): hidden glossary tips must not widen the mobile layout viewport */
.sv-disclose__mail { text-decoration: none; }

/* Access matrix, small screens: each action becomes a card listing the four roles */
@media (max-width: 799.98px) {
  .sv-matrix-wrap { overflow: visible; border: 0; background: none; box-shadow: none; }
  .sv-matrix { min-width: 0; display: block; }
  .sv-matrix thead { display: none; }
  .sv-matrix tbody { display: grid; gap: .8rem; }
  .sv-matrix tbody tr { display: grid; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
  .sv-matrix tbody th { width: auto; display: block; padding: .85rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--rule); }
  .sv-matrix td { display: grid; grid-template-columns: 1.2em minmax(0, 9.5rem) minmax(0, 1fr); align-items: center; column-gap: .6rem; padding: .6rem 1rem; }
  .sv-matrix td::before { margin: 0; grid-column: 1; grid-row: 1; }
  .sv-matrix td::after { grid-column: 2; grid-row: 1; font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .04em; color: var(--fg-2); font-weight: 400; }
  .sv-matrix td[data-col="1"]::after { content: "Administrator"; }
  .sv-matrix td[data-col="2"]::after { content: "Team, allocated"; }
  .sv-matrix td[data-col="3"]::after { content: "Team, not allocated"; }
  .sv-matrix td[data-col="4"]::after { content: "Client portal"; }
  .sv-matrix tbody tr > td:last-child { border-bottom: 0; }
  .sv-matrix__mc th { box-shadow: inset 3px 0 0 var(--warning); }
}
.sv-disclose__inner .btn-row { justify-content: center; }
@media (min-width: 900px) {
  .sv-vault .container { position: relative; }
  .sv-vault:not(.is-staged) .sv-vault__art { position: absolute; right: var(--gutter); top: 0; width: 230px; margin: 0; }
}
.sv-matrix-wrap:focus-visible { outline: 2px solid var(--green, #0B5D43); outline-offset: 3px; }
