/* EC2: Roles, User Data and Session Manager: the figures on its slides.
   Terminals, JSON, glyphs and the identity colours are in ../iam.css; the
   sequence and exam styles follow ../iam-roles/ and ../ec2/. */

:root { --ec2: #ed7100; --s3c: #3f8624; --sgc: #dd344c; --ssm: #e7157b; --ok: #1d8102; --no: #d13212; }

.ic { width: 34px; height: 34px; flex: none; }
.ic-t { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #232f3e; color: #fff; font: 700 13px var(--mono); }
.term .pr.pi { color: #f2b705; }
.term.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.term.tall { font-size: 12.5px; line-height: 1.42; }
.cap { display: block; font-size: 13px; color: var(--sv-ink2); margin: 4px 0; }
.ok { color: var(--ok); } .no { color: var(--no); }
.stack { display: flex; flex-direction: column; gap: 6px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.json { font-size: 12.5px; }
.json .hl.p, .json .hl.a { --c: #f3ecff; --cc: var(--role); }
.json .hl.b, .json .hl.o, .json .hl.r { --c: #eaf6e5; --cc: var(--s3c); }
.json .hl.k { --c: #eaf4fb; --cc: #0369a1; }
.json .hl.m { --c: #fdeef6; --cc: var(--ssm); }

/* The sections' colours. */
[data-sec="intro"] { --sec: #334155; }
[data-sec="role"] { --sec: #7c3aed; }
[data-sec="userdata"] { --sec: #b45309; }
[data-sec="connect"] { --sec: #be185d; }
[data-sec="placement"] { --sec: #0369a1; }

/* Tables. */
.tbl { border-collapse: collapse; background: #fff; border: 1px solid var(--sv-line); font-size: 14px; }
.tbl th, .tbl td { padding: 7px 11px; border-top: 1px solid #eef0f3; text-align: left; vertical-align: top; }
.tbl tr:first-child th { border-top: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--sv-ink2); }
.tbl tr:not(:first-child) th { font-weight: 700; }
.tbl code { font: 13px var(--mono); overflow-wrap: anywhere; }
.tbl.paths { margin-top: 12px; }
.tbl.cc td:last-child { background: #fdf2f8; }
.tbl.def { margin-top: 12px; }
.tbl.def td:first-child { width: 30px; font-size: 20px; }
.tbl.def td:first-child .ic, .tbl.def td:first-child .glyph { width: 24px; height: 24px; }
.tbl.def tr:first-child th { text-transform: none; letter-spacing: 0; color: var(--sv-ink); }
.tbl.def th { white-space: nowrap; font-family: var(--mono); font-size: 13px; }

/* Exam questions. */
.pe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pe-q { display: grid; grid-template-columns: 1.6em minmax(0, 1fr); gap: 8px; background: #fffbea; border: 1px solid #e8d48a; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; }
.pe-q > b { font-size: 16px; color: #8a6500; }
.pe-q p { margin: 0 0 6px; }
.pe-a, .pe-w { display: grid; grid-template-columns: 1.2em minmax(0, 1fr); gap: 4px; font-size: 13px; }
.pe-a { font-weight: 600; color: #1b5e05; }
.pe-w { color: var(--sv-ink2); }
.pe-q:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* The introduction. */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 12px; align-items: stretch; }
.intro > :nth-child(1) { grid-area: 1 / 1; } .intro > :nth-child(2) { grid-area: 2 / 1; }
.intro > .ip-inst { grid-area: 1 / 2 / 3 / 3; }
.intro > :nth-child(4) { grid-area: 1 / 3; } .intro > :nth-child(5) { grid-area: 2 / 3; }
.ip { background: #fff; border: 1px solid var(--sv-line); border-left: 5px solid var(--c); border-radius: 8px; padding: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ip span { display: flex; flex-direction: column; } .ip b { font-size: 15.5px; } .ip small { font-size: 13px; color: var(--sv-ink2); }
.ip-n { width: 26px; height: 26px; border-radius: 50%; display: grid !important; place-items: center; font-weight: 700; color: #fff; background: var(--c); }
.ip-role { --c: #7c3aed; } .ip-ud { --c: #b45309; } .ip-ssm { --c: #be185d; } .ip-pg { --c: #0369a1; }
.ip-inst { background: #fff7ef; border: 2px solid var(--ec2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 18px; text-align: center; }
.ip-inst .ic { width: 56px; height: 56px; } .ip-inst b { font: 700 17px var(--mono); } .ip-inst small { color: var(--sv-ink2); } .ip-inst code { font: 12.5px var(--mono); }

/* Keys on the instance, or a role. */
.nc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.nc-side { border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; border: 2px solid; }
.nc-side.bad { border-color: var(--no); background: #fff8f6; } .nc-side.good { border-color: var(--role); background: #fbf9ff; }
.nc-h { display: flex; align-items: center; gap: 10px; } .nc-h b { font-size: 15.5px; }
.nc-key { font: 700 14px var(--mono); background: #fff; border: 1px dashed var(--no); border-radius: 6px; padding: 6px 10px; align-self: flex-start; }
.nc-key::before { content: "🔑 "; }
.nc-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nc-l li { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 8px; background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 5px 8px; font-size: 13.5px; }
.nc-l code { font: 12.5px var(--mono); } .nc-l span::before { content: "→ "; color: var(--no); }
.nc-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nc-flow > span { background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.nc-flow code { font: 12.5px var(--mono); } .nc-flow small { color: var(--sv-ink2); font-size: 12px; }
.nc-flow i { font-style: normal; font-size: 20px; color: var(--role); }
.nc-res { font-weight: 700; font-size: 14px; margin-top: auto; }

/* The services a trust policy can name. */
.svc-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.svc-row span { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 6px 10px; }
.svc-row span.on { border: 2px solid var(--svc); background: #f3faf0; }
.svc-row code { font: 12.5px var(--mono); } .svc-row small { color: var(--sv-ink2); font-size: 12.5px; }

/* The console's breadcrumb and the role wizard. */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 10px; }
.crumbs small { color: var(--sv-ink2); margin-right: 4px; }
.crumbs span { background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 2px 8px; font-weight: 600; }
.crumbs i { color: var(--sv-ink2); font-style: normal; }
.wzs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wz { background: #fff; border: 1px solid var(--sv-line); border-top: 4px solid #0972d3; border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wz-h { display: flex; align-items: center; gap: 8px; } .wz-h span { width: 24px; height: 24px; border-radius: 50%; background: #0972d3; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.wz-r { display: flex; flex-direction: column; font-size: 13px; } .wz-r span { color: var(--sv-ink2); font-size: 12px; } .wz-r b { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.wz-made { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.wz-made > span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fbf9ff; border: 2px dashed var(--role); border-radius: 8px; padding: 8px 10px; }
.wz-made > span.prof { border-style: solid; border-color: #545b64; background: #fff; flex-direction: column; align-items: flex-start; gap: 2px; }
.wz-made code { font: 12px var(--mono); overflow-wrap: anywhere; }

/* The instance profile. */
.pf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pf > i { font-style: normal; font-size: 22px; color: var(--sv-ink2); }
.pf-inst { background: #fff7ef; border: 2px solid var(--ec2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pf-inst code, .pf-prof > code { font: 12.5px var(--mono); }
.pf-prof { border: 2px solid #545b64; border-radius: 10px; padding: 8px 12px 12px; background: #f8f9fa; display: flex; flex-direction: column; gap: 6px; }
.pf-prof > small { font-size: 12px; font-weight: 700; color: var(--sv-ink2); text-transform: uppercase; letter-spacing: .04em; }
.pf-role { display: flex; align-items: center; gap: 8px; background: #fbf9ff; border: 2px dashed var(--role); border-radius: 8px; padding: 8px 10px; }
.pf-role span { display: flex; flex-direction: column; } .pf-role small { font-size: 12px; color: var(--sv-ink2); } .pf-role code { font: 600 13px var(--mono); }
.pf-pols { display: flex; flex-direction: column; gap: 6px; }
.pf-pols span { font: 12.5px var(--mono); background: #fff; border: 1px solid var(--sv-line); border-left: 4px solid #ec7211; border-radius: 6px; padding: 5px 9px; }

/* iam:PassRole. */
.pr-outs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.pr-o { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; background: #fff; border: 1px solid var(--sv-line); border-left: 5px solid; border-radius: 8px; padding: 8px 10px; }
.pr-o.ok { border-left-color: var(--ok); } .pr-o.no { border-left-color: var(--no); background: #fff8f6; }
.pr-o span { display: flex; flex-direction: column; } .pr-o code { font: 12px var(--mono); overflow-wrap: anywhere; }
.pr-o .m { grid-column: 1 / -1; font-size: 13.5px; } .pr-o.ok .m { color: var(--ok); } .pr-o.no .m { color: var(--no); }
.pr-why { font-size: 13.5px; background: #fbf9ff; border-left: 4px solid var(--role); border-radius: 6px; padding: 8px 10px; }

/* The sequence. */
.seq { width: 100%; max-height: 100%; }
.sq-actor { fill: #232f3e; }
.sq-at { fill: #fff; font-size: 15px; font-weight: 700; }
.sq-as { fill: #c6ccd2; font-size: 11.5px; }
.sq-life { stroke: #c6ccd2; stroke-width: 2; stroke-dasharray: 5 5; }
.sq-m { stroke: #545b64; stroke-width: 2; fill: none; }
.sq-head { fill: #545b64; }
.back .sq-m { stroke-dasharray: 7 4; }
.temp .sq-m { stroke: var(--role); stroke-width: 2.6; } .temp .sq-head { fill: var(--role); }
.sq-n { fill: #ec7211; }
.sq-nt { fill: #fff; font-size: 12px; font-weight: 700; }
.sq-a { font-size: 14px; font-weight: 600; fill: #16191f; }
.sq-b { font-size: 13px; fill: #545b64; }
.temp .sq-b { fill: var(--role); font-weight: 600; }
.sq-box { fill: #fff; stroke: #545b64; stroke-width: 1.4; }
.sq-box.iam { fill: #fff5f6; stroke: #dd344c; }
.sq-box.chk { fill: #fbf9ff; stroke: var(--role); }
.sq-bt { font-size: 13.5px; fill: #16191f; }

/* The credentials' lifetime. */
.rf { width: 100%; max-height: 100%; }
.rf-axis { stroke: #c6ccd2; stroke-width: 2; } .rf-h { font-size: 13px; font-weight: 600; fill: #545b64; }
.rf-set { fill: #f3ecff; stroke: var(--role); stroke-width: 2; }
.rf-t { font: 600 13px ui-monospace, Menlo, Consolas, monospace; fill: #16191f; }
.rf-exp { stroke: var(--no); stroke-width: 2.5; } .rf-l { font-size: 12.5px; fill: #545b64; }
.rf-new { stroke: var(--ok); stroke-width: 2; stroke-dasharray: 5 4; } .rf-gap { stroke: var(--ok); stroke-width: 6; opacity: .35; }
.rf-l.new { fill: var(--ok); font-weight: 600; }
.rf-app { fill: #232f3e; } .rf-at { fill: #fff; font-size: 13px; font-weight: 600; }

/* IMDS. */
.imds { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.im-host { position: relative; background: #f2f3f3; border: 2px solid #545b64; border-radius: 10px; padding: 26px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.im-host > small { position: absolute; top: 5px; left: 12px; font-size: 12.5px; font-weight: 700; color: var(--sv-ink2); }
.im-inst { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff7ef; border: 2px solid var(--ec2); border-radius: 8px; padding: 8px 12px; }
.im-app { font: 12.5px var(--mono); background: #fff; border: 1px solid var(--sv-line); border-radius: 4px; padding: 2px 6px; }
.im-arrow { font-size: 14px; color: #0369a1; font-weight: 600; } .im-arrow code { font: 13px var(--mono); }
.im-svc { background: #232f3e; color: #fff; border-radius: 8px; padding: 8px 16px; display: flex; flex-direction: column; align-items: center; }
.im-svc small { color: #c6ccd2; font-size: 12px; }
.im-out { background: #fff; border: 1px dashed #545b64; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 14px; }
.im-out > span:first-child { font-size: 26px; } .im-out .no { font-weight: 600; font-size: 13px; }

/* IMDSv1 and IMDSv2. */
.v12 { width: 100%; max-height: 100%; }
.v-h { font: 700 14px ui-monospace, Menlo, Consolas, monospace; fill: #16191f; }
.v-att { fill: #fff8f6; stroke: var(--no); stroke-width: 2; } .v-app { fill: #fff7ef; stroke: var(--ec2); stroke-width: 2; } .v-imds { fill: #232f3e; }
.v-at { font-size: 13px; font-weight: 600; fill: #16191f; } .v-imds + .v-at, .v-at.d { fill: #16191f; }
.v-imds + text { fill: #fff !important; }
.v-m { stroke: #545b64; stroke-width: 2; } .v-t { font: 11px ui-monospace, Menlo, Consolas, monospace; fill: #545b64; }
.v-r { font-size: 13.5px; font-weight: 700; } .v-r.no { fill: var(--no); } .v-r.ok { fill: var(--ok); }
.v-r2 { font-size: 12px; fill: #545b64; } .v-n { font-size: 12.5px; fill: #545b64; }

/* The credential chain. */
.chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.chain li { display: grid; grid-template-columns: 28px minmax(13em, auto) minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 4px 10px; font-size: 14px; }
.ch-n { width: 24px; height: 24px; border-radius: 50%; background: #545b64; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.chain small { font: 12.5px var(--mono); color: var(--sv-ink2); overflow-wrap: anywhere; }
.chain em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--no); }
.chain em.ok { color: var(--ok); }
.chain li.trap { background: #fff8f6; border-color: #f5c6bb; } .chain li.trap .ch-n { background: var(--no); }
.chain li.lit { background: #fbf9ff; border: 2px solid var(--role); } .chain li.lit .ch-n { background: var(--role); }

/* Stolen credentials. */
.sto { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sto > i { font-style: normal; font-size: 13px; color: var(--no); font-weight: 600; }
.sto-b { background: #fff7ef; border: 2px solid var(--ec2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 14px; }
.sto-b code { font: 12px var(--mono); } .sto-b small { color: var(--sv-ink2); font-size: 12px; }
.sto-b.att { border-color: var(--no); background: #fff8f6; font-size: 24px; } .sto-b.att b { font-size: 14px; }
.sto-b.s3 { border-color: var(--s3c); background: #f6fbf3; } .sto-b .ok { font-weight: 700; font-size: 13px; }

/* User data at boot. */
.boot { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bt-h { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sv-ink2); }
.bt-row { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.bt-row > i { align-self: center; font-style: normal; font-size: 20px; color: var(--sv-ink2); }
.bt { flex: 1; min-width: 130px; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.bt small { font-size: 12.5px; color: var(--sv-ink2); overflow-wrap: anywhere; }
.bt.on { border: 2px solid #b45309; background: #fffaf2; } .bt.off { border: 2px dashed #8a8f96; background: #f2f3f3; }

/* Session Manager. */
.ssmf { width: 100%; max-height: 100%; }
.sm-us { fill: #fff; stroke: #545b64; stroke-width: 1.6; }
.sm-svc { fill: #fdf2f8; stroke: var(--ssm); stroke-width: 2; }
.sm-sg { fill: #fff6f7; stroke: var(--sgc); stroke-width: 3; } .sm-sgt { font: 700 13px ui-monospace, Menlo, Consolas, monospace; fill: var(--sgc); }
.sm-inst { fill: #fff7ef; stroke: var(--ec2); stroke-width: 2; }
.sm-agent { fill: #232f3e; } .sm-at { fill: #fff; font-size: 13px; font-weight: 700; } .sm-agent + text + text { fill: #c6ccd2; }
.sm-t { font-size: 14px; font-weight: 700; fill: #16191f; } .sm-s { font-size: 12px; fill: #545b64; }
.sm-c { font: 11px ui-monospace, Menlo, Consolas, monospace; fill: #16191f; }
.sm-m { stroke: #545b64; stroke-width: 2.4; } .sm-h { fill: #545b64; }
.sm-m.out { stroke: var(--ssm); } .sm-h.out { fill: var(--ssm); }
.sm-l { font-size: 12.5px; font-weight: 700; fill: #16191f; } .sm-l.out { fill: var(--ssm); }
.sm-no { font-size: 13px; font-weight: 700; fill: var(--no); }
.nds { display: flex; flex-direction: column; gap: 8px; }
.nd { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--sv-line); border-left: 5px solid var(--ssm); border-radius: 8px; padding: 8px 10px; }
.nd span { display: flex; flex-direction: column; } .nd b { font-size: 14px; } .nd small { font-size: 12.5px; color: var(--sv-ink2); }

/* Placement groups. */
.pg { width: 100%; max-height: 100%; margin-bottom: 10px; }
.pg-p { fill: #fbfcfd; stroke: #0972d3; stroke-width: 2; stroke-dasharray: 8 6; }
.pg-t { font-size: 15px; font-weight: 700; fill: #16191f; } .pg-s { font-size: 12px; fill: #545b64; } .pg-n { font-size: 12.5px; font-weight: 700; fill: #0369a1; }
.pg-seg { fill: #eaf4fb; stroke: #0369a1; stroke-width: 1.5; }
.pg-part { fill: none; stroke-width: 2; } .pg-part.p0 { stroke: #c2410c; } .pg-part.p1 { stroke: #7c3aed; } .pg-part.p2 { stroke: #0f766e; }
.pg-rack { fill: #e9ebed; stroke: #545b64; stroke-width: 1.4; }
.pg-i { stroke-width: 1.6; } .pg-i.c { fill: #fff7ef; stroke: var(--ec2); }
.pg-i.p0 { fill: #fdeee3; stroke: #c2410c; } .pg-i.p1 { fill: #f3ecff; stroke: #7c3aed; } .pg-i.p2 { fill: #e6f5f3; stroke: #0f766e; }
.pg-i.s { fill: #fff7ef; stroke: var(--ec2); }

@media (max-width: 860px) {
  .pe, .two, .pr-outs, .nc, .wzs, .imds { grid-template-columns: 1fr; }
  .intro { grid-template-columns: 1fr; grid-template-rows: none; }
  .intro > * { grid-area: auto !important; }
  .chain li { grid-template-columns: 28px minmax(0, 1fr); }
  .chain li small, .chain li em { grid-column: 2; }
  .nc-l li { grid-template-columns: 1fr; }
  .tbl { font-size: 13px; display: block; overflow-x: auto; }
}
