/* ═══════════════════════════════════════════════════════════════
   THE REGISTRY — letter tools: the letter check and the drafting desk,
   and the two cards that lead the Tools room
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════ TOOLS ROOM — the two letter tools ═══════════ */
.tl-feature { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: .6rem; }
@media (max-width: 820px) { .tl-feature { grid-template-columns: 1fr; } }
.tl-big {
  --acc: var(--stamp); --acc-soft: var(--stamp-soft);
  display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 1.1rem; align-items: center;
  padding: 1.1rem 1.2rem; background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--acc); border-radius: var(--r-3);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s;
}
.tl-big--draft { --acc: var(--tape); --acc-soft: var(--tape-soft); }
.tl-big:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tl-big:focus-visible { outline: 3px solid var(--acc-soft); outline-offset: 2px; }
@media (max-width: 520px) { .tl-big { grid-template-columns: 1fr; } .tl-big__art { max-width: 13rem; } }
.tl-big__art { background: var(--acc-soft); border-radius: var(--r-2); padding: .4rem; }
.tl-big__body { display: grid; gap: .45rem; justify-items: start; min-width: 0; }
.tl-big__ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--acc-soft); color: var(--acc); }
.tl-big__ic .ic { width: 17px; height: 17px; }
.tl-big__t { font: 400 1.5rem/1.1 var(--display); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tl-big__badge { font: 600 0.78rem var(--sans); padding: .15rem .45rem; border-radius: 99px; background: var(--acc-soft); color: var(--acc); }
.tl-big__w { font-size: .9rem; color: var(--ink-2); }
.tl-big__pts { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; font-size: .84rem; color: var(--ink-2); }
.tl-big__pts li { display: flex; gap: .4rem; align-items: center; }
.tl-big__pts .ic { width: 14px; height: 14px; color: var(--ok); flex: none; }
.tl-big__go { display: inline-flex; align-items: center; gap: .35rem; margin-top: .2rem; font: 600 0.78rem var(--sans); color: var(--acc); }
.tl-big__go .ic { width: 15px; height: 15px; transition: transform .25s var(--ease-out); }
.tl-big:hover .tl-big__go .ic { transform: translateX(4px); }

/* the little drawings */
.tl-art svg { width: 100%; height: auto; }
.tl-art__pg { fill: var(--sheet); stroke: var(--line-2); stroke-width: 1.2; }
.tl-art__ln { fill: var(--ink-3); opacity: .35; }
.tl-art__hl { opacity: 0; }
.tl-art__hl--a { fill: var(--ok); }
.tl-art__hl--b { fill: var(--tape); }
.tl-art__scan { fill: var(--stamp); opacity: .8; }
.tl-art__type { fill: var(--tape); opacity: .6; }
.tl-art__pen { fill: var(--tape); }
.tl-art__stamp { font: 700 13px var(--mono); letter-spacing: .3em; fill: none; stroke: var(--tape); stroke-width: .8; opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .tl-art__scan { animation: tlScan 3.2s var(--ease) infinite; }
  .tl-art__hl--a { animation: tlHl 3.2s infinite; }
  .tl-art__hl--b { animation: tlHl 3.2s .7s infinite; }
  .tl-art__type { animation: tlType 3.4s var(--ease) infinite; }
  .tl-art__pen { animation: tlPen 3.4s var(--ease) infinite; }
}
@media (prefers-reduced-motion: reduce) { .tl-art__hl { opacity: .3; } .tl-art__type { width: 70px; } }
@keyframes tlScan { 0% { transform: translateY(12px); } 70%, 100% { transform: translateY(132px); } }
@keyframes tlHl { 0%, 25% { opacity: 0; } 35%, 85% { opacity: .35; } 100% { opacity: 0; } }
@keyframes tlType { 0% { width: 0; } 70%, 100% { width: 80px; } }
@keyframes tlPen { 0% { transform: translate(-80px, -18px); } 70%, 100% { transform: translate(0, -18px); } }

/* ═══════════ LETTER CHECK ═══════════ */
.lc-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: .9rem; }
@media (max-width: 560px) { .lc-mode { grid-template-columns: 1fr; } }
.lc-tab {
  display: flex; gap: .8rem; align-items: center; text-align: left; cursor: pointer;
  padding: .85rem 1rem; background: var(--sheet); border: 1.5px solid var(--line); border-radius: var(--r-3);
  transition: border-color .2s, background .2s, transform .15s var(--ease);
}
.lc-tab:hover { border-color: var(--line-2); }
.lc-tab:active { transform: scale(.99); }
.lc-tab:focus-visible { outline: 3px solid var(--stamp-soft); outline-offset: 2px; }
.lc-tab b { display: block; font: 400 1.18rem/1.2 var(--display); }
.lc-tab small { color: var(--ink-3); font-size: .84rem; }
.lc-tab__ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sheet-2); color: var(--ink-3); transition: background .2s, color .2s; }
.lc-tab__ic .ic { width: 18px; height: 18px; }
.lc-tab[aria-selected="true"] { border-color: var(--stamp); background: color-mix(in srgb, var(--stamp-soft) 55%, var(--sheet)); box-shadow: var(--shadow-1); }
.lc-tab[aria-selected="true"] .lc-tab__ic { background: var(--stamp); color: var(--sheet); }
.lc-lede { max-width: 62rem; color: var(--ink-2); margin: 0 0 1.4rem; }

