/* ==========================================================================
   The undercurrent: an opt-in audit of the ledger.

   Everything here is drawn in pencil on the same paper as the rest of the
   sheet: graphite grey for the reader's marks, the ledger's own red for the
   years, the site's serif throughout. Nothing renders until the reader takes
   the pencil (html.rc-uc-on) except the small mark in the footer margin.
   ========================================================================== */

:root {
	--rc-uc-pencil: #5b6169;
	--rc-uc-pencil-soft: #9aa2aa;
	--rc-uc-pencil-ink: #3a424b;
}

/* Screen-reader-only text and the live region. */
.rc-uc-sr,
.rc-uc-live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rc-uc-glyph {
	display: inline-block;
	line-height: 0;
	vertical-align: middle;
}

.rc-uc-glyph svg {
	display: block;
	width: 1em;
	height: 1em;
}

/* --------------------------------------------------------------------------
   The footer mark: a tick in the date column, quiet until it is taken up.
   -------------------------------------------------------------------------- */

.rc-foot__inner .rc-uc-markline {
	position: absolute;
	top: 1.55rem;
	left: var(--rc-gutter);
	width: var(--rc-m);
	max-width: none;
	margin: 0 !important;
	text-align: right;
	line-height: 1;
}

.rc-uc-mark {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0.2rem;
	color: var(--rc-uc-pencil);
	opacity: 0.55;
	text-decoration: none;
	line-height: 1;
}

.rc-uc-mark:hover,
.rc-uc-mark:focus-visible,
.rc-uc-mark.is-on {
	opacity: 1;
}

.rc-uc-mark svg {
	display: block;
	width: 1rem;
	height: 1rem;
}

