/* Small Town Hosting client area.

   The look: a sheet of laid paper on a walnut desk, laid out the way a
   Georgian printer laid out a page: a name at its head, swelled rules, a
   ledger for every table, black ink with a little red.

   The rule for type: serifs are for what you look at, the sans is for what
   you read and use. Titles and section headings are Caslon. Everything else
   (text, labels, fields, tables, buttons) is Source Sans, upright, in dark
   ink, at a size you don't have to lean in for. No small capitals, italics or
   typewriter faces for anything you have to read: the first paper version had
   all three, and it was hard to read.

   One look, on purpose: there is no dark variant, because the paper is the
   point. Hand-written, no build step. The Content-Security-Policy forbids
   inline styles, so everything is a class; fonts and images are served from
   here. */

/* ---------------------------------------------------------------- the types */

@font-face { font-family: "Source Sans 3"; font-weight: 200 900; font-style: normal; font-display: swap;
  src: url("../fonts/source-sans-3.woff2?v=114a0e5e16") format("woff2"); }
@font-face { font-family: "Source Code Pro"; font-weight: 200 900; font-style: normal; font-display: swap;
  src: url("../fonts/source-code-pro.woff2?v=961f57843c") format("woff2"); }
@font-face { font-family: "Caslon Text"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/caslon-text-400.woff2?v=ce4653dcbd") format("woff2"); }
@font-face { font-family: "Caslon Text"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/caslon-text-700.woff2?v=3ddbe22355") format("woff2"); }
@font-face { font-family: "Fell Capitals"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/fell-english-sc-400.woff2?v=24a39d95cd") format("woff2"); }
@font-face { font-family: "Pinyon Script"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/pinyon-script-400.woff2?v=880fd56217") format("woff2"); }

:root {
  color-scheme: light;

  /* Paper */
  --paper: #f6f0df;           /* the sheet */
  --paper-bright: #fffdf6;    /* where you write: fields */
  --paper-shade: #ece3cc;     /* a tint: the fixed ending of a field, a hovered row */

  /* Inks. Every one of them is at least 7:1 against the paper. */
  --ink: #1f1811;             /* iron-gall black */
  --ink-soft: #524638;        /* the same, thinned: secondary text */
  --red: #8a2318;             /* the printer's second colour */
  --red-deep: #6d1a11;
  --blue: #1b3c69;            /* what you can follow */
  --green: #215031;
  --ochre: #6f4708;

  /* Rules */
  --rule: rgba(31, 24, 17, .62);
  --rule-light: rgba(31, 24, 17, .2);
  --rule-faint: rgba(31, 24, 17, .1);

  --desk: #2e2016;
  /* Sepia ink, for the columns of a chart and nothing else: a mark has to be
     seen as a mark, not read as text (ink) or as something to follow (blue). */
  --sepia: #8c531b;

  --sans: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Caslon Text", "Libre Caslon Text", "Big Caslon", "Book Antiqua", Palatino, Georgia, serif;
  --brand: "Fell Capitals", "Caslon Text", Georgia, serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;

  /* How wide a line of reading text may run before it gets hard to follow. */
  --measure: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 1.75rem 1rem 3rem;
  background:
    /* the lamp is over the middle of the desk */
    radial-gradient(ellipse 85% 70% at 50% 28%, rgba(255, 214, 150, .09), transparent 70%),
    var(--desk) url("../img/desk.svg?v=dd4c567c6e") center top / 1000px 640px;
  background-attachment: fixed, scroll;
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  font-synthesis: none;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(138, 35, 24, .2); }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--red); }

h1, h2, h3 { font-weight: 400; margin: 0; }
h1 { font: 400 2.3rem/1.15 var(--serif); letter-spacing: -.012em; overflow-wrap: break-word; }
h2 {
  font: 400 1.4rem/1.25 var(--serif); letter-spacing: -.004em;
  display: flex; align-items: center; gap: 1rem; margin: 0 0 .85rem;
}
/* A heading, then a rule to the edge of the column: the way a printed form does it. */
h2::after { content: ""; flex: 1; min-width: 1rem; border-top: 1px solid var(--rule-light); transform: translateY(.1em); }
h3 { font: 600 1.06rem/1.35 var(--sans); margin: 1.5rem 0 .5rem; }
p { margin: 0 0 .85rem; }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 650; }

code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: rgba(31, 24, 17, .07); padding: .08em .32em; border-radius: 2px; overflow-wrap: anywhere; }