.clip { display: grid; gap: 1rem; }
.clip__board { position: relative; background: var(--folder-deep); border-radius: 14px; padding: 2.2rem 1.1rem 1.1rem; box-shadow: var(--shadow-2); }
.clip__clamp { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 150px; height: 38px; border-radius: 8px 8px 14px 14px; background: linear-gradient(180deg, #9aa0ad, #6b7180); box-shadow: inset 0 2px 0 rgb(255 255 255 / .35), 0 3px 6px rgb(0 0 0 / .3); }
.clip__clamp::after { content: ''; position: absolute; left: 50%; top: 9px; width: 46px; height: 10px; transform: translateX(-50%); border-radius: 6px; background: var(--folder-deep); box-shadow: inset 0 1px 2px rgb(0 0 0 / .4); }
.clip__area {
  display: block; width: 100%; min-height: 300px; resize: vertical; border: 0; border-radius: 3px; padding: 1.3rem 1.5rem 1.3rem 3.8rem;
  background-color: var(--sheet); color: var(--ink); font: 400 .95rem/1.7em var(--mono); box-shadow: 0 2px 0 rgb(0 0 0 / .08);
  background-image:
    linear-gradient(90deg, transparent 3.1rem, color-mix(in srgb, var(--tape) 35%, transparent) 3.1rem, color-mix(in srgb, var(--tape) 35%, transparent) calc(3.1rem + 1px), transparent calc(3.1rem + 1px)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.7em - 1px), color-mix(in srgb, var(--stamp) 13%, transparent) calc(1.7em - 1px), color-mix(in srgb, var(--stamp) 13%, transparent) 1.7em);
  background-attachment: local;
}
@media (max-width: 560px) { .clip__area { padding: 1rem 1rem 1rem 2.6rem; font-size: .88rem; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.7em - 1px), color-mix(in srgb, var(--stamp) 13%, transparent) calc(1.7em - 1px), color-mix(in srgb, var(--stamp) 13%, transparent) 1.7em); } }
.clip__area:focus { outline: none; box-shadow: 0 0 0 3px var(--stamp-soft); }
.clip__controls { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem 1.2rem; }
.clip__date { width: 12rem; }
.clip__hint { display: inline-flex; gap: .2rem; align-items: center; font-size: .78rem; color: var(--ink-3); align-self: center; }
@media (hover: none) { .clip__hint { display: none; } }
.clip__samples { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.clip__samples .eyebrow { margin-right: .3rem; }

.lc-results { display: grid; gap: .2rem; scroll-margin-top: 5rem; }
.lc-results:empty { display: none; }
.lc-tip { display: flex; gap: .55rem; align-items: flex-start; margin-top: 1rem; padding: .7rem .9rem; border: 1px dashed var(--line-2); border-radius: var(--r-2); color: var(--ink-2); font-size: .9rem; }
.lc-tip .ic { width: 18px; height: 18px; color: var(--stamp); flex: none; margin-top: .1rem; }
.lc-note { font-size: .82rem; color: var(--ink-3); margin-top: .5rem; }

/* their mistakes */
.lc-ammo { display: grid; gap: .6rem; margin-top: 1.4rem; padding: 1rem 1.2rem; border-radius: var(--r-3); background: color-mix(in srgb, var(--tape-soft) 70%, var(--sheet)); border: 1px solid color-mix(in srgb, var(--tape) 30%, transparent); }
.lc-ammo__h { display: flex; gap: .8rem; align-items: center; }
.lc-ammo__h > .ic { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--tape); color: var(--sheet); flex: none; }
.lc-ammo__h h3 { font: 400 1.2rem/1.2 var(--display); }
.lc-ammo__h .eyebrow { color: var(--tape); }
.lc-ammo > p { font-size: .9rem; color: var(--ink-2); }
.lc-ammo__l { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.lc-ammo__l li { display: grid; grid-template-columns: minmax(0, 9rem) 1fr; gap: .8rem; padding: .5rem .7rem; background: var(--sheet); border-radius: var(--r-2); font-size: .9rem; align-items: baseline; }
.lc-ammo__l b { color: var(--tape); overflow-wrap: anywhere; }
@media (max-width: 560px) { .lc-ammo__l li { grid-template-columns: 1fr; gap: .15rem; } }

/* the verdict on our own letter */
.lc-verdict {
  --c: var(--ok); --c-soft: var(--ok-soft);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2rem 1.6rem; align-items: center;
  margin-top: 1.6rem; padding: 1.3rem 1.4rem; background: var(--sheet); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: var(--r-3); box-shadow: var(--shadow-2);
}
.lc-verdict--warn { --c: var(--warn); --c-soft: var(--warn-soft); }
.lc-verdict--bad { --c: var(--tape); --c-soft: var(--tape-soft); }
.lc-verdict__stamp .stamp { font-size: 1rem; padding: .45rem .8rem .36rem; }
.lc-verdict__t { font: 400 1.5rem/1.15 var(--display); color: var(--c); margin: .15rem 0 .3rem; }
.lc-verdict p:not(.eyebrow) { color: var(--ink-2); font-size: .94rem; }
.lc-verdict__n { display: flex; gap: .5rem; }
.lc-verdict__n span { display: grid; justify-items: center; min-width: 4.6rem; padding: .55rem .5rem; border-radius: var(--r-2); background: var(--sheet-2); }
.lc-verdict__n b { font: 400 1.9rem/1 var(--display); }
.lc-verdict__n span:first-child b { color: var(--tape); }
.lc-verdict__n span:nth-child(2) b { color: var(--warn); }
.lc-verdict__n small { font: 600 0.78rem var(--sans); color: var(--ink-3); margin-top: .2rem; }
@media (max-width: 800px) { .lc-verdict { grid-template-columns: 1fr; } .lc-verdict__stamp { display: none; } }
@media (max-width: 400px) { .lc-verdict__n span { min-width: 0; flex: 1; } }

/* the time bars */
.lc-bars { display: grid; gap: .6rem; }
.lc-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 14rem) auto; gap: .5rem 1rem; align-items: center; padding: .75rem .9rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-2); }
.lc-bar__track { position: relative; height: 12px; border-radius: 99px; background: var(--sheet-2); overflow: visible; }
.lc-bar__track i { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--ok); transform-origin: left; }
.lc-bar.is-late .lc-bar__track i { background: var(--tape); }
/* the black tick is the bar itself — past it, the notice is late */
.lc-bar__track::after { content: ''; position: absolute; top: -5px; bottom: -5px; left: calc(var(--mark, 100%) - 1px); width: 2px; background: var(--ink); border-radius: 1px; }
.lc-bar__t { display: grid; font-size: .88rem; }
.lc-bar__t b { font-size: .92rem; }
.lc-bar__t span { color: var(--ink-3); }
.lc-bar__v { display: inline-flex; align-items: center; gap: .3rem; font: 600 0.78rem var(--sans); white-space: nowrap; }
.lc-bar__v .ic { width: 16px; height: 16px; }
.lc-bar.is-ok .lc-bar__v { color: var(--ok); }
.lc-bar.is-late .lc-bar__v { color: var(--tape); }
@media (prefers-reduced-motion: no-preference) { .lc-bar__track i { animation: lcGrow .9s var(--ease-out) both; } }
@keyframes lcGrow { from { transform: scaleX(0); } }
@media (max-width: 700px) { .lc-bar { grid-template-columns: 1fr auto; } .lc-bar__track { grid-column: 1 / -1; grid-row: 2; } }

