/* The "decimal" articles' parts (includes/decimal.php). Loaded after site.css, only on a page that uses them;
   colours come from its tokens, so dark mode follows. The dial and the ruler are objects with colours of their own. */

.prose .mtc-dec, .prose .mtc-dchart, .prose .mtc-ddial, .prose .mtc-drule, .prose .mtc-dsteps, .prose .mtc-dcard,
.prose .mtc-ddrift, .prose .mtc-dmist, .prose .mtc-dend, .prose .mtc-dtotals { margin: 20px 0 26px; }
.prose .mtc-dsteps ol, .prose .mtc-ddrift ol, .prose .mtc-dmist ul { padding-left: 0; margin: 0; }
.prose .mtc-dsteps li, .prose .mtc-ddrift li, .prose .mtc-dmist li { margin: 0; }
.mtc-ddial figcaption, .mtc-drule figcaption, .mtc-dsteps figcaption, .mtc-ddrift figcaption, .mtc-dmist figcaption { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-3); }

/* ---- The answer boxes ------------------------------------------------------------------------ */

.mtc-dec__out { margin-top: 14px; }
.mtc-dec__lcd { position: relative; display: block; padding: 34px 16px 18px; border-radius: var(--radius); background: var(--lcd); box-shadow: inset 0 0 0 2px var(--lcd-edge); text-align: center; overflow: hidden; }
.mtc-dec__tag { position: absolute; left: 16px; top: 12px; font: 700 13px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: #9AA38B; }
.mtc-dec__digits { display: block; font: 400 clamp(46px, 15vw, 92px)/1 var(--seg); letter-spacing: .02em; color: var(--amber); white-space: nowrap; font-variant-numeric: normal; }
.mtc-dec.is-error .mtc-dec__digits { opacity: .35; }
.mtc-dec .mtc-readout__facts dd { overflow-wrap: anywhere; }
.mtc-dec__other { margin: 12px 0 0; font-weight: 600; }

/* ---- The charts ---------------------------------------------------------------------------------- */

.mtc-dchart { container-type: inline-size; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mtc-dchart__title { margin: 0 0 12px; font-size: 15px; color: var(--ink-2); }
.mtc-dchart__title b { display: block; font: 700 24px/1.05 var(--cond); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.mtc-dchart__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.mtc-dchart__table { border: 1px solid var(--line); border-radius: var(--radius-sm); border-collapse: separate; border-spacing: 0; }
.mtc-dchart__table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.mtc-dchart__table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.mtc-dchart__table caption { padding: 0 0 6px; text-align: left; font: 700 14px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.mtc-dchart--hundredths .mtc-dchart__table caption { font-size: 13px; letter-spacing: .04em; }
.mtc-dchart .mtc-table th, .mtc-dchart .mtc-table td { padding: 5px 8px; vertical-align: baseline; }
.mtc-dchart .mtc-table thead th { position: static; font-size: 12.5px; letter-spacing: .08em; }
.mtc-dchart .mtc-table tbody th { font: 700 19px/1.1 var(--cond); }
.mtc-dchart .mtc-table td { font-size: 15.5px; font-weight: 600; white-space: nowrap; }
.mtc-dchart--minutes .mtc-table td:last-child { font-weight: 400; color: var(--ink-2); }
.mtc-dchart tr.is-exact td:last-child span { font: 700 13px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--link); }
.mtc-dchart tr.is-quarter > * { background: var(--amber-soft); }
.mtc-dchart tr.is-tenth td { font-weight: 700; color: var(--ink); }
.mtc-dchart--hundredths tr:not(.is-tenth) td { font-weight: 400; color: var(--ink-2); }
.mtc-dchart__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 12px 0 0; font-size: 13.5px; color: var(--ink-3); }
.mtc-dchart__site { font-weight: 600; }
.mtc-dchart__print { margin-left: auto; }
@container (min-width: 500px) { .mtc-dchart__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 620px) { .mtc-dchart--hundredths .mtc-dchart__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 760px) {
	.mtc-dchart--minutes .mtc-dchart__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.mtc-dchart--hundredths .mtc-dchart__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
}
/* Two tables side by side on a phone: the hundredths' two short columns fit. */
@container (max-width: 499px) {
	.mtc-dchart--hundredths .mtc-dchart__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.mtc-dchart--hundredths .mtc-table th, .mtc-dchart--hundredths .mtc-table td { padding: 5px 6px; }
	.mtc-dchart--hundredths .mtc-table tbody th { font-size: 17px; }
	.mtc-dchart--hundredths .mtc-table td { font-size: 14px; }
}

/* ---- The dial: a puck tilted back, its minutes lit amber ---------------------------------------- */

.mtc-ddial, .mtc-drule { padding: 18px 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mtc-ddial__stage { perspective: 900px; padding: 4px 0 26px; }
.mtc-ddial__body { width: min(100%, 330px); margin: 0 auto; padding: 9px; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #5C6B47, #3D4A2C 55%, #1F261A); box-shadow: 0 13px 0 -1px #151A11, 0 13px 0 0 #0B0E09, 0 34px 36px -16px rgba(0, 0, 0, .6); transform: rotateX(24deg); transform-origin: 50% 55%; }
.mtc-ddial__svg { display: block; width: 100%; height: auto; border-radius: 50%; }
.mtc-ddial__face { fill: #F3F1EA; }
.mtc-ddial__sec { fill: #E2DDCC; cursor: pointer; transition: fill .15s ease; }
.mtc-ddial__sec.is-q { fill: #CFC8B3; }
.mtc-ddial__sec.is-lit { fill: #FFB01F; }
.mtc-ddial__sec.is-lit.is-q { fill: #E09A12; }
.mtc-ddial__sec.is-cur { fill: #B57600; }
.mtc-ddial__sec:hover { fill: #F2C566; }
.mtc-ddial__min { font: 700 16px/1 var(--cond); fill: #15171A; text-anchor: middle; }
.mtc-ddial__dec { font: 700 13px/1 var(--cond); fill: #3D4A2C; text-anchor: middle; }
.mtc-ddial__tick { stroke: #3D4A2C; stroke-width: 1.6; stroke-opacity: .6; pointer-events: none; }
.mtc-ddial__hub { fill: #11150F; stroke: #2A3224; stroke-width: 3; }
.mtc-ddial__big { font: 400 27px/1 var(--seg); fill: #FFB01F; text-anchor: middle; }
.mtc-ddial__unit { font: 700 12px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; fill: #B9BDAE; text-anchor: middle; }
.mtc-ddial__controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; max-width: 560px; margin: 0 auto; }
.mtc-ddial__controls label { font: 700 15px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.mtc-ddial__range { width: 100%; margin: 0; accent-color: #C98400; }
.mtc-ddial__out { grid-column: 1 / -1; display: block; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); font-size: 17px; font-weight: 600; text-align: center; }

/* ---- The ruler: one hour lying on the desk ------------------------------------------------------ */

.mtc-drule__stage { perspective: 1000px; padding: 8px 4px 30px; }
.mtc-drule__bar { border-radius: 10px; box-shadow: 0 12px 0 -1px #A08A50, 0 12px 0 0 #6E5E33, 0 30px 30px -14px rgba(0, 0, 0, .55); transform: rotateX(34deg); transform-origin: 50% 100%; }
.mtc-drule__svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.mtc-drule__face { fill: #F1E7C6; }
.mtc-drule__tick { stroke: #2B2A20; stroke-width: 2; }
.mtc-drule__tick.is-big { stroke-width: 3.5; }
.mtc-drule__num { font: 700 30px/1 var(--cond); fill: #1E1D16; text-anchor: middle; }
.mtc-drule__unit { font: 700 17px/1 var(--cond); letter-spacing: .3em; fill: #7A6A3C; text-anchor: middle; }
.mtc-drule__cursor rect { fill: rgba(255, 176, 31, .55); stroke: #9A6500; stroke-width: 2; }
.mtc-drule__cursor line { stroke: #B57600; stroke-width: 4; }
@media (prefers-reduced-motion: no-preference) { .mtc-drule__cursor { transition: transform .12s ease; } }
/* On a phone the ruler is a third as wide: bigger numbers, and tilted less so that they stay readable. */
.mtc-drule { container-type: inline-size; }
@container (max-width: 520px) {
	.mtc-drule__bar { transform: rotateX(22deg); }
	.mtc-drule__num { font-size: 46px; }
	.mtc-drule__unit { font-size: 24px; letter-spacing: .2em; }
	.mtc-drule__tick { stroke-width: 3; }
	.mtc-drule__tick.is-big { stroke-width: 5; }
}

/* ---- A shift, step by step ---------------------------------------------------------------------- */

.mtc-dsteps { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mtc-dsteps__ends { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; }
.mtc-dsteps__ends span { display: inline-flex; flex-direction: column; align-items: center; padding: 8px 14px 10px; border-radius: var(--radius-sm); background: var(--lcd); box-shadow: inset 0 0 0 2px var(--lcd-edge); }
.mtc-dsteps__ends small { font: 700 11.5px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: #9AA38B; }
.mtc-dsteps__ends b { margin-top: 6px; font: 400 clamp(24px, 7vw, 32px)/1 var(--seg); color: var(--amber); }
.mtc-dsteps__ends i { font: 700 26px/1 var(--cond); font-style: normal; color: var(--ink-3); }
.mtc-dsteps__list { counter-reset: step; list-style: none; margin: 14px 0 0; }
.mtc-dsteps__list li { counter-increment: step; position: relative; padding: 9px 0 9px 40px; border-top: 1px solid var(--line); font-size: 16px; }
.mtc-dsteps__list li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 700 16px/28px var(--cond); text-align: center; }

/* ---- The time card ---------------------------------------------------------------------------------- */

.mtc-dcard__wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Written as .mtc-dcard table.… so that they win over the theme's rules for tables in an article. */
.mtc-dcard table.mtc-dcard__table { width: 100%; min-width: 290px; margin: 0; border-collapse: collapse; table-layout: fixed; font-size: 16px; }
.mtc-dcard__table caption { caption-side: top; padding: 0 0 10px; text-align: left; font-size: 14.5px; color: var(--ink-2); }
.mtc-dcard table.mtc-dcard__table th, .mtc-dcard table.mtc-dcard__table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.mtc-dcard table.mtc-dcard__table thead th { font: 700 13px/1.2 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.mtc-dcard__table thead th:first-child { width: 15%; }
.mtc-dcard__table thead th:nth-child(2), .mtc-dcard__table thead th:nth-child(3) { width: 28%; }
.mtc-dcard__table tbody th { font: 700 18px/1 var(--cond); letter-spacing: .03em; }
.mtc-dcard__table abbr { text-decoration: none; }
.mtc-dcard__in { width: 100%; max-width: 7.2em; min-width: 0; padding: 7px 8px; font: 600 18px/1.2 var(--font); font-variant-numeric: tabular-nums; color: var(--ink); background: var(--bg); border: 2px solid var(--line-2); border-radius: var(--radius-sm); -webkit-appearance: none; appearance: none; }
.mtc-dcard__in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61, 74, 44, .18); background: var(--surface); }
.mtc-dcard__in[aria-invalid="true"] { border-color: var(--error); }
@media (prefers-color-scheme: dark) { .mtc-dcard__in:focus { border-color: var(--link); } }
.mtc-dcard__len b { display: block; font: 700 20px/1.1 var(--cond); letter-spacing: .02em; }
.mtc-dcard__len small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.3; color: var(--ink-3); }
.mtc-dcard__len small.is-error { color: var(--error); font-weight: 600; }
.mtc-dcard__totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.mtc-dcard__totals > div { padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mtc-dcard__totals dt { font: 700 12.5px/1.2 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.mtc-dcard__totals dd { margin: 4px 0 0; font: 700 28px/1 var(--cond); letter-spacing: .02em; }
.mtc-dcard__totals .is-main { grid-column: 1 / -1; order: -1; background: var(--lcd); border-color: var(--lcd-edge); }
.mtc-dcard__totals .is-main dt { color: #9AA38B; }
.mtc-dcard__totals .is-main dd { font: 400 clamp(30px, 9vw, 44px)/1 var(--seg); color: var(--amber); }
@media (min-width: 600px) {
	.mtc-dcard__totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.mtc-dcard__totals .is-main { grid-column: auto; order: 0; }
	.mtc-dcard__totals .is-main dd { font-size: 30px; }
}
.mtc-dcard__say { margin: 12px 0 0; font-size: 15.5px; }
.mtc-dcard__keep { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-3); }

/* ---- Rounding drift ------------------------------------------------------------------------------------ */

.mtc-ddrift { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mtc-ddrift__head, .mtc-ddrift__row { display: grid; grid-template-columns: minmax(0, 1fr) 8.6em; gap: 2px 10px; align-items: center; }
.mtc-ddrift__head { display: none; }
.mtc-ddrift__row { padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mtc-ddrift__when b { display: inline-block; min-width: 2.4em; font: 700 16px/1 var(--cond); letter-spacing: .04em; }
.mtc-ddrift__dec { grid-column: 1; color: var(--ink-2); }
.mtc-ddrift__dec b { color: var(--ink); }
.mtc-ddrift__err { grid-column: 2; grid-row: 1; font-weight: 700; color: #9A6500; }
.mtc-ddrift__run { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; }
.mtc-ddrift__bar { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; font-style: normal; }
.mtc-ddrift__bar i { display: block; height: 100%; background: var(--amber); }
@media (min-width: 640px) {
	.mtc-ddrift__head, .mtc-ddrift__row { grid-template-columns: 9.5em minmax(0, 1fr) 4.5em 11em; }
	.mtc-ddrift__head { display: grid; padding-bottom: 6px; font: 700 12.5px/1.2 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
	.mtc-ddrift__dec, .mtc-ddrift__err, .mtc-ddrift__run { grid-column: auto; grid-row: auto; }
	.mtc-ddrift__bar { width: 90px; }
}
.mtc-ddrift__totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.mtc-ddrift__totals > div { padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mtc-ddrift__totals dt { font: 700 12.5px/1.2 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.mtc-ddrift__totals dd { margin: 4px 0 0; font: 700 26px/1 var(--cond); }
.mtc-ddrift__totals > div:first-child { border: 2px solid var(--amber); background: var(--amber-soft); }
.mtc-ddrift__totals .is-main { border: 2px solid var(--link); }
@media (prefers-color-scheme: dark) { .mtc-ddrift__err { color: #FFC24D; } }
@media (min-width: 640px) { .mtc-ddrift__totals { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- Misreadings ------------------------------------------------------------------------------------------- */

.mtc-dmist { container-type: inline-size; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mtc-dmist__list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@container (min-width: 520px) { .mtc-dmist__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 760px) { .mtc-dmist__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mtc-dmist__item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--radius-sm); }
.mtc-dmist__dec { font: 700 32px/1 var(--cond); letter-spacing: .02em; }
.mtc-dmist__dec small { font: 600 15px/1 var(--font); color: var(--ink-3); }
.mtc-dmist__not { font-size: 15px; color: var(--ink-3); }
.mtc-dmist__not s { color: var(--error); text-decoration-thickness: 2px; font-weight: 600; }
.mtc-dmist__is { font-size: 16px; }
.mtc-dmist__is b { font: 700 21px/1 var(--cond); color: var(--link); }
.mtc-dmist__back { font-size: 13.5px; color: var(--ink-3); }

/* ---- Common totals ----------------------------------------------------------------------------------------- */

.mtc-dtotals .mtc-table tbody th { font: 700 20px/1.1 var(--cond); }
.mtc-dtotals .mtc-table td:nth-child(3) { font-weight: 600; white-space: nowrap; }
@media (max-width: 479px) { .mtc-dtotals .mtc-table td { font-size: 14.5px; } }

/* ---- Motion and print ---------------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.mtc-ddial__sec { transition: none; }
}
.mtc-print-sheet { display: none; }
@media print {
	@page { margin: 12mm; }
	.mtc-dec, .mtc-ddial, .mtc-drule, .mtc-dcard, .mtc-dend { break-inside: avoid; }
	.mtc-dchart { break-before: page; break-after: page; break-inside: avoid; padding: 0; border: 0; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.mtc-dchart__print, .mtc-noscript { display: none !important; }
	.mtc-dchart__title { margin-bottom: 4mm; font-size: 10.5pt; }
	.mtc-dchart__title b { font-size: 20pt; }
	.mtc-dchart--minutes .mtc-dchart__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6mm 8mm; }
	.mtc-dchart--hundredths .mtc-dchart__grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 5mm 3mm; }
	/* Sized to fit one sheet of US Letter or A4 inside 12 mm margins (measured with these rules applied on screen at the page's width). */
	.mtc-dchart .mtc-table th, .mtc-dchart .mtc-table td { padding: .6mm 1.8mm; line-height: 1.15; border-color: #999; }
	.mtc-dchart .mtc-table thead th { background: #eee; font-size: 8.5pt; }
	.mtc-dchart--minutes .mtc-table tbody th { font-size: 11pt; }
	.mtc-dchart--minutes .mtc-table td { font-size: 10pt; }
	.mtc-dchart--hundredths .mtc-table th, .mtc-dchart--hundredths .mtc-table td { padding: 1mm 1.4mm; }
	.mtc-dchart--hundredths .mtc-table tbody th { font-size: 11pt; }
	.mtc-dchart--hundredths .mtc-table td { font-size: 9.5pt; }
	.mtc-dchart__table caption { font-size: 9.5pt; padding-bottom: 1mm; }
	.mtc-dchart tr.is-quarter > * { background: #f1e6c8 !important; }
	.mtc-dchart__foot { margin-top: 4mm; font-size: 9pt; color: #333; }
	html.mtc-print-one body > *:not(.mtc-print-sheet) { display: none !important; }
	html.mtc-print-one .mtc-print-sheet { display: block; }
	html.mtc-print-one .mtc-print-sheet .mtc-dchart { break-before: auto; break-after: auto; margin: 0; }
}
