/* RDS, Aurora and ElastiCache: the figures on its slides. Terminals, JSON and
   the shared colours are in ../iam.css. */

:root { --rds: #3b48cc; --aur: #3b48cc; --ec: #c925d1; --ok: #1d8102; --no: #d13212; }

.ic { width: 34px; height: 34px; flex: none; }
.ic.sm { width: 22px; height: 22px; vertical-align: middle; }
.term.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.json { white-space: pre-wrap; overflow-wrap: anywhere; }
.cap { display: block; font-size: 13px; color: var(--sv-ink2); margin: 4px 0; }
.sv-fig { gap: 12px; }

[data-sec="intro"] { --sec: #334155; }
[data-sec="engines"] { --sec: #3b48cc; }
[data-sec="ha"] { --sec: #0369a1; }
[data-sec="backups"] { --sec: #3f6212; }
[data-sec="security"] { --sec: #be123c; }
[data-sec="aurora"] { --sec: #6d28d9; }
[data-sec="cache"] { --sec: #a21caf; }
[data-sec="choose"] { --sec: #475569; }

/* 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; }
.hcmp, .chs, .snap, .ect, .tts { font-size: 13.5px; }

/* 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; }

/* Database instances and AZs. */
.dbi { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; background: #fff; border: 2px solid var(--rds); border-radius: 10px; padding: 6px 10px; }
.dbi span { display: flex; flex-direction: column; min-width: 0; } .dbi b { font: 700 13px var(--mono); overflow-wrap: anywhere; } .dbi small { font-size: 12px; color: var(--sv-ink2); }
.dbi.standby { border-style: dashed; background: #f5f6fa; }
.dbi.replica, .dbi.reader { border-color: #0f766e; }
.dbi.writer { border-color: var(--rds); background: #f0f2ff; }
.dbi.dim { opacity: .7; }
.az { position: relative; border: 2px dashed #0972d3; border-radius: 12px; padding: 26px 10px 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.az > small { position: absolute; top: 5px; left: 12px; font: 600 12.5px var(--mono); color: var(--sv-ink2); }
.az.on { background: #f7fbff; }

/* What AWS handles. */
.hws { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; }
.hw { background: #fff; border: 1px solid var(--sv-line); border-top: 5px solid var(--c); border-radius: 10px; padding: 10px 12px; }
.hw.aws { --c: #ec7211; } .hw.us { --c: var(--rds); }
.hw ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; } .hw li { margin: 3px 0; }
.hw-db { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.hw-db .ic { width: 56px; height: 56px; } .hw-db b { font-family: var(--mono); } .hw-db small { color: var(--sv-ink2); }

/* The VPC. */
.vpc { position: relative; border: 2px solid #8c4fff; border-radius: 12px; padding: 28px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.vpc > small { position: absolute; top: 6px; left: 12px; font: 600 12.5px var(--mono); color: #6d28d9; }
.vpc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub { position: relative; border-radius: 8px; padding: 22px 8px 8px; min-height: 54px; }
.sub > small { position: absolute; top: 4px; left: 8px; font: 11.5px var(--mono); color: var(--sv-ink2); }
.sub.pub { background: #eef6ea; } .sub.priv { background: #e8f1fb; }
.sg-db { outline: 2px solid #dd344c; outline-offset: -2px; }
.app { display: flex; align-items: center; gap: 6px; font-size: 13px; } .app code { font: 11.5px var(--mono); color: #dd344c; }
.vpc-rule, .vpc-ep { font-size: 13.5px; } .vpc-rule code { color: #dd344c; font: 600 13px var(--mono); }
.vpc-ep { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .vpc-ep small { color: var(--sv-ink2); } .vpc-ep code { font: 600 13px var(--mono); overflow-wrap: anywhere; }

/* The instance. */
.inst { background: #fff; border: 2px solid var(--rds); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; max-width: 760px; }
.inst-h { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #eef0f3; padding-bottom: 6px; }
.inst-h span { display: flex; flex-direction: column; } .inst-h b { font-family: var(--mono); } .inst-h small { color: var(--sv-ink2); }
.kv { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 8px; font-size: 13.5px; }
.kv span { color: var(--sv-ink2); } .kv code { font: 12.5px var(--mono); overflow-wrap: anywhere; }

/* High availability. */
.ha { display: flex; flex-direction: column; gap: 12px; }
.ha-app, .eps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.ha-app code, .eps code { font: 12.5px var(--mono); background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 2px 8px; overflow-wrap: anywhere; }
.ha-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.ha-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sync { display: flex; flex-direction: column; align-items: center; font-size: 12.5px; color: var(--rds); text-align: center; }
.sync b { font-size: 26px; } .sync.wide { flex-direction: row; gap: 8px; justify-content: center; }
.ha-note { font-size: 13.5px; color: var(--no); }
.fo td { vertical-align: middle; } .fo td:nth-child(3) { font-size: 13px; }
.fo-bar { display: grid; grid-template-columns: 1fr 1.6fr 1fr; border-radius: 8px; overflow: hidden; font: 600 13px system-ui; color: #fff; text-align: center; }
.fo-bar span { padding: 6px; } .fo-bar .up { background: var(--ok); } .fo-bar .down { background: var(--no); }
.rr { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.rr-reg { position: relative; border: 2px dashed #545b64; border-radius: 12px; padding: 26px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.rr-reg > small { position: absolute; top: 5px; left: 12px; font: 600 12.5px var(--mono); color: var(--sv-ink2); }
.rr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.rr-col { display: flex; flex-direction: column; gap: 8px; }
.async { display: flex; flex-direction: column; align-items: center; color: #0f766e; font-size: 12.5px; } .async b { font-size: 26px; }
.rr-x { font-size: 12.5px; color: #0f766e; }
.rr-app { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; }

/* Backups. */
.bk { width: 100%; height: auto; }
.bk-axis { stroke: #c6ccd2; stroke-width: 2; }
.bk-snap { fill: #3f6212; } .bk-log { stroke: #84cc16; stroke-width: 1.5; }
.bk-t { font: 12.5px system-ui; fill: #545b64; } .bk-l { font: 600 13px system-ui; fill: #16191f; } .bk-l.pit { fill: #be123c; }
.bk-pit { stroke: #be123c; stroke-width: 2.5; stroke-dasharray: 5 4; }
.bk-ret { stroke: #3f6212; stroke-width: 3; }
.restore { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; } .restore code { font: 13px var(--mono); } .restore small { color: var(--sv-ink2); }

/* Security. */
.enc { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.enc-k { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border: 2px solid #dd344c; border-radius: 10px; padding: 10px; }
.enc-k code { font: 12.5px var(--mono); }
.enc-items { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.enc-i { background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 5px 10px; font-size: 13.5px; }
.enc-steps { grid-column: 1 / -1; background: #fff; border: 1px solid var(--sv-line); border-left: 5px solid #be123c; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.enc-steps ol { margin: 6px 0 0; padding-left: 20px; }
.enc-tls { grid-column: 1 / -1; font-size: 14px; } .enc-tls code { font: 13px var(--mono); }
.ia { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sec, #334155); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.rot { display: flex; gap: 10px; background: #fff; border: 2px solid #dd344c; border-radius: 10px; padding: 10px; }
.rot > div { display: flex; flex-direction: column; gap: 8px; }
.rot-r { display: flex; flex-direction: column; font-size: 13.5px; border-left: 3px solid #dd344c; padding-left: 8px; } .rot-r small { color: var(--sv-ink2); }
.px { width: 100%; height: auto; }
.px-in { fill: none; stroke: #ed7100; stroke-width: 1.8; } .px-out { fill: none; stroke: var(--rds); stroke-width: 3; }
.px-fn { fill: #fff7ef; stroke: #ed7100; } .px-box { fill: #f0f2ff; stroke: var(--rds); stroke-width: 2; } .px-db { fill: #fff; stroke: var(--rds); stroke-width: 2; }
.px-t { font: 12.5px system-ui; fill: #545b64; } .px-b { font: 700 14px system-ui; fill: #16191f; }

/* Aurora. */
.au { display: flex; flex-direction: column; gap: 0; }
.au-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.au-az { position: relative; border: 2px dashed #0972d3; border-bottom: 0; border-radius: 12px 12px 0 0; padding: 26px 10px 10px; display: flex; flex-direction: column; gap: 10px; }
.au-az > small { position: absolute; top: 5px; left: 12px; font: 600 12.5px var(--mono); color: var(--sv-ink2); }
.au-copies { display: flex; gap: 8px; justify-content: center; }
.au-copies i { width: 40px; height: 26px; border-radius: 4px; background: #ede9fe; border: 2px solid #6d28d9; }
.au-vol { background: #6d28d9; color: #fff; border-radius: 0 0 12px 12px; padding: 10px; text-align: center; font-size: 14px; }
.au-vol small { opacity: .85; } .au-vol img { filter: brightness(10); }
.tiers { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; }
.tiers span { background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 2px 8px; } .tiers code { font: 12.5px var(--mono); }
.aep { font-size: 13.5px; }
.sl { width: 100%; height: auto; }
.sl-axis { stroke: #c6ccd2; stroke-width: 2; } .sl-max { stroke: #6d28d9; stroke-dasharray: 6 4; stroke-width: 1.5; }
.sl-area { fill: #ede9fe; stroke: #6d28d9; stroke-width: 2; }
.sl-t { font: 12.5px system-ui; fill: #545b64; } .sl-t.b { font-weight: 600; fill: #16191f; }
.ag { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr); gap: 12px; align-items: center; }
.ag-reg { position: relative; border: 2px dashed #545b64; border-radius: 12px; padding: 26px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.ag-reg > small { position: absolute; top: 5px; left: 12px; font: 600 12.5px var(--mono); color: var(--sv-ink2); }
.ag-reg.pri { border-color: #6d28d9; background: #faf7ff; }
.ag-vol { font-size: 12.5px; background: #ede9fe; border-radius: 6px; padding: 4px 8px; }
.ag-arrows { font-size: 13px; color: #6d28d9; font-weight: 600; max-width: 12em; text-align: center; }
.ag-secs { display: flex; flex-direction: column; gap: 10px; }
.ag-ops { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }

/* ElastiCache. */
.ecx { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; background: #fff; border: 1px solid var(--sv-line); border-radius: 10px; padding: 10px 12px; }
.ecx span { color: var(--sv-ink2); font-size: 13px; }
.cs { display: flex; flex-direction: column; gap: 12px; }
.cs .json { font-size: 12.5px; }
.cs-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-pc > div { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.cs-pc .pro { border-left: 4px solid var(--ok); } .cs-pc .con { border-left: 4px solid var(--no); }

/* RPO and RTO. */
.rr2 { width: 100%; height: auto; }
.rt-axis { stroke: #545b64; stroke-width: 2; }
.rt-rpo { fill: #fde68a; } .rt-rto { fill: #fecaca; }
.rt-m { stroke: #545b64; stroke-width: 2; } .rt-m.fail { stroke: var(--no); stroke-width: 3; }
.rt-t { font: 13px system-ui; fill: #545b64; } .rt-t.fail { fill: var(--no); font-weight: 700; }
.rt-b { font: 700 16px system-ui; fill: #16191f; }

@media (max-width: 860px) {
  .hws, .vpc-row, .ha-row, .ha-row.three, .rr, .rr-row, .ia, .sec, .ag, .au-cols, .enc, .cs-pc { grid-template-columns: 1fr; }
  .pe { grid-template-columns: 1fr; }
  .tbl { font-size: 13px; }
}
.fo tr > :nth-child(-n+2) { white-space: nowrap; }
