/* Identity Desk console: compact tabular queues for scanning applications and escalations, roomy cards
   inside an onboarding file where analysts and compliance officers compare dashed AI checks and risk
   scores against solid human determinations. */
body { font-size: .9rem; }
.loading { padding: 4rem 1.25rem; text-align: center; color: var(--ink-3); }
.dim { color: var(--ink-3); }
.small { font-size: .82rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-family: var(--mono); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
a.num { text-decoration-thickness: 1px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--action); cursor: pointer; text-decoration: underline; }
.fiction { border: 1px dashed var(--line); border-radius: var(--radius); padding: .75rem .95rem; color: var(--ink-2); font-size: .85rem; margin-top: 1.5rem; }

/* desk picker */
.signin { max-width: 50rem; margin: 0 auto; padding: 2.8rem 1.25rem 3.5rem; }
.signin h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 1.8rem 0 .55rem; }
.signin .sub { color: var(--ink-2); font-size: 1rem; margin-bottom: 1.4rem; max-width: 42rem; }
.signin .sub.small { font-size: .88rem; margin-top: 1.2rem; }
.desks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
@media (max-width: 36rem) { .desks { grid-template-columns: 1fr; } }
.desk { text-align: left; font: inherit; cursor: pointer; background: var(--surface); color: var(--ink);
        border: 1px solid var(--line); border-left: .26rem solid var(--action); border-radius: var(--radius); padding: .95rem 1.1rem; }
.desk:hover { border-color: var(--action); box-shadow: var(--shadow); }
.desk b { display: block; font-size: 1.08rem; }
.desk em { display: block; font-style: normal; font-family: var(--mono); color: var(--ink-3); font-size: .78rem; margin-top: .1rem; }
.desk span { display: block; color: var(--ink-2); font-size: .9rem; margin: .35rem 0 .65rem; }
.desk i { font-style: normal; font-family: var(--mono); font-weight: 600; font-size: .82rem; color: var(--action); }
.signin details { margin-top: 1.4rem; color: var(--ink-2); }
.signin summary { cursor: pointer; font-weight: 600; }
.manual { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; margin-top: .85rem; }
.manual label { display: grid; gap: .25rem; font-size: .85rem; }

input, textarea, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--ink-3);
                          border-radius: .3rem; padding: .45rem .6rem; max-width: 100%; }
textarea { width: 100%; resize: vertical; }

/* shell */
.shell { display: grid; grid-template-columns: 15.2rem minmax(0, 1fr); min-height: calc(100vh - 2.3rem); }
aside { background: var(--deep); color: var(--deep-ink); padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.4rem;
        position: sticky; top: 0; height: 100vh; align-self: start; overflow-y: auto; }