/* CEES */
.lc-cees { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
@media (max-width: 900px) { .lc-cees { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .lc-cees { grid-template-columns: 1fr; } }
.lc-c { --c: var(--ok); display: grid; gap: .55rem; align-content: start; padding: .9rem 1rem; background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--r-3); }
.lc-c--ok { --c: var(--stamp); }
.lc-c--thin { --c: var(--warn); }
.lc-c--none { --c: var(--tape); background: color-mix(in srgb, var(--tape-soft) 35%, var(--sheet)); }
.lc-c--opt { --c: var(--ink-3); }
.lc-c__opt { font-size: .8rem; color: var(--ink-3); font-style: italic; }
.lc-c__top { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; }
.lc-c__k { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--c); color: var(--sheet); font: 400 1.4rem/1 var(--display); }
.lc-c__top b { font-size: .98rem; }
.lc-c__pips { display: flex; gap: 3px; }
.lc-c__pips i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--c); }
.lc-c__pips i.on { background: var(--c); }
.lc-c__miss { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .84rem; color: var(--ink-2); }
.lc-c__miss li { display: grid; grid-template-columns: .9rem 1fr; gap: .3rem; }
.lc-c__miss li::before { content: '–'; color: var(--c); font-weight: 700; }
.lc-c__ok { display: flex; gap: .35rem; align-items: center; font-size: .86rem; color: var(--ok); }
.lc-c__ok .ic { width: 15px; height: 15px; }
@media (prefers-reduced-motion: no-preference) {
  .lc-c { animation: fileIn .55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }
  .lc-c__pips i.on { animation: pop .35s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 300ms); }
}