.muted { color: var(--ink-soft); }
.small { font-size: .93rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
/* break-word, not anywhere: "anywhere" lets a table squeeze a column down to
   one letter per line on a phone. This way the table scrolls sideways instead. */
.break { overflow-wrap: break-word; }
.right { text-align: right; }

/* ---------------------------------------------------------------- the sheet */

.sheet {
  position: relative;
  max-width: 1080px; margin: 0 auto;
  padding: 1.5rem 3rem 2.2rem;
  background:
    /* chain lines: the wires of the paper mould, an inch apart */
    repeating-linear-gradient(90deg, transparent 0 95px, rgba(120, 90, 45, .04) 95px 96px),
    /* a little uneven in tone, as a hand-made sheet is */
    radial-gradient(ellipse 60% 40% at 18% 12%, rgba(255, 252, 240, .55), transparent 70%),
    radial-gradient(ellipse 50% 45% at 85% 78%, rgba(206, 178, 122, .12), transparent 70%),
    url("../img/paper.svg?v=bc859b1b6c") 0 0 / 420px 420px,
    var(--paper);
  /* toned at the edges, the way old paper is; then its thickness, then its shadow */
  box-shadow:
    inset 0 0 80px rgba(140, 104, 48, .13),
    inset 0 0 0 1px rgba(255, 252, 240, .5),
    0 0 0 1px rgba(20, 12, 5, .55),
    0 2px 3px rgba(0, 0, 0, .35),
    0 18px 40px -12px rgba(0, 0, 0, .65);
}
/* A full sheet however little is written on it, with its foot at the bottom.
   Every signed-in page is this same sheet, the same width: a page whose
   writing is narrow (a form, a confirmation) keeps its column to the left and
   leaves the rest as margin, as a book does. */
.sheet { display: flex; flex-direction: column; min-height: calc(100vh - 4.75rem); }
.sheet > main { flex: 1; position: relative; }
main.medium > .page-head, main.medium > .card, main.medium > .alert, main.medium > p, main.medium > .btn { max-width: 43rem; }
/* A cut in that margin: the key, on any page about a password. */
.margin-art { position: absolute; right: 1.5rem; top: 2.2rem; width: 15.5rem; transform: rotate(-24deg); transform-origin: center; opacity: .92; pointer-events: none; }
@media (max-width: 66rem) { .margin-art { display: none; } }
.sheet.narrow { display: block; min-height: 0; max-width: 30rem; padding: 2.3rem 2.6rem 2rem; margin-top: 2rem; }

/* The head of the sheet, set as a gazette sets its name: the name across the
   top; under it, between fine rules, the number, the day and the edition; then
   one line saying where you can go and who you are, closed by a Scotch rule
   (thick, then thin). */
.masthead {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 1.6rem;
  padding-bottom: .65rem; margin-bottom: 2.1rem;
  border-bottom: 3px solid var(--ink);
}
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; border-bottom: 1px solid var(--ink); }

/* The one place the old printing type is used: large, and only for the name. */
.brand {
  grid-column: 1 / -1; text-align: center;
  font: 400 1.95rem/1.15 var(--brand); letter-spacing: .15em;
  color: var(--ink); text-decoration: none;
  padding: .1rem 0 .55rem;
}
.brand:hover { color: var(--ink); }

.dateline {
  grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 1rem;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .3rem 0 .26rem; margin-bottom: .6rem;
  font: 600 .7rem/1.3 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--ink-soft);
}
.dateline > :last-child { text-align: right; }

.nav { display: flex; align-items: center; gap: .15rem 1.55rem; flex-wrap: wrap; min-width: 0; }
.nav a {
  font: 600 1rem/1.4 var(--sans);
  color: var(--ink); text-decoration: none; white-space: nowrap;
  padding: .12rem 0 .1rem; border-bottom: 2px solid transparent;
  transition: border-color .15s, color .15s;
}
.nav a:hover { border-bottom-color: var(--rule); color: var(--ink); }
.nav a.active { color: var(--red); border-bottom-color: var(--red); }
.nav .sep { width: 5px; height: 5px; background: var(--ink-soft); transform: rotate(45deg); margin: 0 .05rem; }

