html {
  color-scheme: only light;
  --indigo: #160c79;
  --link-blue: #0000ee;
  --visited-purple: #551a8b;
  color: #000;
  background: #f4f4f4;
}
body {
  max-width: 954px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  color: #000;
  background: #fff;
  font-family: "Times New Roman", Times, serif;
  overflow-wrap: anywhere;
}
a:link { color: var(--link-blue); }
a:visited { color: var(--visited-purple); }
main, .crumbs, footer, .doc, .references, math { color: #000; }
input, textarea, select { color: #000; background-color: #fff; }
button, ::file-selector-button, .upload-picker label { color: #000; background-color: #f4f4f4; }
::selection { color: #fff; background: #173f8f; }
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 46px;
  background: #08243b url("/ocean.webp") center 69% / cover no-repeat;
}
header > a { min-width: 0; align-self: end; }
header img { display: block; }
header nav { background: #071c32; padding: 1px 5px; white-space: nowrap; font-size: .75rem; color: white; }
header nav a:any-link { color: #fff; }
img, input, textarea { max-width: 100%; box-sizing: border-box; }
img { height: auto; }
.crumbs { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; padding: 7px 5px 4px; font-size: .8125rem; line-height: 18px; }
.account { position: relative; flex: none; }
.account summary { cursor: pointer; color: var(--link-blue); text-decoration: underline; }
.license { white-space: pre-wrap; margin-inline: 5px; }
hr, footer {
  background: repeating-linear-gradient(130deg, #f7f7f7 0 2px, #e8e8e8 2px 3px, #f5f5f5 3px 4px);
}
hr { height: 8px; margin: 0; border: 0; }
main { flex: 1; min-width: 0; }
main > :is(p, form, time, article), .login { margin-inline: 5px; }
.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 .75em;
  margin: 0 0 9px;
  padding: 10px;
  border-left: 14px solid var(--indigo);
  border-bottom: 1px solid var(--indigo);
}
.bar h1 { margin: 0; font-size: 1.375rem; line-height: 1.14; }
.index { width: 100%; table-layout: fixed; border-collapse: collapse; }
.index col:first-child { width: 20%; }
.index th, .index td { padding: 5px; border: 1px solid #aaa; }
.index :is(th, td):first-child { border-right-color: #333; }
.index th { box-sizing: border-box; height: 31px; font-weight: normal; }
.index td { vertical-align: middle; line-height: 1.3; }
.directory td { box-sizing: border-box; height: 85px; }
.directory td:first-child { vertical-align: top; }
.shortcut { margin: 1em 0 0; text-align: right; }
.desc { white-space: pre-wrap; }
footer {
  box-sizing: border-box;
  min-height: 82px;
  margin-top: 1em;
  padding: 10px 18px 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 1px dotted #888;
  font-size: .75rem;
}
footer nav { display: flex; flex-wrap: wrap; gap: .4em 8em; }
footer nav a:any-link { color: #444; }
footer small { text-align: center; }
@media (max-width: 32rem) {
  .index col:first-child { width: 35%; }
  footer nav { column-gap: 1.25em; }
}

.login-page { display: flex; flex-direction: column; }
.login-box { align-self: center; margin: auto; padding: 1em; border: 1px solid #aaa; }
main > form.login-box { margin-inline: auto; }
.login-box label { display: flex; justify-content: space-between; gap: .75em; margin-bottom: .6em; }
.login-box input { width: 12em; }
.error { color: #b00018; }
.account[open] form { position: absolute; right: 0; z-index: 1; }
.account button { white-space: nowrap; }
.task-list { overflow-x: auto; }
.task-list table { width: 100%; border-collapse: collapse; }
.task-list th, .task-list td { border: 1px solid #aaa; padding: .35em; text-align: left; }
.task-list form { display: inline; }
.high, .overdue { background: #ffc5c5; color: #6c0909; }
.mid, .soon { background: #ffe68a; color: #442f00; }
.low { background: #c6eabd; color: #193e14; }
.guest-home p, .login-box { font-family: Arial, sans-serif; }
.login-link { white-space: nowrap; }

.doc { margin-inline: 5px; }
.doc pre, [data-equation="block"] { overflow-x: auto; }
.doc table { border-collapse: collapse; }
.doc th, .doc td { border: 1px solid #aaa; padding: .25em; }

#md-preview { margin: .5rem 5px 1rem; }
#md-preview summary { cursor: pointer; }
#md-preview[open] article { padding: 0 .75rem; border-inline-start: 2px solid var(--indigo); }
.doc, #body { line-height: 1.55; line-break: auto; }
#body { font-family: ui-monospace, monospace; }

.references { margin: 1.5rem 5px 1rem; }
.references h2 { font-size: 1.125rem; margin-bottom: .35rem; }
.references ol { margin-top: .35rem; padding-inline-start: 2rem; }
.references li { margin: .2rem 0; overflow-wrap: anywhere; }

/* Match the original serif page and compact, native-style form controls. */
body, main, main :is(h1,h2,h3,p,label,a), .crumbs, footer {
  font-family: "Times New Roman", Times, serif;
}
button, ::file-selector-button, .upload-picker label {
  appearance: none;
  font: 400 0.833333rem/1.25 Arial, Helvetica, sans-serif;
  color: #000;
  background: #e9e9ed;
  border: 1px solid #808087;
  border-radius: 4px;
  padding: 2px 6px;
}
button:enabled:active { background: #d8d8df; }
button:disabled { color: #67676d; }

.image-uploads { margin: 1em 0; }
.image-uploads small { display: block; }
.upload-picker { position: relative; display: inline-block; margin: .2em 0; }
.upload-picker label { display: inline-block; cursor: pointer; }
.upload-picker input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
.upload-picker:focus-within label { outline: 2px solid Highlight; outline-offset: 2px; }
.image-rows { display: grid; gap: .3em; }
.image-row { display: grid; grid-template-columns: minmax(7em, 13em) auto auto; justify-content: start; align-items: center; gap: .25em .65em; }
.image-row label { display: flex; align-items: center; gap: .3em; }
.image-row input { width: 10em; min-width: 0; }
@media (max-width: 40rem) {
  .image-row { grid-template-columns: 1fr; margin-block: .3em; }
}

/* I²C pull-up calculator */
.i2c { margin-inline: 5px; }
.i2c .tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
  align-items: start;
  gap: 1rem;
}
.i2c .diagram svg { display: block; width: 100%; height: auto; }
.i2c .powerwire, .i2c .rail {
  fill: none;
  stroke: #111;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: round;
}
.i2c .diagramtype, .i2c .devicetext { font: 17px Arial, sans-serif; fill: #111; }
.i2c h2 { font-size: 1.125rem; margin: 0 0 .35rem; }
.i2c .figures p { margin: .65em 0; }
.i2c .equations { display: flex; flex-wrap: wrap; gap: .75em 1.5em; }
.i2c .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; }
.i2c .frac > span { padding: .1em .25em; }
.i2c .frac > :first-child { border-bottom: 1px solid #555; }

.i2c .work { background: #eee; padding: .65em; }
.i2c .work form { border: 1px solid #aaa; padding: .65em; }
.i2c fieldset { padding: 0; border: 0; margin: 0 0 .75em; min-width: 0; }
.i2c legend { padding: 0; margin-bottom: .25em; }
.i2c .modes { border: 1px solid #aaa; }
.i2c .modes label {
  display: grid;
  grid-template-columns: 1.75em minmax(0, 1fr);
  align-items: stretch;
  cursor: pointer;
}
.i2c .modes label + label { border-top: 1px solid #aaa; }
.i2c .modes input { place-self: center; margin: 0; accent-color: var(--indigo); }
.i2c .mode-text {
  border-left: 1px solid #333;
  padding: 5px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25em;
}
.i2c .mode-text small { white-space: nowrap; }
.i2c .field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(3.5em, .7fr) 1.15em;
  gap: .35em;
  align-items: baseline;
  margin: .45em 0;
}
.i2c .field :is(input, select) { min-width: 0; width: 100%; }
.i2c .field input { text-align: right; }
.i2c .results { margin-top: .85rem; }
.i2c .section-heading { display: flex; gap: .35em .75em; flex-wrap: wrap; justify-content: space-between; }
.i2c .index tbody th { text-align: left; }
.i2c .results th { width: 65%; }
.i2c .results td { text-align: right; white-space: nowrap; }
.i2c .selected td, .i2c .power td { font-weight: bold; }
.i2c #message { margin: .35em 0; }

@media (max-width: 700px) {
  .i2c .tool-layout { grid-template-columns: 1fr; }
  .i2c .work { grid-row: 1; }
}