/* what to fix */
.lc-issues { display: grid; gap: .55rem; }
.lc-is { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start; padding: .8rem 1rem; background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--r-2); }
.lc-is--high { border-left-color: var(--tape); background: color-mix(in srgb, var(--tape-soft) 30%, var(--sheet)); }
.lc-is__ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--warn-soft); color: var(--warn); }
.lc-is--high .lc-is__ic { background: var(--tape-soft); color: var(--tape); }
.lc-is__ic .ic { width: 16px; height: 16px; }
.lc-is h4 { font-size: .98rem; margin-bottom: .2rem; }
.lc-is p { font-size: .9rem; color: var(--ink-2); }
.lc-good { margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--r-3); background: var(--ok-soft); }
.lc-good .eyebrow { color: var(--ok); }
.lc-good ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; }
.lc-good li { display: flex; gap: .45rem; align-items: baseline; }
.lc-good .ic { width: 15px; height: 15px; color: var(--ok); flex: none; transform: translateY(2px); }

/* the red pen */
.lc-pen { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.lc-pen li { display: grid; gap: .2rem; padding: .6rem .8rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-2); font-size: .88rem; }
.lc-pen b { font-family: var(--mono); color: var(--tape); text-decoration: line-through 2px; text-decoration-color: color-mix(in srgb, var(--tape) 60%, transparent); }
.lc-pen span { color: var(--ink-2); }

.lc-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-bottom: .6rem; font-size: .8rem; color: var(--ink-3); }
.lc-legend span { display: inline-flex; gap: .35rem; align-items: center; }
.lc-legend i { font-style: normal; font-size: .78rem; }

/* the reading: summary, clocks, clauses, marks */
.an-sum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.4rem; align-items: center; padding: 1.3rem 1.4rem; margin-top: 1.6rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-2); }
@media (max-width: 800px) { .an-sum { grid-template-columns: 1fr; } }
.an-sum__stamps { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; }
.an-sum__stamps .stamp { font-size: .9rem; padding: .4rem .75rem .32rem; }
@media (max-width: 560px) { .an-sum { padding: 1rem; overflow: hidden; } .an-sum__stamps .stamp { font-size: .74rem; white-space: normal; max-width: 92%; } }
.an-sum__meta { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; font-size: .92rem; }
.an-sum__meta dt { font: 600 0.78rem/1.6 var(--sans); color: var(--ink-3); }
.an-sum__meta dd { margin: 0; overflow-wrap: anywhere; }
.an-sum__subj { font-family: var(--serif); font-size: 1.02rem; }