.who { display: flex; align-items: center; gap: .85rem; color: var(--ink-soft); font-size: .97rem; }
.who .name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 46rem) {
  body { padding: .6rem .45rem 1.5rem; font-size: 16.5px; }
  .sheet, .sheet.narrow { padding: 1.1rem 1.1rem 1.6rem; }
  .sheet { min-height: calc(100vh - 2.1rem); }
  .sheet.narrow { margin-top: .6rem; min-height: 0; }
  .brand { font-size: 1.3rem; letter-spacing: .1em; padding-bottom: .4rem; }
  .masthead { column-gap: .8rem; margin-bottom: 1.6rem; }
  .dateline { grid-template-columns: 1fr; text-align: center; font-size: .64rem; letter-spacing: .1em; }
  .dateline > :first-child, .dateline > :last-child { display: none; }
  .nav { gap: .1rem 1.05rem; }
  .nav a { font-size: .97rem; }
  .who .name { display: none; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.28rem; }
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: .9rem 1.5rem; flex-wrap: wrap;
  padding-bottom: 1.2rem; margin-bottom: 1.7rem;
  /* a short swelled rule, in red, under the title */
  background: url("../img/rule-swelled-red.svg?v=fe3bbcb7b8") left bottom / 10rem 6px no-repeat;
}
.page-head > div:first-child, .page-head.with-cut > div { min-width: 0; max-width: 100%; }
/* A cut beside the title: the sign for a website, the post for a domain, the letter for email. */
.page-head.with-cut { justify-content: flex-start; align-items: center; gap: 1.1rem; flex-wrap: nowrap; }
.page-head.with-cut > .cut { width: 3.5rem; height: 3.5rem; flex: none; align-self: flex-start; margin-top: .35rem; }
.page-head.with-cut > .cut.wide { width: 6rem; height: 3rem; margin-top: .25rem; }
.page-head.with-cut > div { flex: 1; }
.page-head.with-cut > .btn { align-self: flex-end; }
/* On a phone the title keeps the whole line; a button beside it drops below. */
@media (max-width: 46rem) {
  .page-head.with-cut { flex-wrap: wrap; gap: .5rem .8rem; }
  .page-head.with-cut > .cut { width: 2.3rem; height: 2.3rem; margin-top: .2rem; }
  .page-head.with-cut > .cut.wide { width: 4rem; height: 2rem; }
  .page-head.with-cut > div { flex: 1 1 calc(100% - 3.2rem); }
  .page-head.with-cut > .btn { align-self: auto; }
}
.page-head .sub { color: var(--ink-soft); font-size: 1.08rem; line-height: 1.45; margin-top: .4rem; max-width: var(--measure); }
.crumbs { font-size: .93rem; color: var(--ink-soft); margin-bottom: .45rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--red); }

/* A section of the page. Not a box: sections follow one another down the
   sheet, each opened by its heading and rule. */
.card { margin: 0 0 2.3rem; }
.card > :last-child { margin-bottom: 0; }
.card > p, .card > details > p { max-width: var(--measure); }
.card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .85rem; }
.card-head h2 { flex: 1; margin: 0; }
.card.flush > .pad { padding-top: .85rem; }
.card.flush > .pad > p { max-width: var(--measure); }
/* A quiet line under a table or a form: when it was read, what it means. */
.note { color: var(--ink-soft); font-size: .93rem; margin-top: .6rem; max-width: var(--measure); }

/* Two or three columns with a rule between, like the page of a gazette. */
.grid { display: grid; grid-template-columns: 1fr; column-gap: 3.4rem; position: relative; }
/* Without this a column grows to fit its widest unbreakable thing and runs off the sheet. */
.grid > * { min-width: 0; }
@media (min-width: 54rem) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: 1fr 1fr 1fr; column-gap: 2.8rem; }
  .grid.two::before, .grid.three::before, .grid.three::after {
    content: ""; position: absolute; top: .35rem; bottom: 2.4rem; border-left: 1px solid var(--rule-light);
  }
  .grid.two::before { left: 50%; }
  .grid.three::before { left: calc(33.333% - .47rem); }
  .grid.three::after { left: calc(66.666% + .47rem); }
}