aside .mark svg rect:first-of-type { fill: #dff0f2; }
aside .mark svg rect:last-of-type, aside .mark svg path:first-of-type { stroke: #397680; }
aside .mark svg path:last-of-type { stroke: #115059; }
aside nav { display: grid; gap: .2rem; }
aside nav a { color: inherit; text-decoration: none; padding: .5rem .7rem; border-radius: .3rem; opacity: .84; font-size: .94rem; }
aside nav a:hover { opacity: 1; background: rgba(255, 255, 255, .07); }
aside nav a.on { opacity: 1; background: rgba(255, 255, 255, .14); font-weight: 600; box-shadow: inset .22rem 0 0 #6ecfdb; }
aside :focus-visible { outline-color: #6ecfdb; }
.me { margin-top: auto; display: grid; gap: .3rem; font-size: .85rem; border-top: 1px solid var(--deep-line); padding-top: 1rem; }
.me b { font-size: .96rem; }
.me > span { color: var(--deep-dim); font-family: var(--mono); font-size: .78rem; }
.me .switch { display: grid; gap: .25rem; margin-top: .55rem; color: var(--deep-ink); }
.me select { width: 100%; padding: .35rem .45rem; font-size: .84rem; background: #142c31; color: #eaf2f3; border-color: #385a61; }
.me .linkish { color: var(--deep-dim); justify-self: start; margin-top: .35rem; font-size: .83rem; }
main { padding: 1.65rem 2rem 4rem; min-width: 0; max-width: 84rem; }
@media (max-width: 58rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .75rem 1rem; position: static; height: auto; }
  aside nav { display: flex; flex-wrap: wrap; order: 3; flex-basis: 100%; gap: .25rem; }
  aside nav a { padding: .38rem .6rem; font-size: .88rem; }
  aside nav a.on { box-shadow: inset 0 -.2rem 0 #6ecfdb; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; grid-auto-flow: column; align-items: center; gap: .7rem; }
  .me b, .me > span { display: none; }
  .me .switch { margin: 0; display: flex; align-items: center; gap: .4rem; font-size: .82rem; }
  .me .switch select { width: auto; max-width: 11.5rem; }
  .me .linkish { margin: 0; white-space: nowrap; }
  main { padding: 1.2rem 1rem 3rem; }
}
@media (max-width: 30rem) { .me .switch { font-size: 0; gap: 0; } .me .switch select { font-size: .82rem; max-width: 9.5rem; } }

header.page { margin-bottom: 1.1rem; }
header.page h1 { font-size: 1.55rem; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
header.page h1 .chip { font-size: .78rem; letter-spacing: 0; }
header.page p { color: var(--ink-2); margin-top: .35rem; font-size: .97rem; max-width: 56rem; }
.crumb { margin-bottom: .7rem; font-size: .86rem; }
.crumb a { text-decoration: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.1rem; overflow: hidden; }
.card-head { padding: .85rem 1rem .65rem; display: flex; align-items: baseline; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.card-head > div { min-width: 0; }
.card-head h2 { font-size: 1rem; font-weight: 700; letter-spacing: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-head p { color: var(--ink-3); font-size: .84rem; margin-top: .2rem; max-width: 54rem; }
.count { font-family: var(--mono); font-size: .74rem; font-weight: 700; background: var(--sunk); color: var(--ink-2); border-radius: 999px; padding: .1rem .5rem; }
.empty { padding: .2rem 1rem 1rem; color: var(--ink-3); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .71rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
     font-weight: 700; padding: .48rem .9rem; background: var(--sunk); border-block: 1px solid var(--line-2); white-space: nowrap; }
td { padding: .6rem .9rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.note { color: var(--ink-2); font-size: .84rem; max-width: 54rem; }
tr.has-note td { border-bottom: 0; padding-bottom: .2rem; }
tr.noterow td { padding-top: 0; }
.btn { white-space: nowrap; }

/* filter stages and summary metrics */
.stages { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.stages a { text-decoration: none; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--radius); padding: .42rem .75rem; font-size: .79rem; min-width: 4.7rem; }
.stages a b { display: block; font-family: var(--mono); font-size: 1.22rem; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stages a.on { border-color: var(--action); box-shadow: inset 0 -.2rem 0 var(--action); color: var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.1rem; }
@media (max-width: 56rem) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; }
.kpi.ai-kpi { border-style: dashed; border-color: var(--ai); background: var(--ai-soft); }
.kpi b { display: block; font-family: var(--mono); font-size: 1.45rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { display: block; font-size: .8rem; color: var(--ink-2); margin-top: .15rem; }

/* application detail page */
.path { list-style: none; display: flex; margin: 0 0 1.1rem; padding: 0; font-size: .8rem; overflow-x: auto; position: relative; }
.path li { flex: 1; min-width: 6rem; padding: .65rem .5rem 0 0; border-top: .25rem solid var(--line); color: var(--ink-3); position: relative; }
.path li.past { border-color: var(--action); color: var(--ink-2); }
.path li.past::before { content: "✓ "; }
.path li.now { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.path li.now::before { content: "● "; }

.next { border-left: .3rem solid var(--action); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.next .actions, .actions.pad { padding: 0 1rem .95rem; }
.inline { flex-basis: 100%; display: grid; gap: .6rem; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius);
          padding: .85rem; margin-top: .35rem; max-width: 38rem; text-align: left; }
.inline label { display: grid; gap: .25rem; font-size: .84rem; font-weight: 600; }
.inline .hint { font-weight: 400; font-size: .79rem; color: var(--ink-3); }
.inline .row { display: flex; gap: .5rem; flex-wrap: wrap; }

.ready { list-style: none; margin: 0; padding: 0 1rem .95rem; display: grid; gap: .24rem; color: var(--ink-2); font-size: .86rem; }
.ready li { display: grid; grid-template-columns: 1.15rem 1fr; }
.ready li.yes span:first-child { color: var(--ok); font-weight: 700; }
.ready li.no { color: var(--ink); font-weight: 600; }
.ready li.bad { color: var(--bad); font-weight: 600; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line);
         border-radius: var(--radius); overflow: hidden; margin: 0 0 1.1rem; }
@media (max-width: 64rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; } }
.facts div { background: var(--surface); padding: .75rem .95rem; min-width: 0; }
.facts dt { font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.facts dd { margin: .2rem 0 0; font-size: .98rem; font-weight: 600; overflow-wrap: anywhere; white-space: normal; }
.facts small { display: block; font-weight: 400; color: var(--ink-2); font-size: .81rem; margin-top: .15rem; white-space: normal; }

.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.cols > div { min-width: 0; }
@media (max-width: 78rem) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* AI checks and assessments vs human determinations:
   DASHED border = AI-originated check or unreviewed AI risk score.
   SOLID border  = analyst tier review, compliance escalation finding, vendor check or final decision. */
.stack { display: grid; gap: .75rem; padding: 0 1rem 1rem; }
.asm-card, .esc-card, .ver-card { border: 1px solid var(--line); border-left: .28rem solid var(--ink-3); border-radius: var(--radius); padding: .8rem .95rem; background: var(--surface); }
.asm-card.draft { border: 1px dashed var(--ai); border-left: .3rem dashed var(--ai); background: var(--ai-soft); }
.asm-card.accepted { border-left-color: var(--ok); }
.asm-card.overridden { border-left-color: var(--action); }
.esc-card.open { border-left-color: var(--action); }
.esc-card.cleared { border-left-color: var(--ok); }
.esc-card.confirmed { border-left-color: var(--bad); }
.ver-card.pass { border-left-color: var(--ok); }
.ver-card.review { border-left-color: var(--wait); }
.ver-card.fail, .ver-card.hit { border-left-color: var(--bad); }
.ver-card.ai-src { border: 1px dashed var(--ai); border-left: .3rem dashed var(--ai); background: var(--ai-soft); }

.item-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.item-head strong { font-size: .95rem; }
.ver-detail { font-size: .88rem; color: var(--ink); margin-top: .4rem; }
.ai-proposal { margin-top: .45rem; padding: .5rem .65rem; border: 1px dashed var(--ai); border-radius: .28rem; background: var(--ai-soft); color: var(--ink); font-size: .85rem; }
.asm-card.draft .ai-proposal { border: 0; padding: 0; background: transparent; }
.ai-proposal small { display: block; font-family: var(--mono); color: var(--ai); font-size: .75rem; margin-top: .2rem; font-weight: 600; }
.human-note { margin-top: .5rem; padding: .5rem .65rem; border: 1px solid var(--line); border-left: .24rem solid var(--ink); border-radius: .28rem; background: var(--sunk); color: var(--ink); font-size: .84rem; }
.asm-card .actions, .esc-card .actions { margin-top: .65rem; }
.mini-hist { margin-top: .45rem; font-size: .78rem; color: var(--ink-3); font-family: var(--mono); }

.banner-note { margin: 0 1rem .9rem; padding: .65rem .85rem; border: 1px solid var(--line); border-left: .28rem solid var(--ink); border-radius: var(--radius); background: var(--sunk); font-size: .88rem; }
.banner-note.adverse { border-color: var(--bad); background: var(--bad-soft); color: var(--ink); }
.banner-note.waiting { border-color: var(--wait); background: var(--wait-soft); color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0 1rem 1rem 1.15rem; }
.timeline li { position: relative; padding: 0 0 .9rem 1.1rem; border-left: 2px solid var(--line); }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -.4rem; top: .3rem; width: .65rem; height: .65rem; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 .2rem var(--surface); }
.timeline li.success::before { background: var(--ok); }
.timeline li.warning::before { background: var(--wait); }
.timeline li.error::before { background: var(--bad); border-radius: .1rem; }
.timeline b { display: block; font-weight: 600; }
.timeline span { color: var(--ink-3); font-size: .81rem; display: block; margin-top: .1rem; }

.done, .refused { border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1.1rem; }
.done { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); font-weight: 600; }
.refused { background: var(--bad-soft); color: var(--ink); border: 1px solid var(--bad); border-left: .32rem solid var(--bad); }
.refused b { color: var(--bad); }
.refused .rule { display: block; font-family: var(--mono); font-size: .78rem; color: var(--ink-2); margin-top: .25rem; }

.legal-bar { border-top: 1px solid var(--line); background: var(--surface); padding: 1rem 1.25rem; font-size: .78rem; color: var(--ink-3); position: relative; z-index: 1; }
.legal-bar p { max-width: 72rem; margin: 0 auto; }
.legal-bar p + p { margin-top: .5rem; }

/* Phones: stack table rows into labelled blocks with zero horizontal overflow. */
@media (max-width: 42rem) {
  .scroll { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { padding: .65rem .95rem; border-bottom: 1px solid var(--line-2); }
  tbody tr:last-child { border-bottom: 0; }
  tr.has-note { border-bottom: 0; padding-bottom: 0; }
  tr.noterow { padding-top: .2rem; }
  td { padding: .16rem 0; border: 0; overflow-wrap: anywhere; }
  td:empty { display: none; }
  td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .68rem; letter-spacing: .05em;
      text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-top: .25rem; }
  td:first-child::before { display: none !important; }
  td:first-child { font-size: .95rem; }
  .path li { min-width: 5.4rem; }
}