.an-clocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: .8rem; }
.an-clock { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .8rem .9rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-3); }
.an-clock__ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 3px solid var(--stamp); color: var(--stamp); }
.an-clock__ring b { font: 400 1.6rem/1 var(--display); }
.an-clock__ring small { font: 600 0.78rem var(--sans); }
.an-clock.is-hot .an-clock__ring { border-color: var(--tape); color: var(--tape); }
@media (prefers-reduced-motion: no-preference) { .an-clock.is-hot .an-clock__ring { animation: lcPulse 1.6s ease-in-out infinite; } }
@keyframes lcPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--tape) 18%, transparent); } }
.an-clock__body { display: grid; gap: .15rem; font-size: .9rem; min-width: 0; }
.an-clock__body small { color: var(--ink-3); font-size: .8rem; }
@media (max-width: 520px) { .an-clock { grid-template-columns: auto 1fr; } .an-clock .btn { grid-column: 1 / -1; justify-self: start; } }

.an-cites { display: grid; gap: .55rem; }
.an-cite { background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--r-2); padding: .7rem .9rem; display: grid; gap: .45rem; }
.an-cite--amended { border-left-color: var(--tape); }
.an-cite--title { border-left-color: var(--warn); }
.an-cite--spec, .an-cite--other { border-left-color: var(--stamp-2); }
.an-cite--fidic, .an-cite--missing, .an-cite--wrong { border-left-color: var(--tape); background: color-mix(in srgb, var(--tape-soft) 40%, var(--sheet)); }
.an-cite__head { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.an-cite__raw { font-weight: 700; font-size: .92rem; }
.an-cite__title { flex: 1; min-width: 12rem; font-size: .92rem; color: var(--ink-2); }
.an-cite__title b { font-family: var(--mono); color: var(--stamp); margin-right: .2rem; }
.an-cite__note { font-size: .9rem; }
.an-cite__quoted { font-size: .84rem; color: var(--ink-3); }
.an-cite__quoted q { font-style: italic; margin-right: .5rem; }
.an-cite__more summary { cursor: pointer; font: 600 0.78rem var(--sans); color: var(--stamp); list-style: none; }
.an-cite__more summary::-webkit-details-marker { display: none; }
.an-cite__more summary::before { content: '+ '; }
.an-cite__more[open] summary::before { content: '\2212  '; }
.an-cite__more > div { display: grid; gap: .5rem; padding-top: .5rem; justify-items: start; }
.an-cite__gist { font-family: var(--serif); }
.an-cite__text { font: 400 .86rem/1.55 var(--serif); color: var(--ink-2); padding-left: .8rem; border-left: 2px solid var(--line-2); }
.an-alert { display: flex; gap: .5rem; align-items: flex-start; margin-top: .6rem; padding: .7rem .9rem; border-radius: var(--r-2); background: var(--tape-soft); color: var(--tape); font-weight: 600; font-size: .92rem; }
.an-alert .ic { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.an-specs { margin-top: .8rem; padding: .7rem .9rem; background: var(--sheet-2); border-radius: var(--r-2); font-size: .9rem; }
.an-specs ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.an-refs { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.an-refs li { display: grid; grid-template-columns: minmax(0, 18rem) 1fr; gap: .8rem; padding: .5rem .8rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-2); align-items: baseline; }
.an-refs__no { font-size: .8rem; color: var(--ink-2); overflow-wrap: anywhere; }
.an-refs a { color: var(--ink); text-decoration: none; display: grid; }
.an-refs a:hover b { color: var(--stamp); }
.an-refs small { color: var(--ink-3); font: 400 .74rem var(--mono); }
@media (max-width: 700px) { .an-refs li { grid-template-columns: 1fr; gap: .2rem; } }
.an-topics .chip .ic { width: 14px; height: 14px; }
.an-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; margin-top: 1rem; }
.an-col { padding: 1rem 1.1rem; border-radius: var(--r-3); }
.an-col--use { background: var(--ok-soft); }
.an-col--use .plain__h { color: var(--ok); }
.an-col--watch { background: var(--tape-soft); }
.an-col--watch .plain__h { color: var(--tape); }
.an-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.an-col li { display: grid; grid-template-columns: auto 1fr; gap: .2rem .6rem; align-items: baseline; font-size: .9rem; }
.an-col li small { grid-column: 2; }
.an-unm { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .9rem; }
.an-plan { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.an-plan li { counter-increment: s; display: grid; grid-template-columns: 2.2rem minmax(0, 9rem) 1fr; gap: .6rem; align-items: baseline; padding: .6rem .8rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-2); font-size: .92rem; }
.an-plan li::before { content: counter(s); font: 400 1.4rem/1 var(--display); color: var(--stamp); }
.an-plan__from { font: 600 0.78rem var(--sans); color: var(--ink-3); }
.an-plan li.an-plan__high::before, .an-plan li.an-plan__check::before { color: var(--tape); }
@media (max-width: 700px) { .an-plan li { grid-template-columns: 2rem 1fr; } .an-plan__from, .an-plan li > span:last-child { grid-column: 2; } }
.an-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1rem; padding: 1.1rem 1.2rem; background: var(--ink); color: var(--sheet); border-radius: var(--r-3); }
.an-cta > div { flex: 1; min-width: 14rem; }
.an-cta .eyebrow { color: color-mix(in srgb, var(--sheet) 60%, transparent); }
.an-cta__t { font: 400 1.4rem var(--display); margin: .2rem 0; }
.an-cta .muted { color: color-mix(in srgb, var(--sheet) 70%, transparent); font-size: .9rem; }
.an-cta .btn:not(.btn--stamp) { --bg: transparent; --fg: var(--sheet); --bd: color-mix(in srgb, var(--sheet) 40%, transparent); }
.an-letter { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 .92rem/1.75 var(--mono); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-2); padding: 1.4rem 1.6rem; max-height: 70vh; overflow: auto; box-shadow: var(--shadow-1); }
@media (max-width: 560px) { .an-letter { padding: 1rem; font-size: .84rem; } }
.mk { border-radius: 3px; padding: 0 .12em; }
.mk--cite { font-weight: 700; color: var(--ok); background: var(--ok-soft); text-decoration: none; }
.mk--cite.mk--amended { color: var(--tape); background: var(--tape-soft); }
.mk--cite.mk--title { color: var(--warn); background: var(--warn-soft); }
/* a clause of the specification or of another document: not a mistake, just not this contract */
.mk--cite.mk--spec, .mk--cite.mk--other { font-weight: 600; color: var(--stamp); background: var(--stamp-soft); }
.mk--cite.mk--fidic, .mk--cite.mk--missing, .mk--cite.mk--wrong { color: var(--sheet); background: var(--tape); }
.mk--intent { background: var(--marker); color: inherit; }
.mk--letter { text-decoration: underline wavy color-mix(in srgb, var(--stamp) 60%, transparent); text-underline-offset: 3px; }
.mk--spec { border-bottom: 2px dotted var(--stamp-2); }
.mk--weak { text-decoration: underline wavy var(--tape); text-decoration-thickness: 1.5px; text-underline-offset: 4px; background: color-mix(in srgb, var(--tape-soft) 60%, transparent); cursor: help; }