.stack > * + * { margin-top: .7rem; }
.row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.row > input[type], .row > select { width: auto; flex: 1 1 13rem; }
form + p, form + .small, form + .note { margin-top: 1rem; }
p + form, p + .field { margin-top: 1.1rem; }
.spread { display: flex; gap: .75rem 1.2rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.spread > h2 { flex: 1; }

.empty { color: var(--ink-soft); }

/* The head of a column on the overview: its cut, a small label, a rule. Small
   on purpose, so the client's name above stays the title. */
h2.col-head {
  font: 700 .78rem/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  gap: .6rem; margin-bottom: .7rem;
}
h2.col-head .cut { width: 2rem; height: 2rem; flex: none; }
h2.col-head::after { transform: none; }

/* The last few lines of the ledger, under the overview. */
.lately { margin-top: .6rem; }
.lately .list li { gap: 1.2rem; padding: .3rem 0; }
.lately .when { flex: 0 0 9.5rem; color: var(--ink-soft); font-size: .95rem; font-variant-numeric: tabular-nums; }
.lately .what { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 46rem) { .lately .list li { display: block; } .lately .when { display: block; font-size: .88rem; } }

/* The name of a client, over their three columns. */
.client-name {
  font: 400 1.7rem/1.2 var(--serif); letter-spacing: -.008em; margin: 0 0 1.1rem;
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
}
.client-name a { font: 400 .95rem var(--sans); letter-spacing: 0; }

/* ---------------------------------------------------------------- lists and ledgers */

/* An entry, a row of dots, and what it comes to: a table of contents. */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: baseline; gap: .65rem; padding: .36rem 0; }
.list li > div:first-child { min-width: 0; }
.list .title { font-weight: 600; font-size: 1.04rem; overflow-wrap: break-word; }
.list div.title { color: var(--ink); }
.list .meta { color: var(--ink-soft); font-size: .93rem; overflow-wrap: break-word; }
.list .leader { flex: 1; min-width: 1.2rem; border-bottom: 2px dotted var(--rule-light); transform: translateY(-.3em); }
.list li.empty { display: block; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap td.addr { white-space: nowrap; }
table { border-collapse: collapse; width: 100%; font-size: .98rem; font-variant-numeric: lining-nums tabular-nums; }
th, td { text-align: left; padding: .62rem 1.1rem .56rem 0; vertical-align: baseline; }
th:last-child, td:last-child { padding-right: 0; }
/* Column heads: small, capitals, well spaced. Short words, so capitals read fine. */
thead th {
  font: 700 .74rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-soft);
  border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink);
  padding-top: .5rem; padding-bottom: .42rem;
}
tbody td { border-bottom: 1px solid var(--rule-light); }
tbody tr:last-child td { border-bottom: 1px solid var(--ink); }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
td.actions > * + * { margin-left: .9rem; }
/* On a phone a ledger with long entries is set as a list instead: each row a
   block of its own, each entry under its column's small heading (data-label),
   what you can press along the bottom. Nothing is squeezed, nothing runs off
   the edge of the sheet. */
@media (max-width: 46rem) {
  table.stacked { border-top: 1px solid var(--ink); }
  table.stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stacked, table.stacked tbody, table.stacked tr, table.stacked td { display: block; width: auto; }
  table.stacked tr { padding: .75rem 0 .8rem; border-bottom: 1px solid var(--rule-light); }
  table.stacked tr:last-child { border-bottom: 1px solid var(--ink); }
  table.stacked td, table.stacked tbody tr:last-child td { padding: 0; border: 0; white-space: normal; text-align: left; overflow-wrap: anywhere; }
  table.stacked td[data-label]::before {
    content: attr(data-label); display: block; margin-top: .5rem;
    font: 700 .72rem/1.5 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
  }
  table.stacked td.actions { margin-top: .6rem; }
  table.stacked td.actions:empty { display: none; }
  table.stacked td.actions > .btn, table.stacked td.actions > form { display: inline-block; margin: 0 1.1rem 0 0; }
}
/* ---------------------------------------------------------------- figures and small charts */

