/* Amazon DynamoDB and Choosing a Database: the figures on its slides.
   Terminals, JSON and the shared colours are in ../iam.css. */

:root { --ddb: #2e27ad; --ddb-soft: #f1f0fd; --ok: #1d8102; --no: #d13212; --hot: #d13212; }

.ic { width: 34px; height: 34px; flex: none; vertical-align: middle; }
.ic.sm { width: 20px; height: 20px; }
.cap { display: block; font-size: 13px; color: var(--sv-ink2); margin: 4px 0; }
.sv-fig { overflow: auto; }

[data-sec="intro"] { --sec: #334155; }
[data-sec="keys"] { --sec: #2e27ad; }
[data-sec="indexes"] { --sec: #7c3aed; }
[data-sec="capacity"] { --sec: #b45309; }
[data-sec="speed"] { --sec: #0369a1; }
[data-sec="resilience"] { --sec: #3f6212; }
[data-sec="choose"] { --sec: #be123c; }

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

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

/* Rows of items: a grid table. */
.rows { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; overflow: hidden; font-size: 13.5px; }
.rw { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 8px; padding: 5px 10px; border-top: 1px solid #eef0f3; }
.rows .rw { --n: 4; } .rows .rw:has(> span:nth-child(3):last-child) { --n: 3; }
.rh { border-top: 0; background: #f6f7f9; font-size: 12px; font-weight: 700; color: var(--sv-ink2); }
.rh em { font-style: normal; font-weight: 600; color: var(--ddb); font-size: 11px; margin-left: 4px; }
.rw code { font: 600 13px var(--mono); }
.rw i { color: var(--sv-ink2); }
.keycol .rw > span:first-child { color: var(--ddb); }
.two .rw > span:nth-child(-n+2) { color: var(--ddb); }
.rw.q { background: #fff3c4; box-shadow: inset 4px 0 0 #f2b705; }
.rw.q2 { background: #f6f1ff; }

/* The introduction. */
.dd { display: grid; grid-template-columns: minmax(0, .8fr) auto minmax(0, 2fr); gap: 12px; align-items: center; }
.dd-app { background: #fff; border: 1px solid var(--sv-line); border-radius: 10px; padding: 12px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; text-align: center; }
.dd-app b, .dd-app small { flex-basis: 100%; } .dd-app small { color: var(--sv-ink2); font-size: 12.5px; }
.dd-arrow { display: flex; flex-direction: column; align-items: center; font-size: 12.5px; color: var(--sv-ink2); text-align: center; }
.dd-arrow i { font-style: normal; font-size: 28px; color: var(--ddb); line-height: 1; }
.dd-arrow code { font: 11.5px var(--mono); }
.dd-region { position: relative; border: 2px solid #0972d3; border-radius: 12px; padding: 26px 12px 12px; display: flex; flex-direction: column; gap: 10px; background: #fbfcfd; }
.dd-region > small:first-child { position: absolute; top: 5px; left: 12px; font-size: 12.5px; font-weight: 700; color: #0972d3; }
.dd-ep code { font: 600 13px var(--mono); background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 3px 8px; }
.dd-table { display: flex; align-items: center; gap: 8px; }
.dd-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dp { background: var(--ddb-soft); border: 2px solid var(--ddb); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.dp-c { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.dp-c span { background: #fff; border: 1px dashed #0972d3; border-radius: 4px; padding: 1px 6px; font-size: 12px; color: #0972d3; }
.dd-copy { color: var(--sv-ink2); font-size: 12.5px; }

.vr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.vr-c { background: #fff; border: 2px solid var(--c); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vr-c > b { display: flex; align-items: center; gap: 8px; }
.vr-c.rds { --c: #2563eb; } .vr-c.ddb { --c: var(--ddb); }
.vr-c small { color: var(--sv-ink2); font-size: 12.5px; }
.mini { margin: 0; font: 12px/1.45 var(--mono); background: #f6f7f9; border-radius: 6px; padding: 6px 8px; overflow: auto; }
.mini.sql { background: #eef4ff; }
.vr-c .json { font-size: 12px; margin: 0; }
.tbl.vrt { width: 100%; }

/* Items. */
.it { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.it .json { font-size: 12px; }

/* Partition key. */
.pkd, .hpd, .odd, .ttd, .gtd, .bkd, .ned, .tsd { width: 100%; max-height: 100%; }
.pk-w { fill: #fff; stroke: var(--ddb); stroke-width: 2; } .pk-wt { font: 600 14px var(--mono); }
.pk-h { fill: #232f3e; } .pk-ht { fill: #fff; font: 600 13px var(--mono); }
.pk-a { fill: none; stroke: #545b64; stroke-width: 2; } .pk-a.hot { stroke: var(--ddb); stroke-width: 3; }
.pk-p { fill: #f6f7f9; stroke: #8a8f96; stroke-width: 1.6; } .pk-p.hit { fill: var(--ddb-soft); stroke: var(--ddb); stroke-width: 2.6; }
.pk-pt { font-size: 14px; font-weight: 700; } .pk-r { font: 11px var(--mono); fill: #545b64; }
.pk-i { fill: #fff; stroke: #c6ccd2; } .pk-i.new { fill: #fff3c4; stroke: #f2b705; stroke-width: 2; }
.pk-it { font: 12.5px var(--mono); } .pk-g { font-size: 13px; font-weight: 600; fill: var(--ddb); }

/* Sort key. */
.sk { display: flex; flex-direction: column; gap: 10px; }
.sk-coll { border: 2px solid var(--ddb); border-radius: 10px; padding: 6px; background: var(--ddb-soft); }
.sk-coll > small, .sk-other > small { display: block; font-size: 12.5px; font-weight: 600; color: var(--ddb); margin: 0 4px 4px; }
.sk-other { border: 1px dashed #8a8f96; border-radius: 10px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sk-other > small { flex-basis: 100%; color: var(--sv-ink2); margin: 0; }
.sk-other code, .sk-q code { font: 12.5px var(--mono); }
.sk-q { background: #fff; border-left: 5px solid #f2b705; border-radius: 6px; padding: 6px 10px; font-size: 14px; }

/* Hot partitions. */
.hp-t { font-size: 13.5px; font-weight: 700; } .hp-lim { stroke: var(--hot); stroke-width: 2; stroke-dasharray: 6 4; }
.hp-l { font-size: 11.5px; fill: #545b64; } .hp-v { font: 600 11.5px var(--mono); } .hp-v.in { fill: #fff; }
.hp-b { fill: var(--ddb); opacity: .8; } .hp-b.over { fill: var(--hot); }
.hp-x { fill: #fff8f6; stroke: var(--hot); } .hp-xt { font-size: 12px; font-weight: 700; fill: var(--hot); }
.hp-ax { stroke: #c6ccd2; stroke-width: 1.5; }

/* Query and Scan. */
.qsw { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qs { background: #fff; border: 1px solid var(--sv-line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qc { font: 11.5px var(--mono); color: var(--sv-ink2); overflow-wrap: anywhere; }
.qg { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; }
.qg i { aspect-ratio: 1; border-radius: 2px; background: #eef0f3; }
.qg i.x { background: #c9c6f3; } .qg i.r { background: #f2b705; }
.qn { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; }
.qn .cu b { color: var(--ddb); font-size: 17px; }

/* Indexes. */
.ix { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.ix-arrow { display: flex; flex-direction: column; align-items: center; font-size: 26px; color: #7c3aed; text-align: center; }
.ix-arrow span { font-size: 12px; color: var(--sv-ink2); max-width: 9em; }
.ix-q { display: block; margin-top: 8px; font: 11.5px var(--mono); color: var(--sv-ink2); overflow-wrap: anywhere; }
.tbl.ict td:nth-child(2) { background: #f6f1ff; }

/* Units. */
.tbl.ut td:nth-child(3) b { color: var(--ddb); white-space: nowrap; }
.ub { display: inline-flex; gap: 3px; }
.ub i, .ul i { display: inline-block; width: 22px; height: 14px; border-radius: 3px; }
.ub i.r, .ul i.r { background: var(--ddb); } .ub i.r.half { background: linear-gradient(90deg, var(--ddb) 50%, #dcdaf7 50%); }
.ub i.w, .ul i.w { background: #b45309; width: 12px; }
.ul { display: flex; gap: 20px; margin-top: 10px; font-size: 13px; color: var(--sv-ink2); }
.ul span { display: flex; align-items: center; gap: 6px; }

/* Capacity charts. */
.b-t { font-size: 14px; font-weight: 600; fill: #16191f; }
.b-axis { stroke: #c6ccd2; stroke-width: 1.5; }
.b-l { font-size: 12.5px; fill: #545b64; }
.b-l.od { fill: #b45309; font-weight: 600; } .b-l.thr { fill: var(--hot); font-weight: 700; }
.od-b { fill: #f0b878; }
.pv-b { fill: #9fc3e6; } .pv-x { fill: var(--hot); } .pv-line { fill: none; stroke: #0369a1; stroke-width: 2.5; }
.price { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; font-size: 14px; }
.price span { background: #fff; border: 1px solid var(--sv-line); border-radius: 8px; padding: 4px 10px; }
.cc { display: flex; flex-direction: column; gap: 12px; }
.cc-w { background: #fff; border: 1px solid var(--sv-line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.cc-r { display: grid; grid-template-columns: 15em minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; }
.cb { display: flex; align-items: center; gap: 8px; } .cb span { height: 18px; border-radius: 4px; }
.cb.od span { background: #f0b878; } .cb.pv span { background: #0369a1; }
.cc-m { color: var(--sv-ink2); font-size: 12px; }
.cc .term { font-size: 12px; white-space: pre-wrap; }

/* DAX. */
.dx { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, .8fr); gap: 12px; align-items: center; }
.dx-vpc { position: relative; border: 2px solid #7d3c98; border-radius: 12px; padding: 26px 12px 12px; display: grid; grid-template-columns: 1fr auto 1.2fr; gap: 10px; align-items: center; }
.dx-vpc > small { position: absolute; top: 5px; left: 12px; font-size: 12.5px; font-weight: 700; color: #7d3c98; }
.dx-app, .dx-t { background: #fff; border: 1px solid var(--sv-line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 14px; }
.dx-t { border: 2px solid var(--ddb); background: var(--ddb-soft); }
.dx-cl { background: var(--ddb-soft); border: 2px solid var(--ddb); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.dx-cl .cache { background: #fff; border: 1px solid var(--ddb); border-radius: 6px; padding: 2px 10px; font-size: 13px; }
.dx-cl small { font-size: 12px; color: var(--sv-ink2); }
.dx-paths { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; text-align: center; }
.dx-paths .hit { color: var(--ok); font-weight: 600; } .dx-paths .miss { color: #b45309; font-weight: 600; } .dx-paths .strong { color: var(--sv-ink2); }

/* Streams and TTL. */
.st { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.st-w { display: flex; flex-direction: column; gap: 4px; }
.sw { font-size: 13px; background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 3px 8px; }
.sw code { font: 700 12px var(--mono); } .sw.insert code { color: var(--ok); } .sw.modify code { color: #0369a1; } .sw.remove code { color: var(--no); }
.st-ar { font-style: normal; font-size: 24px; color: var(--sv-ink2); }
.st-s, .st-r { background: #fff; border: 2px solid var(--c); border-radius: 10px; padding: 10px; display: flex; align-items: center; gap: 8px; max-width: 16em; font-size: 14px; }
.st-s { --c: var(--ddb); } .st-r { --c: #ed7100; }
.json .hl.k { --c: #eaf4fb; --cc: #0369a1; }
.tt-w { fill: var(--ddb); } .tt-e { stroke: #b45309; stroke-width: 2.5; } .b-l.exp { fill: #b45309; font-weight: 600; }
.tt-win { fill: #fff3c4; stroke: #f2b705; } .tt-d { fill: var(--no); } .b-l.del { fill: var(--no); font-weight: 700; font-family: var(--mono); }

/* Global tables and backups. */
.gt-r { fill: var(--ddb-soft); stroke: var(--ddb); stroke-width: 2; } .gt-n { font: 700 14px var(--mono); }
.gt-a { stroke: var(--ddb); stroke-width: 2.5; stroke-dasharray: 8 5; fill: none; } .b-l.gt { fill: var(--ddb); font-weight: 600; }
.bk-p { fill: #e7f1dc; stroke: #3f6212; } .bk-m { stroke: var(--no); stroke-width: 3; } .b-l.bad { fill: var(--no); font-weight: 600; }
.bk-a { fill: none; stroke: #3f6212; stroke-width: 2.5; } .bk-n { fill: #fff; stroke: #3f6212; stroke-width: 2; } .b-l.nt { fill: #3f6212; font-weight: 700; }
.bk-o { fill: #fff; stroke: #8a8f96; }

/* Purpose-built databases. */
.pb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pb-c { background: #fff; border: 1px solid var(--sv-line); border-left: 5px solid #be123c; border-radius: 8px; padding: 8px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
.pb-c .ic { grid-row: 1 / 4; }
.pb-c span { font-size: 13px; } .pb-c small { font-size: 12.5px; color: var(--sv-ink2); }
.pb-c.known { border-left-color: #8a8f96; opacity: .75; }
.dbh { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 10px; }
.dbh .ic { width: 44px; height: 44px; }
.dbq { display: block; font: 13px var(--mono); background: #fff; border: 1px solid var(--sv-line); border-left: 5px solid #be123c; border-radius: 6px; padding: 6px 10px; margin: 8px 0; overflow-wrap: anywhere; }
.rs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rs small { display: block; font-size: 13px; color: var(--sv-ink2); margin-bottom: 6px; }
.rs-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.rs-g i { height: 24px; border-radius: 3px; background: #eef0f3; } .rs-g i.on { background: #be123c; opacity: .75; }
.docs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .docs .json { font-size: 12px; margin: 0; }
.nn.p { fill: #fff; stroke: #be123c; stroke-width: 2.5; } .nn.pr { fill: #f6f7f9; stroke: #545b64; stroke-width: 2; } .nn.hit { fill: #fff3c4; stroke: #f2b705; stroke-width: 3; }
.nt { font-size: 13px; font-weight: 700; } .ne { stroke: #aab3bd; stroke-width: 2; } .ne.on { stroke: #be123c; stroke-width: 2.5; }
.nl { font-size: 12px; fill: #545b64; font-style: italic; } .nl.q { font-style: normal; font-weight: 600; fill: #16191f; font-size: 13.5px; }
.ts-p { fill: #9fc3e6; } .ts-a { fill: none; stroke: #be123c; stroke-width: 3; } .b-l.ts { fill: #be123c; font-weight: 600; }
.os { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.os-d { background: #fff; border: 1px solid var(--sv-line); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; font-size: 13.5px; }
.os-d b { color: #be123c; margin-right: 6px; }
.os-s { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; background: #fff3c4; border-radius: 8px; padding: 6px 12px; font-size: 14px; }
.tbl.wd i { font-style: normal; color: var(--sv-ink2); } .tbl.wd { width: 100%; }

@media (max-width: 860px) {
  .pe, .dd, .vr, .it, .qsw, .ix, .dx, .dx-vpc, .pb, .os, .docs, .rs { grid-template-columns: 1fr; }
  .dd-arrow i, .ix-arrow { transform: rotate(90deg); }
  .cc-r { grid-template-columns: 1fr; }
  .tbl { font-size: 13px; display: block; overflow-x: auto; }
}