/* ═══════════ DRAFTING DESK ═══════════ */
.dr-open { margin: 0 0 1.6rem; }
.dr-open__g { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .55rem; margin-top: .5rem; }
.dr-open__c { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .65rem .8rem; background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--tape); border-radius: var(--r-2); color: var(--ink); text-decoration: none; transition: transform .2s var(--ease-out), box-shadow .2s; }
.dr-open__c:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.dr-open__c b { display: block; font-size: .92rem; }
.dr-open__c small { color: var(--ink-3); font-size: .78rem; }
.dr-open__c > .ic { width: 15px; height: 15px; color: var(--ink-3); }
.dr-open__ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--tape-soft); color: var(--tape); }
.dr-open__ic .ic { width: 15px; height: 15px; }
.dr-grid .ltr { transition: transform .2s var(--ease-out), box-shadow .2s; }
.dr-grid .ltr:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

.w-layout { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); gap: 1.6rem; align-items: start; }
@media (max-width: 1080px) { .w-layout { grid-template-columns: 1fr; } }
.w-form { display: grid; gap: 1rem; min-width: 0; }
.w-tpl { display: grid; gap: .5rem; padding: 1rem 1.1rem; background: var(--ink); color: var(--sheet); border-radius: var(--r-3); }
.w-tpl .eyebrow { color: color-mix(in srgb, var(--sheet) 60%, transparent); }
.w-tpl__t { font: 400 1.6rem/1.1 var(--display); }
.w-tpl p { font-size: .92rem; color: color-mix(in srgb, var(--sheet) 82%, transparent); }
.w-tpl a.ref { color: var(--marker); }
.w-set { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--sheet); padding: .9rem 1rem 1rem; margin: 0; display: grid; gap: .75rem; min-width: 0; }
.w-set legend, .w-more summary { font: 600 0.78rem var(--sans); color: var(--ink-2); padding: 0 .3rem; }
.w-more summary { cursor: pointer; padding: .1rem 0; }
.w-more[open] summary { margin-bottom: .4rem; }
.w-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 520px) { .w-grid { grid-template-columns: 1fr; } }
.form__check { padding: .2rem 0; }
.checklist li.is-done::before { content: '✓'; color: var(--ok); }
.checklist li.is-open::before { content: '!'; color: var(--tape); }
.checklist li.is-bad::before { content: '✕'; color: var(--tape); }
.checklist li.is-q::before { content: '□'; color: var(--stamp); }
.phr { display: grid; gap: .3rem; margin-top: .6rem; }
.phr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.phr__b { width: 100%; text-align: left; background: var(--sheet-2); border: 1px solid transparent; border-radius: 5px; padding: .35rem .55rem; font: 400 .84rem/1.4 var(--mono); color: var(--ink); cursor: copy; }
.phr__b:hover { border-color: var(--stamp); }