h3.over { font: 700 .74rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 1.3rem 0 .5rem; }
/* The week in a handful of figures: a plain word over a plain number. */
dl.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .9rem 1.8rem; margin: 0 0 .4rem; }
dl.tiles > div { border-top: 1px solid var(--ink); padding-top: .45rem; }
dl.tiles dt { font: 400 .93rem/1.3 var(--sans); color: var(--ink-soft); }
dl.tiles dd { margin: .1rem 0 0; font: 600 1.85rem/1.15 var(--sans); color: var(--ink); }
/* Three small charts side by side, one measure each: nothing shares a scale it shouldn't. */
/* Each chart is two rows of the same grid, caption and plot, so the plots
   start on one line however many lines a caption runs to. */
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.2rem; margin: 0 0 .2rem; }
@media (max-width: 58rem) { .charts { grid-template-columns: minmax(0, 1fr); max-width: 30rem; } }
figure.chart { margin: 0 0 1.2rem; min-width: 0; display: grid; grid-row: span 2; grid-template-rows: subgrid; }
figure.chart figcaption { margin-bottom: .45rem; }
figure.chart figcaption span.muted { margin-left: .3rem; font-size: .93rem; }
figure.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
figure.chart svg:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
figure.chart .grid { stroke: var(--rule-light); stroke-width: 1; vector-effect: non-scaling-stroke; }
figure.chart .tick { font: 400 10.5px var(--sans); fill: var(--ink-soft); font-variant-numeric: tabular-nums; }
figure.chart .peak { font: 600 10.5px var(--sans); fill: var(--ink); }
figure.chart .hit { fill: transparent; }
figure.chart .bar { fill: var(--sepia); }
figure.chart .day:hover .bar, figure.chart .day.is-pointed .bar { fill: var(--ink); }
/* What a column stands for, shown where the pointer (or the arrow keys) put it. */
.chart-tip { position: absolute; z-index: 20; pointer-events: none; transform: translate(-50%, calc(-100% - 6px)); white-space: nowrap;
  background: var(--ink); color: var(--paper-bright); padding: .22rem .6rem .26rem; border-radius: 2px; font: 400 .9rem/1.35 var(--sans);
  box-shadow: 0 1px 3px rgba(31, 24, 17, .4); }
.chart-tip strong { font-weight: 700; margin-right: .45rem; }
details.figures { margin: .2rem 0 .6rem; }
table.numbers td:not(:first-child), table.numbers th:not(:first-child) { text-align: right; }
details.keeping { margin-top: 1rem; padding-top: .7rem; border-top: 1px solid var(--rule-light); }
details.keeping form.row { align-items: baseline; gap: .4rem .7rem; }
/* One row of things to narrow a list by, above the list. */
form.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .2rem 1.2rem; margin: 0 0 1.2rem; }
form.filters .field { margin-bottom: .6rem; min-width: 14rem; }
form.filters .field:nth-child(2) { flex: 1 1 16rem; max-width: 26rem; }
form.filters .btn { margin-bottom: .6rem; }
table.post-book td { vertical-align: top; }
/* Columns of a set width, so an address keeps to one line and a long reason
   from the other side's server wraps instead of squeezing the addresses. */
@media (min-width: 46.01rem) {
  table.post-book { table-layout: fixed; }
  table.post-book th:nth-child(1) { width: 9.8rem; }
  table.post-book th:nth-child(2), table.post-book th:nth-child(3) { width: 28.5%; }
}

/* One quiet line saying a check came out well, with the means to ask again. */
.checked-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .7rem; margin: -.6rem 0 1.5rem; font-size: .97rem; }
/* Things to do, in order: numbered as a printer numbers them. */
ol.steps { margin: .9rem 0 1.1rem; padding: 0; list-style: none; counter-reset: step; max-width: var(--measure); }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 .7rem 2.3rem; }
ol.steps > li::before { content: counter(step) "."; position: absolute; left: 0; top: -.12rem; font: 400 1.35rem/1.4 var(--serif); color: var(--red); }
ul.copy-list { list-style: none; margin: .5rem 0 0; padding: .45rem .9rem; border-left: 2px solid var(--rule); }
ul.copy-list li { display: flex; align-items: baseline; gap: .9rem; padding: .12rem 0; }
ul.copy-list .mono { min-width: 9.5rem; }
/* The record check: what a record should say is long and typed, so it gets the room. */
table.dns-check td { vertical-align: top; }
table.dns-check td:first-child { min-width: 11rem; }
table.dns-check td.value { min-width: 14rem; max-width: 24rem; }
table.dns-check .badge + .small { margin-top: .3rem; }
td.value { min-width: 12rem; max-width: 27rem; overflow-wrap: anywhere; font-family: var(--mono); font-size: .9rem; line-height: 1.5; }
td .sub { display: block; color: var(--ink-soft); font-size: .9rem; }

table.dense { font-size: .95rem; }
table.dense td { padding-top: .5rem; padding-bottom: .44rem; }
td .code { display: block; font: 400 .8rem/1.45 var(--mono); color: var(--ink-soft); margin-top: .12rem; }