.rc-uc-mark__n {
	font-size: 0.75rem;
	font-style: italic;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.rc-uc-mark__n:empty {
	display: none;
}

/* --------------------------------------------------------------------------
   The tick on a record's page: a small box in the date column, ticked in
   pencil once the entry is vouched.
   -------------------------------------------------------------------------- */

.rc-uc-tick {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	color: var(--rc-uc-pencil);
	cursor: pointer;
	line-height: 0;
	border-radius: 2px;
}

.rc-uc-tick:hover {
	color: var(--rc-ink);
	background: var(--rc-wash);
}

.rc-uc-tick:focus-visible {
	outline: 2px solid var(--rc-red);
	outline-offset: 2px;
}

.rc-uc-tick .rc-uc-glyph {
	font-size: 1.1rem;
}

.rc-uc-tick .rc-uc-glyph:last-child,
.rc-uc-tick.is-found .rc-uc-glyph:first-child {
	display: none;
}

.rc-uc-tick.is-found .rc-uc-glyph:last-child {
	display: inline-block;
}

/* In a record head the tick sits under the years or the week number. */
.rc-workhead__yrs .rc-uc-tick,
.rc-entryhead__wk .rc-uc-tick {
	margin-top: 0.45rem;
	align-self: flex-end;
}

.rc-essay__date .rc-uc-tick {
	display: flex;
	margin: 0.5rem 0 0 auto;
}

/* On an archive or a page the tick hangs off the title into the date column. */
.rc-page-h.rc-uc-host {
	position: relative;
}

.rc-page-h > .rc-uc-tick {
	position: absolute;
	right: calc(100% + var(--rc-g));
	top: calc(clamp(2.5rem, 6vw, 4.5rem) + 0.3em);
	font-size: inherit;
}

/* --------------------------------------------------------------------------
   The note: a pencilled line on the ledger, its year in the date column.
   -------------------------------------------------------------------------- */

.rc-uc-note {
	display: grid;
	grid-template-columns: var(--rc-m) minmax(0, 1fr);
	column-gap: var(--rc-g);
	margin: 1.75rem 0 0 calc(-1 * (var(--rc-m) + var(--rc-g)));
	max-width: calc(var(--rc-measure) + var(--rc-m) + var(--rc-g));
	padding: 0.85rem 0 1rem;
	border-top: 1px solid var(--rc-rule-strong);
	border-bottom: 1px solid var(--rc-rule);
	color: var(--rc-uc-pencil-ink);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.rc-uc-note[hidden] {
	display: none;
}

.rc-uc-note:focus {
	outline: none;
}

.rc-uc-note:focus-visible {
	outline: 2px solid var(--rc-red);
	outline-offset: 4px;
}

.rc-uc-note__y {
	text-align: right;
	font-weight: 600;
	color: var(--rc-red);
	font-variant-numeric: tabular-nums;
	padding-top: 0.05rem;
}

.rc-uc-note__b > * {
	margin: 0;
}

.rc-uc-note__b > * + * {
	margin-top: 0.6rem;
}

.rc-uc-note__k {
	font-style: italic;
	color: var(--rc-uc-pencil);
}

.rc-uc-note__k strong {
	font-style: normal;
	font-weight: 600;
	color: var(--rc-ink);
}

.rc-uc-note__links {
	list-style: none;
	padding: 0;
}

.rc-uc-note__links li {
	position: relative;
	padding-left: 1.1em;
}

.rc-uc-note__links li::before {
	content: "–";
	position: absolute;
	left: 0;
	color: var(--rc-rule-strong);
}

.rc-uc-note__links a {
	color: var(--rc-ink);
	text-decoration-color: var(--rc-red);
	text-underline-offset: 0.18em;
}

.rc-uc-note__src {
	font-size: 0.8125rem;
	font-style: italic;
	color: var(--rc-ink-soft);
}

/* --------------------------------------------------------------------------
   Ledger lines that carry a tick get a box in the date column.
   -------------------------------------------------------------------------- */

.rc-uc-linebox {
	display: inline-block;
	margin-top: 0.35rem;
	color: var(--rc-uc-pencil-soft);
	line-height: 0;
	font-size: 0.85rem;
}

.rc-uc-linebox.is-found {
	color: var(--rc-uc-pencil);
}

/* --------------------------------------------------------------------------
   The sheet: a slip of the same paper, with the double red rule.
   -------------------------------------------------------------------------- */

.rc-uc-sheet {
	--uc-m: 4.5rem;
	--uc-x: 3.6rem;
	box-sizing: border-box;
	width: min(38rem, calc(100vw - 2rem));
	max-height: min(88vh, 60rem);
	max-width: none;
	margin: auto;
	padding: 0;
	overflow: auto;
	border: 1px solid var(--rc-rule-strong);
	border-radius: 2px;
	background-color: var(--rc-paper);
	background-image:
		linear-gradient(var(--rc-red), var(--rc-red)),
		linear-gradient(var(--rc-red), var(--rc-red));
	background-size: 1px 100%, 1px 100%;
	background-position: calc(var(--uc-x) - 2px) 0, calc(var(--uc-x) + 2px) 0;
	background-repeat: no-repeat;
	color: var(--rc-ink);
	font-family: var(--rc-serif);
	font-size: 1rem;
	line-height: 1.55;
	box-shadow: 0 1.25rem 3rem rgba(23, 34, 46, 0.18);
}

.rc-uc-sheet::backdrop {
	background: rgba(23, 34, 46, 0.28);
}

.rc-uc-sheet__bar {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1.25rem 0.55rem var(--uc-m);
	border-bottom: 3px double var(--rc-ink);
}

.rc-uc-sheet__kicker {
	margin: 0;
	font-size: 0.8125rem;
	font-style: italic;
	color: var(--rc-ink-soft);
}

.rc-uc-sheet__x {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	padding: 0.2rem 0.3rem;
	font: inherit;
	font-size: 0.875rem;
	color: var(--rc-ink-soft);
	text-decoration: underline;
	text-underline-offset: 0.18em;
	cursor: pointer;
}

.rc-uc-sheet__x:hover,
.rc-uc-sheet__x:focus-visible {
	color: var(--rc-ink);
	text-decoration-color: var(--rc-red);
}

.rc-uc-sheet__body {
	padding: 1.25rem 1.5rem 1.75rem var(--uc-m);
}

.rc-uc-sheet__body > * {
	margin: 0;
}

.rc-uc-sheet__body > * + * {
	margin-top: 0.9rem;
}

.rc-uc-sheet__h {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.05;
	text-wrap: balance;
	outline: none;
}

.rc-uc-lede {
	font-size: 1.125rem;
	line-height: 1.45;
}

.rc-uc-fine {
	font-size: 0.875rem;
	font-style: italic;
	color: var(--rc-ink-soft);
}

.rc-uc-count {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1rem;
}

.rc-uc-count__t {
	flex: 1 1 14rem;
}

.rc-uc-pencil svg {
	display: block;
}

.rc-uc-pencil__eraser {
	fill: #d9a9a4;
}

.rc-uc-pencil__band {
	fill: #b8b2a3;
}

.rc-uc-pencil__body {
	fill: #e4c77c;
}

.rc-uc-pencil__wood {
	fill: #ead9b7;
}

.rc-uc-pencil__lead {
	fill: var(--rc-uc-pencil);
}

.rc-uc-group {
	margin-top: 1.5rem;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid var(--rc-ink);
	font-size: 0.8125rem;
	font-style: italic;
	font-weight: 400;
	color: var(--rc-ink-soft);
}

.rc-uc-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rc-uc-item {
	display: grid;
	grid-template-columns: calc(var(--uc-m) - 1.4rem) minmax(0, 1fr) 1.25rem;
	column-gap: 0.9rem;
	align-items: baseline;
	margin-left: calc(-1 * var(--uc-m) + 0.4rem);
	padding: 0.55rem 0 0.6rem;
	border-bottom: 1px solid var(--rc-rule);
}

.rc-uc-item__y {
	text-align: right;
	font-size: 0.875rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--rc-uc-pencil-soft);
}

.rc-uc-item.is-found .rc-uc-item__y {
	color: var(--rc-red);
}

.rc-uc-item__p {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.rc-uc-item__t {
	font-weight: 600;
	color: var(--rc-ink);
	text-decoration: none;
}

.rc-uc-item__t:hover {
	text-decoration: underline;
	text-decoration-color: var(--rc-red);
	text-underline-offset: 0.18em;
}

.rc-uc-item__d {
	font-size: 0.8125rem;
	font-style: italic;
	color: var(--rc-ink-soft);
}

.rc-uc-item__c {
	font-style: italic;
	color: var(--rc-uc-pencil-ink);
}

.rc-uc-item__m {
	color: var(--rc-uc-pencil-soft);
	line-height: 0;
	justify-self: end;
}

.rc-uc-item.is-found .rc-uc-item__m {
	color: var(--rc-uc-pencil);
}

.rc-uc-doors {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.6rem 0.75rem;
	margin-top: 1.4rem;
}

.rc-uc-btn {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	font-size: 0.9375rem;
	padding: 0.5rem 0.95rem;
	border: 1px solid var(--rc-ink);
	border-radius: 2px;
	background: var(--rc-paper);
	color: var(--rc-ink);
	cursor: pointer;
}

.rc-uc-btn:hover {
	background: #fff;
}

.rc-uc-btn:focus-visible {
	outline: 2px solid var(--rc-red);
	outline-offset: 2px;
}

.rc-uc-btn--go {
	border: 2px solid var(--rc-red);
	color: var(--rc-red);
	font-weight: 600;
	background: var(--rc-wash);
}

.rc-uc-btn--quiet {
	border-color: var(--rc-rule-strong);
	color: var(--rc-ink-soft);
}

.rc-uc-sign {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 0.75rem;
	margin-top: 1.25rem;
}

.rc-uc-sign__l {
	font-size: 0.9375rem;
}

.rc-uc-sign__in {
	width: 4.5rem;
	font: inherit;
	font-style: italic;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0.25rem 0.35rem;
	border: 0;
	border-bottom: 1px solid var(--rc-ink);
	border-radius: 0;
	background: transparent;
	color: var(--rc-ink);
}

.rc-uc-sign__in:focus-visible {
	outline: 2px solid var(--rc-red);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   The toast: one line, bottom left, gone on its own.
   -------------------------------------------------------------------------- */

.rc-uc-toast {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 60;
	box-sizing: border-box;
	max-width: min(26rem, calc(100vw - 2rem));
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.3rem 0.8rem;
	padding: 0.75rem 2.4rem 0.8rem 0.95rem;
	border: 1px solid var(--rc-rule-strong);
	border-left: 3px solid var(--rc-red);
	border-radius: 2px;
	background: var(--rc-paper);
	color: var(--rc-ink);
	font-family: var(--rc-serif);
	font-size: 0.9375rem;
	line-height: 1.45;
	box-shadow: 0 0.75rem 2rem rgba(23, 34, 46, 0.16);
}

.rc-uc-toast__t {
	margin: 0;
}

.rc-uc-toast__go {
	font: inherit;
	font-style: italic;
	color: var(--rc-ink);
	background: transparent;
	border: 0;
	padding: 0;
	text-decoration: underline;
	text-decoration-color: var(--rc-red);
	text-underline-offset: 0.18em;
	cursor: pointer;
}

.rc-uc-toast__x {
	position: absolute;
	top: 0.35rem;
	right: 0.45rem;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 1.1rem;
	line-height: 1;
	color: var(--rc-ink-soft);
	cursor: pointer;
	padding: 0.2rem 0.35rem;
}

.rc-uc-toast__x:hover,
.rc-uc-toast__x:focus-visible {
	color: var(--rc-ink);
}

/* --------------------------------------------------------------------------
   Motion, only for those who have not asked for none.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	.rc-uc-note,
	.rc-uc-toast {
		animation: rc-uc-in 0.25s ease-out;
	}

	@keyframes rc-uc-in {
		from {
			opacity: 0;
			transform: translateY(0.25rem);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
}

@media print {
	.rc-uc-markline,
	.rc-uc-tick,
	.rc-uc-linebox,
	.rc-uc-toast,
	.rc-uc-sheet {
		display: none !important;
	}
}