/* the clock, first thing in the form */
.dr-clockset { border-color: color-mix(in srgb, var(--tape) 45%, transparent); background: color-mix(in srgb, var(--tape-soft) 35%, var(--sheet)); }
.dr-clockset legend { color: var(--tape); }
.dr-clockset__p { font-size: .9rem; color: var(--ink-2); }
.dr-clock:empty { display: none; }
.dr-due { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .7rem .8rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-2); }
.dr-due__n { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 3px solid var(--ok); color: var(--ok); text-align: center; }
.dr-due__n b { font: 400 1.5rem/1 var(--display); }
.dr-due__n small { font: 600 0.78rem var(--sans); max-width: 52px; }
.dr-due > div:nth-child(2) { display: grid; }
.dr-due__d { font: 400 1.25rem/1.2 var(--display); }
.dr-due small { color: var(--ink-3); font-size: .8rem; }
.dr-due.is-hot .dr-due__n { border-color: var(--warn); color: var(--warn); }
.dr-due.is-late .dr-due__n { border-color: var(--tape); color: var(--tape); background: var(--tape-soft); }
@media (prefers-reduced-motion: no-preference) { .dr-due.is-hot .dr-due__n, .dr-due.is-late .dr-due__n { animation: lcPulse 1.6s ease-in-out infinite; } }
@media (max-width: 420px) { .dr-due { grid-template-columns: auto 1fr; } .dr-due .btn { grid-column: 1 / -1; justify-self: start; } }

/* the right-hand column: actions, pre-flight, the paper */
.w-side { display: grid; gap: .8rem; min-width: 0; }
@media (min-width: 1081px) {
  .w-side { position: sticky; top: 4.8rem; max-height: calc(100vh - 5.6rem); overflow-y: auto; overscroll-behavior: contain; padding: 0 .4rem 1.6rem; margin: 0 -.4rem; scrollbar-width: thin; }
  .w-actions { position: sticky; top: 0; z-index: 2; padding: .3rem 0 .5rem; background: var(--paper); }
}
.w-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.dr-jump { display: none; }
@media (max-width: 1080px) { .dr-jump { display: inline-flex; justify-self: start; } .dr-jump .ic { transform: rotate(90deg); } .w-side { scroll-margin-top: 4.5rem; } }