dl.kv { display: grid; grid-template-columns: minmax(8.5rem, max-content) 1fr; gap: .5rem 1.6rem; margin: 0 0 .9rem; }
dl.kv:last-child { margin-bottom: 0; }
dl.kv dt { font-weight: 600; color: var(--ink-soft); }
/* min-width and "anywhere": a long server name must break rather than push its
   column, and everything in it, off the edge of a phone. */
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Where the values are long (a server's name, a key's username), a phone
   gives each one the whole line, under its label. */
@media (max-width: 34rem) {
  dl.kv.roomy { grid-template-columns: 1fr; gap: 0; }
  dl.kv.roomy dd { margin-bottom: .6rem; }
  dl.kv.roomy dd:last-child { margin-bottom: 0; }
}

/* ---------------------------------------------------------------- stamps and notices */

/* A word in a ruled box, the way a clerk stamps a page. */
.badge {
  display: inline-block; vertical-align: .1em;
  font: 700 .7rem/1.25 var(--sans); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  padding: .14rem .42rem .1rem; border: 1px solid currentColor; border-radius: 2px;
  color: var(--ink-soft); background: rgba(255, 253, 246, .55);
  text-decoration: none;
}
.badge.ok { color: var(--green); }
.badge.warn { color: var(--ochre); }
.badge.danger { color: var(--red); }
.badge.accent { color: var(--blue); }
/* The type of a DNS record: typed, like the record itself. */
.badge.type { color: var(--blue); font-family: var(--mono); font-weight: 600; font-size: .76rem; letter-spacing: .04em; min-width: 2.2rem; text-align: center; }
/* Beside a title it is a real stamp: bigger, double-ruled, and not quite straight. */
h1 .badge {
  font-size: .8rem; letter-spacing: .12em; vertical-align: .5em; margin-left: .7rem;
  padding: .22rem .6rem .18rem; border-width: 2px; border-radius: 3px; background: none;
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px currentColor;
  transform: rotate(-4deg); opacity: .92;
}
h2 .badge { vertical-align: 0; }

/* A notice: ruled above and below, opened by a lozenge in the colour of its news. */
.alert {
  position: relative;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .8rem .9rem .78rem 1.75rem; margin-bottom: 1.7rem;
  background: rgba(255, 253, 246, .45);
}
.alert::before {
  content: ""; position: absolute; left: .55rem; top: 1.32rem;
  width: 8px; height: 8px; background: var(--ink-soft); transform: rotate(45deg);
}
.alert.success { border-color: var(--green); background: rgba(33, 80, 49, .07); }
.alert.success::before { background: var(--green); }
.alert.error { border-color: var(--red); background: rgba(138, 35, 24, .07); }
.alert.error::before { background: var(--red); }
.alert.warn { border-color: var(--ochre); background: rgba(160, 110, 20, .09); }
.alert.warn::before { background: var(--ochre); }
.alert.info { border-color: var(--blue); background: rgba(27, 60, 105, .06); }
.alert.info::before { background: var(--blue); }
.alert ul { margin: 0; padding-left: 1.1rem; }

/* ---------------------------------------------------------------- forms */

label { display: block; font-weight: 600; font-size: .97rem; line-height: 1.35; margin-bottom: .35rem; }
label .muted { font-weight: 400; }
.field { margin-bottom: 1.1rem; }
.field .help { color: var(--ink-soft); font-size: .93rem; line-height: 1.45; margin-top: .4rem; }
.field .error { color: var(--red); font-weight: 600; font-size: .95rem; margin-top: .4rem; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: .56rem .75rem; margin: 0;
  font: 400 1.02rem/1.4 var(--sans); color: var(--ink);
  background: var(--paper-bright); border: 1px solid var(--rule); border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(74, 52, 20, .13);
}
select { padding-right: .4rem; }
/* One height for every one-line field: left to itself a select comes out a few
   pixels taller than the text field beside it, and the labels above them split. */
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select { height: 2.875rem; }
/* A search field is a field: no pill, no magnifying glass of the browser's own. */
input[type=search] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 3.3rem; resize: vertical; }
/* A DNS value, a key: typed, so that every character can be told from the next. */
textarea.mono, input.mono { font-family: var(--mono); font-size: .95rem; line-height: 1.5; }
::placeholder { color: rgba(82, 70, 56, .6); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
a:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] { border-color: var(--red); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 1.05rem; height: 1.05rem; margin: 0; }

/* The top line of a DNS record: its type, its name, how long it is remembered. */
.record-top { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 13rem; gap: 0 1.2rem; align-items: start; }
.record-top .ttl-field { grid-column: 3; }
.fixed-value { padding: .5rem 0 .3rem; }
@media (max-width: 46rem) {
  .record-top { grid-template-columns: 1fr 1fr; }
  .record-top .name-field { grid-column: 1 / -1; grid-row: 2; }
  .record-top .ttl-field { grid-column: 2; grid-row: 1; }
}

.inline-fields { display: grid; gap: 0 1.2rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); align-items: start; }
.inline-fields .wide { grid-column: span 3; }
@media (max-width: 46rem) { .inline-fields .wide { grid-column: 1 / -1; } }

/* A field with a fixed ending, like [ sam ]@example.com. The ending keeps its
   full width (a domain cut short is worse than a narrow box) up to 70%. */
.affix { display: flex; align-items: stretch; }
.affix input { width: auto; flex: 1 1 5rem; min-width: 5rem; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.affix .suffix, .affix .prefix {
  flex: 0 1 auto; max-width: 70%; padding: .56rem .75rem;
  font-size: 1.02rem; line-height: 1.4; color: var(--ink-soft);
  border: 1px solid var(--rule); border-left: 0; border-radius: 0 2px 2px 0; background: var(--paper-shade);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* The same with a fixed beginning: riverbend-[ sam ]. */
.affix .prefix { border-left: 1px solid var(--rule); border-right: 0; border-radius: 2px 0 0 2px; font-family: var(--mono); font-size: .95rem; line-height: 1.5; }
.affix .prefix + input { border-radius: 0 2px 2px 0; font-family: var(--mono); font-size: .95rem; line-height: 1.5; }

.choice { display: flex; gap: .6rem; align-items: baseline; font-weight: 400; font-size: 1rem; line-height: 1.45; margin-bottom: .4rem; }
/* Who a forwarder goes to: a list to tick, then a box for anyone else. */
fieldset.recipients { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.recipients legend { padding: 0; font-weight: 600; margin-bottom: .1rem; }
fieldset.recipients .help { margin: 0 0 .6rem; }
fieldset.recipients .pick { margin: 0 0 .8rem; padding: .55rem .8rem .2rem; border-left: 2px solid var(--rule); max-height: 15rem; overflow-y: auto; }
fieldset.recipients .pick .choice span { overflow-wrap: anywhere; }
ul.plain { list-style: none; margin: 0 0 .6rem; padding: 0; }
/* A few things to weigh before a decision: a small diamond, then a short paragraph each. */
ul.points { list-style: none; margin: 0 0 1rem; padding: 0; max-width: var(--measure); }
ul.points li { position: relative; padding-left: 1.5rem; margin-bottom: .7rem; line-height: 1.5; }
ul.points li::before { content: ""; position: absolute; left: .3rem; top: .6em; width: .4rem; height: .4rem; background: var(--red); transform: rotate(45deg); }
td ul.plain { margin: 0; }
ul.plain li { overflow-wrap: anywhere; }
.choice input { flex: none; transform: translateY(.14rem); }

/* A button is a printed label: solid ink, a hairline inside the edge. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .56rem 1.15rem; border: 1px solid var(--ink); border-radius: 2px;
  font: 600 1rem/1.3 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--ink); color: var(--paper-bright);
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px rgba(255, 253, 246, .34), 0 1px 2px rgba(31, 24, 17, .3);
}
.btn:hover { background: #000; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.secondary {
  background: rgba(255, 253, 246, .6); color: var(--ink); border-color: var(--rule); box-shadow: none;
}
.btn.secondary:hover { background: var(--paper-bright); border-color: var(--ink); color: var(--ink); }
.btn.danger { background: var(--red); border-color: var(--red-deep); box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px rgba(255, 253, 246, .34), 0 1px 2px rgba(31, 24, 17, .3); }
.btn.danger:hover { background: var(--red-deep); }
.btn.small { padding: .3rem .7rem; font-size: .9rem; box-shadow: none; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
/* An action in a row of a ledger: just the word, so the table stays calm. */
.btn.link {
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0;
  font: 600 .95rem/1.3 var(--sans); color: var(--blue); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.btn.link:hover { color: var(--red); background: none; }
.btn.link.small { font-size: .9rem; }
.btn.link.danger { color: var(--red); }
.btn.link.danger:hover { color: var(--red-deep); }

details > summary { cursor: pointer; font-weight: 600; font-size: 1.04rem; }
details > summary::marker { color: var(--red); }
details[open] > summary { margin-bottom: 1rem; }
details.small > summary { font-weight: 400; font-size: .9rem; }

/* ---------------------------------------------------------------- waiting, and what is shown once */

.waiting { text-align: center; padding: 2.6rem 1rem 1.6rem; }
.waiting h2 { display: block; font-size: 1.75rem; margin-bottom: .6rem; }
.waiting h2::after { content: none; }
.waiting p { color: var(--ink-soft); }
/* A paragraph in a card is held to the reading width, and that box sits at the
   left. In these two centred blocks the box has to be centred too, or its
   lines centre on a point to the left of the heading above them. They did, on
   the waiting page: 124 px off. bin/preview-shots.mjs now measures it. */
.waiting p, .sealed p { max-width: 32rem; margin-left: auto; margin-right: auto; }
.waiting + p { text-align: center; }
/* An hourglass, turned over every few seconds. */
.spinner {
  width: 44px; height: 60px; margin: 0 auto 1.4rem;
  background: url("../img/hourglass.svg?v=637f296ee4") center / contain no-repeat;
  animation: turn 3.2s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes turn { 0%, 72% { transform: rotate(0); } 100% { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Made, and waiting under its seal. */
.sealed { text-align: center; padding: 2rem 1rem 1rem; }
.sealed .seal { width: 5.2rem; height: auto; margin: 0 auto .9rem; display: block; filter: drop-shadow(0 2px 2px rgba(60, 20, 10, .35)); transform: rotate(-8deg); }
.sealed h2 { display: block; font-size: 1.75rem; margin-bottom: .6rem; }
.sealed h2::after { content: none; }
.sealed .row { justify-content: center; margin-top: 1.3rem; }

/* Something to copy down: typed, on its own slip, with a dashed edge to cut along. */
.secret {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  font: 600 1.22rem/1.4 var(--mono); letter-spacing: .01em;
  background: var(--paper-bright); border: 1px dashed var(--rule); border-radius: 2px; padding: .7rem .95rem;
  overflow-wrap: anywhere; user-select: all;
}
.secret.small { font-size: .9rem; font-weight: 400; letter-spacing: 0; margin-top: .55rem; }
/* A long one (a sending key is 55 characters): set a size smaller so it keeps
   to one line where there is room, with its button beside it. Where there
   isn't, the text folds inside its own box and the button drops below. */
.secret.long { font-size: 1rem; letter-spacing: 0; }
.secret.long > span { flex: 1 1 15rem; min-width: 0; word-break: break-all; }
.secret .btn { user-select: none; }

.qr { background: #fff; display: inline-block; padding: .75rem; border: 1px solid var(--rule); }
.codes { font-family: var(--mono); font-size: .95rem; columns: 2; column-gap: 2rem; list-style: none; padding: 0; margin: 0 0 1rem; }

.pagination { display: flex; gap: .5rem; align-items: center; justify-content: space-between; margin-top: -.9rem; margin-bottom: 2.2rem; font-size: .95rem; }

/* The foot of the sheet. */
.colophon { margin-top: 2.8rem; text-align: center; color: var(--ink-soft); font-size: .95rem; }
.colophon p { margin: 0; }
/* Signed off the way a letter of the time was. */
.colophon .sign-off { font: 400 1.75rem/1.2 var(--script); color: var(--ink); opacity: .8; margin-top: .35rem; }
.colophon::before {
  content: ""; display: block; height: 14px; margin: 0 auto .95rem;
  background: url("../img/rule-lozenge.svg?v=285d0ceaad") center / 300px 14px no-repeat;
}

/* ---------------------------------------------------------------- the title page (signing in) */

.title-page { text-align: center; margin-bottom: 1.6rem; }
.title-page .name { font: 400 1.9rem/1.2 var(--brand); letter-spacing: .13em; }
.title-page .tag { font: 400 2.4rem/1.1 var(--script); color: var(--red); margin-top: .1rem; }
.title-page::after {
  content: ""; display: block; height: 14px; margin: .7rem auto 0;
  background: url("../img/rule-lozenge.svg?v=285d0ceaad") center / 300px 14px no-repeat;
}
.sheet.narrow h2 { display: block; text-align: center; font-size: 1.5rem; margin-bottom: 1.15rem; }
.sheet.narrow h2::after { content: none; }
.sheet.narrow h2 + p { text-align: center; color: var(--ink-soft); }
.sheet.narrow .below { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--rule-light); text-align: center; font-size: .93rem; color: var(--ink-soft); }