.dr-pre { display: grid; gap: .6rem; padding: .85rem 1rem; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-3); }
.dr-pre:empty { display: none; }
.dr-pre__h { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.dr-pre__v { font: 600 0.78rem var(--sans); padding: .22rem .55rem; border-radius: 99px; background: var(--ok-soft); color: var(--ok); transition: background .3s, color .3s; }
.dr-pre__v--warn { background: var(--warn-soft); color: var(--warn); }
.dr-pre__v--bad { background: var(--tape-soft); color: var(--tape); }
.dr-pre__cees { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.dr-pip { --c: var(--ok); display: grid; justify-items: center; gap: .1rem; padding: .4rem .2rem .35rem; border-radius: var(--r-2); border-bottom: 3px solid var(--c); background: var(--sheet-2); cursor: help; transition: border-color .3s; }
.dr-pip b { font: 400 1.2rem/1 var(--display); color: var(--c); transition: color .3s; }
.dr-pip small { font: 600 0.78rem var(--sans); color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-pip--ok { --c: var(--stamp); }
.dr-pip--thin { --c: var(--warn); }
.dr-pip--none { --c: var(--tape); }
.dr-pip--opt { --c: var(--line-2); }
.dr-pip--opt b { color: var(--ink-3); }
.dr-pre__l { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .86rem; }
.dr-pre__l li { display: grid; grid-template-columns: 1.2rem 1fr; gap: .35rem; }
.dr-pre__l li::before { font-weight: 700; }
.dr-pre__l li.is-done::before { content: '✓'; color: var(--ok); }
.dr-pre__l li.is-open::before { content: '!'; color: var(--warn); }
.dr-pre__l li.is-bad::before { content: '✕'; color: var(--tape); }
.dr-pre__go { justify-self: start; }

/* the letter on paper */
.paper { position: relative; background: #FFFEFB; color: #1B1D26; border-radius: 2px; padding: 2.4rem 2.6rem 2.8rem; box-shadow: 0 1px 0 rgb(0 0 0 / .04), 0 20px 40px -20px rgb(0 0 0 / .45); font: 400 .9rem/1.6 'Libre Caslon Text', Georgia, serif; overflow: hidden; overflow-wrap: anywhere; }
:root[data-theme="dark"] .paper { background: #F1ECE0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .paper { background: #F1ECE0; } }
.paper::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: repeating-linear-gradient(90deg, #B3261E 0 36px, #1C2033 36px 44px); opacity: .85; }
.paper__head { text-align: center; padding-bottom: .8rem; border-bottom: 2px solid #1C2033; margin-bottom: .7rem; }
.paper__co { font: 700 1.15rem/1.2 'Hanken Grotesk', sans-serif; letter-spacing: .08em; }
.paper__proj { font: 700 .78rem 'Hanken Grotesk', sans-serif; letter-spacing: .14em; margin-top: .2rem; }
.paper__lot { font-size: .8rem; font-style: italic; color: #555; }
.paper__refline { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font: 400 .8rem 'Courier Prime', monospace; margin-bottom: 1rem; }
.paper__to { margin-bottom: .6rem; }
.paper__meta { font: 400 .8rem 'Courier Prime', monospace; margin-bottom: .3rem; }
.paper__refs { display: grid; font: 400 .8rem/1.5 'Courier Prime', monospace; margin-bottom: .4rem; }
.paper__ref { padding-left: 1.2rem; }
.paper__subj { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin: .9rem 0; }
.paper__p { margin: 0 0 .7rem; text-align: justify; hyphens: auto; }
.paper__blank { background: #FBE7A1; color: #6B4D00; border-radius: 3px; padding: 0 .25rem; font: 700 .78rem 'Courier Prime', monospace; }
.paper a.ref { color: #3A399C; }
.paper a.ref--pcc { color: #B3261E; }
.paper__sign { margin: 1.6rem 0 .8rem; }
.paper__cc { font-size: .82rem; }
.paper__stamp { position: absolute; right: 1.6rem; top: 5.6rem; font: 700 1.3rem 'Courier Prime', monospace; letter-spacing: .3em; color: #B3261E; border: 3px double #B3261E; padding: .25rem .6rem; transform: rotate(12deg); opacity: .35; pointer-events: none; }
@media (max-width: 560px) { .paper { padding: 1.8rem 1.1rem 2rem; font-size: .85rem; } .paper__p { text-align: left; } .paper__stamp { top: 4.6rem; right: .8rem; font-size: 1rem; } }

/* ways in from elsewhere */
.mdl__acts { display: flex; flex-wrap: wrap; gap: .4rem; }
.side-links__dr { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.side-links a.side-links__pen { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--tape); background: var(--tape-soft); }
.side-links a.side-links__pen .ic { width: 14px; height: 14px; }

@media print {
  body * { visibility: hidden !important; }
  .paper, .paper * { visibility: visible !important; }
  .w-side { position: static !important; max-height: none !important; overflow: visible !important; }
  .paper { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; padding: 0; background: #fff !important; }
  .paper::before, .paper__stamp { display: none; }
  .paper__blank { background: none; }
}
