/* OBSCURA OS: Erase.

   One window, as Books and Case are: the top bar across, with the File and
   Help menus; the places down the left; the place itself in the middle; a
   status line along the foot. A request is read as a letter is: the
   timeline down the left in date order, the deadline and the letters to
   send in a column beside it. A letter is shown as the text that will be
   sent, in the reading face, on a ruled sheet.

   On a phone the places become a row of tabs under the bar, as in Books,
   and the request's column moves under its timeline.

   Every colour, size, corner and duration is a theme.css token, so Erase
   follows the colourway, the dark mode and the motion setting the rest of
   the site does. */

body.er-app { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--paper); color: var(--ink); font: var(--text-sm)/var(--leading-ui) var(--font-sans); }
.er *, .er *::before, .er *::after { box-sizing: border-box; }
.er :where(button, input, select, textarea) { font: inherit; color: inherit; }
.er-grow { flex: 1; }
.er-sprite { display: none; }
.er svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.er code, .er kbd { font: var(--text-xs) var(--font-mono); }
.er kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink-soft); font-size: var(--text-2xs); font-weight: 600; }

.er { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }

/* ---------------------------------------------------------------- top bar */

.er-top { display: flex; align-items: center; gap: var(--space-2); min-width: 0; padding: 6px 10px; background: var(--paper-raised); border-bottom: 1px solid var(--rule); }
.er-home { flex: none; }
.er-brand { margin: 0 var(--space-1) 0 0; font-size: var(--text-md); font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.er-menubar { display: flex; gap: 2px; }
.er-menubar > div { position: relative; }
.er-mb { min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); font-weight: 600; cursor: pointer; }
.er-mb:hover:not(:disabled), .er-mb[aria-expanded="true"] { background: var(--paper-inset); color: var(--ink); }
.er-mb:disabled { opacity: .45; cursor: default; }
.er-state { margin: 0; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); color: var(--ink-faint); }
.er-state[data-kind="bad"] { color: var(--danger); }
.er-icon-btn { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink-soft); cursor: pointer; }
.er-icon-btn:hover { background: var(--paper-inset); color: var(--ink); }
.er-icon-btn svg { width: 18px; height: 18px; }

.er-menu { position: absolute; z-index: 60; top: calc(100% + var(--space-1)); left: 0; min-width: 260px; max-width: min(360px, calc(100vw - 20px)); padding: 6px; border-radius: var(--radius-lg); background: var(--paper-raised); box-shadow: 0 0 0 1px var(--rule), 0 14px 36px rgba(16, 16, 24, .18); animation: er-pop var(--dur-3) var(--ease-standard); }
.er-menu[hidden] { display: none; }
.er-menubar > div:last-child > .er-menu { left: auto; right: 0; }
/* On a phone the Edit menu opens to the left of its button, as Help's
   does, so neither runs off the right of the screen. */
@media (max-width: 520px) {
  .er-menu { min-width: 220px; }
  .er-menubar > div:nth-child(2) > .er-menu { left: auto; right: 0; }
}
.er-menu button { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: var(--space-3); min-height: 34px; padding: 6px 11px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; cursor: pointer; }
.er-menu button:hover, .er-menu button:focus-visible { background: var(--paper-inset); outline: none; }
.er-menu button:disabled { opacity: .45; cursor: default; }
.er-menu button span { font-size: var(--text-2xs); color: var(--ink-faint); white-space: nowrap; }
.er-menu hr { margin: 6px var(--space-1); border: 0; border-top: 1px solid var(--rule); }
@keyframes er-pop { from { opacity: 0; transform: translateY(-4px); } }

/* ------------------------------------------------------------ the places */

.er-body { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 0; }
.er-nav { display: flex; flex-direction: column; gap: 1px; min-height: 0; padding: var(--space-3) var(--space-2); overflow-y: auto; border-right: 1px solid var(--rule); background: var(--paper-raised); }
.er-nav a { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--ink-soft); font-weight: 600; text-decoration: none; white-space: nowrap; }
.er-nav a svg { flex: none; width: 18px; height: 18px; color: var(--ink-faint); }
.er-nav a:hover { background: var(--paper-inset); color: var(--ink); }
.er-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.er-nav a[aria-current="page"] svg { color: var(--accent-strong); }
.er-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--paper-inset); color: var(--ink-soft); font-size: var(--text-2xs); line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.er-count.is-bad { background: var(--danger); color: var(--on-danger); }
.er-nav-sep { height: 1px; margin: var(--space-2) 10px; background: var(--rule); }

.er-main { position: relative; min-height: 0; overflow: hidden; }
.er-nav[hidden] + .er-main { grid-column: 1 / -1; }
.er-boot { margin: var(--space-6); color: var(--ink-faint); }
.er-page { height: 100%; overflow-y: auto; padding: var(--space-5) max(var(--space-5), calc((100% - 1080px) / 2)) var(--space-7); animation: er-arrive var(--dur-4) var(--ease-standard); }
.er-page.is-wide { padding-left: max(var(--space-5), calc((100% - 1280px) / 2)); padding-right: max(var(--space-5), calc((100% - 1280px) / 2)); }
@keyframes er-arrive { from { opacity: 0; transform: translateY(4px); } }
.er-h { margin: 0 0 var(--space-1); font: 650 var(--text-2xl)/1.15 var(--font-headline); letter-spacing: -.01em; overflow-wrap: anywhere; }
.er .er-h:focus, .er .er-h:focus-visible { outline: none; }
.er-h2 { margin: var(--space-6) 0 var(--space-2); font-size: var(--text-md); font-weight: 650; }
.er-lead { max-width: var(--measure); margin: 0 0 var(--space-4); font-size: var(--text-sm); line-height: var(--leading-prose); color: var(--ink-soft); }
.er-hint { max-width: var(--measure); margin: var(--space-1) 0 var(--space-3); font-size: var(--text-xs); line-height: 1.5; color: var(--ink-faint); }
.er-hint a, .er-lead a, .er-note a, .er-head p a, .er-crumb a { color: var(--accent-strong); }
.er-err { color: var(--danger); }
.er-empty { margin: var(--space-5) 0; padding: var(--space-5) var(--space-4); border: 1px dashed var(--rule-strong); border-radius: var(--radius-md); color: var(--ink-soft); }
.er-empty p { max-width: 60ch; margin: 0 0 var(--space-3); line-height: 1.5; }
.er-note { max-width: var(--measure); margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--rule-strong); background: var(--paper-inset); font-size: var(--text-xs); line-height: 1.55; color: var(--ink-soft); }
.er-note b { color: var(--ink); }
.er-note.is-old { border-left-color: var(--warn); }
.er-alert { max-width: var(--measure); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border-left: 3px solid var(--danger); background: var(--paper-inset); font-size: var(--text-xs); color: var(--ink); }
.er-alert.is-soon { border-left-color: var(--warn); }

.er-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-4); }
.er-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.er-head p { margin: 2px 0 0; font-size: var(--text-xs); color: var(--ink-faint); }
.er-head p .er-tag { margin-left: var(--space-2); }
.er-crumb { margin: 0 0 2px !important; }
.er-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.er-head2 { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-5) 0 var(--space-2); }
.er-head2:first-child { margin-top: 0; }
.er-head2 .er-h2 { margin: 0; flex: 1; }

/* ---------------------------------------------------------------- controls */

.er-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 5px 13px; border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--paper-raised); color: var(--ink); font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color var(--dur-2) var(--ease-standard), border-color var(--dur-2) var(--ease-standard); }
.er-btn svg { width: 16px; height: 16px; }
.er-btn:hover:not(:disabled) { background: var(--paper-inset); }
.er-btn:active:not(:disabled) { transform: translateY(1px); }
.er-btn:disabled { opacity: .5; cursor: default; }
.er-btn-main { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.er-btn-main:hover:not(:disabled) { background: var(--accent-strong); }
.er-btn-danger { color: var(--danger); }
.er-btn-danger-main { border-color: var(--danger); background: var(--danger); color: var(--on-danger); }
.er-btn-danger-main:hover:not(:disabled) { background: var(--danger); filter: brightness(.92); }
.er-btn-sm { min-height: 28px; padding: 2px 9px; font-size: var(--text-xs); }
.er-link { min-height: 28px; padding: 0 var(--space-1); border: 0; background: none; color: var(--accent-strong); font-size: var(--text-xs); font-weight: 600; cursor: pointer; text-decoration: none; }
.er-link:hover { text-decoration: underline; }
.er-link.er-danger { color: var(--danger); }
.er :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.er-seg { display: inline-flex; gap: 2px; margin: 0 0 var(--space-3); padding: 2px; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-inset); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.er-seg::-webkit-scrollbar { display: none; }
.er-seg button { flex: none; min-height: 28px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; cursor: pointer; }
.er-seg button:hover, .er-seg a:hover { color: var(--ink); }
.er-seg a { display: inline-flex; align-items: center; flex: none; min-height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--ink-soft); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; text-decoration: none; }
.er-seg [aria-pressed="true"], .er-seg a[aria-current="true"] { background: var(--paper-raised); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 1px 2px rgba(0, 0, 0, .08); }

.er-field { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: var(--text-xs); color: var(--ink-soft); min-width: 0; }
.er-field > span { font-weight: 600; }
.er-field small { color: var(--ink-faint); font-size: var(--text-2xs); line-height: 1.4; }
.er-field[hidden] { display: none; }
.er input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .er select, .er textarea, .er-dialog input:not([type="checkbox"]), .er-dialog select, .er-dialog textarea { width: 100%; min-height: 34px; padding: 5px var(--space-2); border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); font: inherit; font-size: var(--text-sm); }
.er textarea, .er-dialog textarea { resize: vertical; line-height: 1.45; }
.er input:focus, .er select:focus, .er textarea:focus, .er-dialog input:focus, .er-dialog select:focus, .er-dialog textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-border); outline-offset: 0; }
.er [aria-invalid="true"], .er-dialog [aria-invalid="true"] { border-color: var(--danger) !important; }
.er-check { display: flex; align-items: flex-start; gap: 8px; min-height: 34px; padding: 7px 0; font-size: var(--text-xs); color: var(--ink-soft); cursor: pointer; }
.er-check input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); }
.er-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-4); max-width: 760px; }
.er-form .is-wide { grid-column: 1 / -1; }
.er-stack { display: flex; flex-direction: column; gap: var(--space-2); }
.er-stack .er-btn { align-self: flex-start; }
.er-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
.er-fs { min-width: 0; margin: 0 0 var(--space-4); padding: 0; border: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.er-fs legend { margin: 0 0 var(--space-2); padding: 0; font-size: var(--text-md); font-weight: 650; color: var(--ink); }
.er-sub-fs { gap: 0; margin: 0; }
.er-sub-fs legend { font-size: var(--text-xs); color: var(--ink-soft); }
.er-form-err { min-height: 0; margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--danger); }
.er-form-err:empty { display: none; }
.er-id-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--space-2); align-items: end; margin: 0 0 var(--space-2); }

/* ---------------------------------------------------------------- start */

.er-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 var(--space-5); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); }
.er-start > section { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-4); border-left: 1px solid var(--rule); }
.er-start > section:first-child { border-left: 0; }
.er-start h3 { margin: 0; font-size: var(--text-md); font-weight: 650; }
.er-start p { margin: 0; font-size: var(--text-xs); line-height: 1.55; color: var(--ink-soft); }
.er-start > section > .er-btn { align-self: flex-start; margin-top: auto; }

/* ---------------------------------------------------------------- tables */

.er-scroll { overflow-x: auto; margin: 0 0 var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); }
.er-table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.er-table th, .er-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.er-table th { position: sticky; top: 0; z-index: 1; background: var(--paper-raised); color: var(--ink-faint); font-size: var(--text-2xs); font-weight: 650; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.er-table tbody tr:last-child td { border-bottom: 0; }
.er-table .d { white-space: nowrap; font-variant-numeric: tabular-nums; }
.er-table .t a { color: var(--ink); font-weight: 600; text-decoration: none; }
.er-table .t a:hover { text-decoration: underline; }
.er-table tr[data-open] { cursor: pointer; }
.er-table tr[data-open]:hover td { background: var(--paper-inset); }
.er-sub { display: none; }
.er-sub2 { display: block; margin-top: 1px; color: var(--ink-faint); font-size: var(--text-2xs); }

.er-tag { display: inline-block; font-size: var(--text-2xs); font-weight: 650; letter-spacing: .02em; color: var(--ink-soft); white-space: nowrap; }
.er-tag::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.er-tag[data-s="overdue"] { color: var(--danger); }
.er-tag[data-s="overdue"]::before { background: var(--danger); }
.er-tag[data-s="extended"]::before { background: var(--warn); }
.er-tag[data-s="answered"]::before { background: var(--good); }
.er-tag[data-s="refused"]::before { background: var(--danger); }
.er-tag[data-s="draft"]::before { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-faint); }

/* ------------------------------------------------------------ composing */

.er-compose { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-6); align-items: start; }
.er-preview { position: sticky; top: 0; min-width: 0; }
.er-preview h3 { margin: 0 0 var(--space-2); font-size: var(--text-2xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.er-subject { margin: 0 0 var(--space-2); font-weight: 650; overflow-wrap: anywhere; }
.er-subject span { margin-right: var(--space-2); font-size: var(--text-2xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.er-letter { max-height: 62vh; margin: 0; padding: var(--space-4) var(--space-5); overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); font: var(--text-sm)/1.6 var(--font-serif); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* ------------------------------------------------------------ a request */

.er-doc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-6); align-items: start; }
.er-side { display: flex; flex-direction: column; gap: var(--space-3); }
.er-panel { padding: var(--space-3) var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); }
.er-panel h3 { margin: 0 0 var(--space-2); font-size: var(--text-2xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.er-panel p { margin: 0 0 var(--space-2); font-size: var(--text-xs); line-height: 1.5; color: var(--ink-soft); }
.er-panel .er-hint { margin: var(--space-2) 0 0; }
.er-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.er-actions .er-btn { justify-content: flex-start; white-space: normal; text-align: left; line-height: 1.3; }
.er-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px var(--space-3); margin: 0; font-size: var(--text-xs); }
.er-facts dt { color: var(--ink-faint); }
.er-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.er-sources { margin: 0; padding: 0; list-style: none; font-size: var(--text-xs); }
.er-sources li { padding: 4px 0; border-bottom: 1px solid var(--rule); line-height: 1.4; }
.er-sources li:last-child { border-bottom: 0; }
.er-sources a { color: var(--accent-strong); }
.er-flags { max-width: var(--measure); margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-4) var(--space-2) var(--space-5); border-left: 3px solid var(--warn); background: var(--paper-inset); font-size: var(--text-xs); line-height: 1.5; }
.er-flags li { margin: 2px 0; }

.er-timeline { margin: 0 0 var(--space-3); padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.er-timeline li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) auto; gap: var(--space-3); align-items: baseline; padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.er-timeline time { color: var(--ink-faint); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.er-timeline b { font-weight: 650; }
.er-timeline span { color: var(--ink-soft); font-size: var(--text-xs); }
.er-timeline p { margin: 2px 0 0; color: var(--ink-soft); font-size: var(--text-xs); line-height: 1.5; }
.er-timeline li[data-type="answered"] b { color: var(--good); }
.er-timeline li[data-type="extended"] b { color: var(--warn); }
.er-ev-files { margin: 4px 0 0; padding: 0 0 0 1.2em; font-size: var(--text-xs); color: var(--ink-soft); }

.er-drop { padding: var(--space-3) var(--space-4); border: 1px dashed var(--rule-strong); border-radius: var(--radius-md); color: var(--ink-soft); font-size: var(--text-xs); transition: background-color var(--dur-2) var(--ease-standard), border-color var(--dur-2) var(--ease-standard); }
.er-drop p { margin: 0; }
.er-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.er-files { margin: 0; padding: 0; list-style: none; }
.er-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-3); min-height: 36px; border-bottom: 1px solid var(--rule); }
.er-files li:last-child { border-bottom: 0; }
.er-files li > span { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.er-files small { color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ deadlines */

.er-due { margin: 0 0 var(--space-4); padding: 0; list-style: none; border-top: 1px solid var(--rule); max-width: 900px; }
.er-due li { display: grid; grid-template-columns: 10em minmax(0, 1.4fr) minmax(0, 1fr) 7.5em 8em; gap: var(--space-3); align-items: baseline; min-height: 40px; padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.er-due time { font-variant-numeric: tabular-nums; font-weight: 650; }
.er-due a { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.er-due a:hover { text-decoration: underline; }
.er-due span, .er-due small { color: var(--ink-soft); font-size: var(--text-xs); }
.er-due small { text-align: right; font-variant-numeric: tabular-nums; }
.er-due li[data-s="overdue"] time { color: var(--danger); }
.er-how { margin: 0 0 var(--space-4); padding: 0 0 var(--space-3); border-bottom: 1px solid var(--rule); }
.er-how h3 { margin: 0 0 var(--space-1); font-size: var(--text-sm); font-weight: 650; }
.er-how p { margin: 0 0 var(--space-2); font-size: var(--text-xs); line-height: 1.55; color: var(--ink-soft); }

/* ------------------------------------------------------------ brokers */

.er-brokers { margin: 0 0 var(--space-4); padding: 0; list-style: none; border-top: 1px solid var(--rule); max-width: 900px; }
.er-brokers li { padding: var(--space-3) 2px; border-bottom: 1px solid var(--rule); }
.er-br-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
.er-br-head h3 { margin: 0; font-size: var(--text-sm); font-weight: 650; }
.er-br-region { font-size: var(--text-2xs); font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-faint); }
.er-brokers p { margin: var(--space-1) 0 0; font-size: var(--text-xs); line-height: 1.5; color: var(--ink-soft); max-width: var(--measure); }
.er-br-needs b { color: var(--ink); font-weight: 600; }
.er-br-route { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2) !important; max-width: none !important; }
.er-br-route code { overflow-wrap: anywhere; }
.er-br-src { color: var(--ink-faint) !important; font-size: var(--text-2xs) !important; overflow-wrap: anywhere; }
.er-br-src a { color: inherit; }

/* ------------------------------------------------------------ directory */

.er-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.er-filter { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); max-width: 900px; }
.er-filter .er-seg { margin: 0; }
.er-search { flex: 1 1 260px; }
.er-brokers li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 var(--space-2); }
.er-brokers li.is-picked { background: var(--accent-soft); }
.er-pick { display: grid; place-items: center; align-self: start; width: 34px; height: 34px; margin-top: -6px; cursor: pointer; }
.er-pick input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.er-br-kind { font: var(--text-2xs) var(--font-mono); letter-spacing: .02em; color: var(--ink-faint); }
.er-service { max-width: 900px; margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--radius-md); background: var(--paper-raised); }
.er-service h3 { margin: 0; font-size: var(--text-sm); font-weight: 650; }
.er-service p { margin: var(--space-1) 0 0; max-width: var(--measure); font-size: var(--text-xs); line-height: 1.5; color: var(--ink-soft); }
.er-selbar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 900px; margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--paper-raised); font-size: var(--text-xs); }
.er-selbar > span { flex: 1 1 auto; font-variant-numeric: tabular-nums; }
.er-fold { margin: var(--space-2) 0 0; font-size: var(--text-xs); }
.er-fold summary { min-height: 34px; padding: 7px 0; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.er-fold ul { max-height: 30vh; margin: 0; padding: 0 0 0 1.2em; overflow-y: auto; line-height: 1.6; }
.er-fold small { color: var(--ink-faint); font-family: var(--font-mono); }
.er-menu-wrap { position: relative; }
.er-menu.er-menu-right { left: auto; right: 0; }

/* ------------------------------------------------------------ campaigns */

.er-camps { margin: 0 0 var(--space-4); padding: 0; list-style: none; border-top: 1px solid var(--rule); max-width: 900px; }
.er-camps li { padding: var(--space-3) 2px; border-bottom: 1px solid var(--rule); }
.er-camp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-2); }
.er-camp-head a { color: var(--ink); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.er-camp-head a:hover { text-decoration: underline; }
.er-camp-head span { font-size: var(--text-xs); color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.er-camp-n { margin: var(--space-2) 0 var(--space-3); font-size: var(--text-xs); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.er-camp-n b { color: var(--danger); }
.er-bar { display: flex; gap: 2px; height: 8px; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper-inset); }
.er-bar span { flex-basis: 0; min-width: 4px; background: var(--accent); }
.er-bar [data-s="done"] { background: var(--good); }
.er-bar [data-s="refused"], .er-bar [data-s="overdue"] { background: var(--danger); }
.er-bar [data-s="waiting"] { background: var(--accent); }
.er-bar [data-s="draft"] { background: var(--rule-strong); }
.er-q-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-2); }
.er-q-head h3 { margin: 0; font-size: var(--text-md); font-weight: 650; overflow-wrap: anywhere; }
.er-q-head .er-hint { margin: 0; }
.er-q-n { align-self: center; margin-right: auto; font: var(--text-xs) var(--font-mono); color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.er-q-done { margin: var(--space-2) 0; line-height: 1.55; }
.er-dialog .er-row { margin: var(--space-3) 0 0; }

/* ------------------------------------------------------------ overview */

.er-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 var(--space-5); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); }
.er-stats > div { min-width: 0; padding: var(--space-3) var(--space-4); border-left: 1px solid var(--rule); }
.er-stats > div:first-child { border-left: 0; }
.er-stats dt { font-size: var(--text-2xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-stats dd { margin: 2px 0 0; font-size: var(--text-xl); font-weight: 650; font-variant-numeric: tabular-nums; }
.er-stats dd small { font-size: var(--text-xs); font-weight: 600; color: var(--ink-faint); }
.er-stats [data-s="overdue"] dd { color: var(--danger); }
.er-ov { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.er-ov > section > .er-h2:first-child { margin-top: 0; }
.er-needs { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.er-needs li { display: flex; flex-direction: column; gap: 1px; padding: 9px 2px 9px var(--space-3); border-bottom: 1px solid var(--rule); border-left: 3px solid transparent; }
.er-needs li[data-k="overdue"], .er-needs li[data-k="refused"] { border-left-color: var(--danger); }
.er-needs li[data-k="asked"], .er-needs li[data-k="recheck"] { border-left-color: var(--warn); }
.er-needs a { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.er-needs a:hover { text-decoration: underline; }
.er-needs span { font-size: var(--text-xs); color: var(--ink-faint); }
.er-due-sm li { grid-template-columns: 10em minmax(0, 1fr) auto; }
.er-camps-sm li { padding: var(--space-2) 2px; }
.er-record .n { text-align: right; font-variant-numeric: tabular-nums; width: 4.5em; }
.er-record .n.is-bad { color: var(--danger); font-weight: 650; }
.er-steps { margin: 0 0 var(--space-3); padding: 0 0 0 1.2em; font-size: var(--text-xs); line-height: 1.5; color: var(--ink-soft); }
.er-steps li { margin: 0 0 var(--space-1); }

/* ------------------------------------------------------------ plug-ins */

.er-packs { max-width: 900px; margin: 0 0 var(--space-3); padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.er-packs li { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) 2px; border-bottom: 1px solid var(--rule); }
.er-packs li > div:first-child { flex: 1 1 320px; min-width: 0; }
.er-packs span { font-size: var(--text-xs); color: var(--ink-faint); }
.er-packs p { max-width: var(--measure); margin: var(--space-1) 0 0; font-size: var(--text-xs); line-height: 1.5; color: var(--ink-soft); }
.er-pack-n { font: var(--text-2xs) var(--font-mono); color: var(--ink-faint) !important; }
.er-btn-note { display: block; margin-top: 1px; font: var(--text-2xs) var(--font-mono); font-weight: 400; color: var(--ink-faint); }
.er-actions .er-btn:has(.er-btn-note) { flex-direction: column; align-items: flex-start; gap: 0; }

/* ------------------------------------------------------------ services */

.er-svc-fold { max-width: 900px; margin: 0 0 var(--space-3); }
.er-svc-fold[open] summary { margin-bottom: var(--space-2); }
.er-services { max-width: 900px; }

/* ------------------------------------------------------------ goals */

.er-goals .er-check { align-items: flex-start; }
.er-goals .er-check span { line-height: 1.45; }
.er-goals .er-check b { font-weight: 650; }
.er-goals .er-hint { margin: var(--space-1) 0 0; }
.er-goals .er-hint:empty { display: none; }

/* ------------------------------------------------------------ a reply, read */

.er-reading { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--rule-strong); background: var(--paper-inset); font-size: var(--text-xs); line-height: 1.5; }
.er-reading p { margin: 0 0 var(--space-1); }
.er-reading p:last-child { margin-bottom: 0; }
.er-reading span { color: var(--ink-faint); font: var(--text-2xs) var(--font-mono); font-variant-numeric: tabular-nums; }
.er-reading[data-k="complied"], .er-reading[data-k="acknowledged"] { border-left-color: var(--good); }
.er-reading[data-k="partial"], .er-reading[data-k="id"], .er-reading[data-k="extension"], .er-reading[data-k="na"] { border-left-color: var(--warn); }
.er-reading[data-k="refused"] { border-left-color: var(--danger); }
.er-reading-why { color: var(--ink-soft); overflow-wrap: anywhere; }
.er-reading-why q { font-family: var(--font-mono); font-size: var(--text-2xs); }
.er-reading-panel .er-reading { margin: 0 0 var(--space-2); }
.er-panel .er-reading-why { margin: 0 0 var(--space-2); font-size: var(--text-xs); }

/* ------------------------------------------------------------ what comes next */

.er-ladder { margin: 0 0 var(--space-3); padding: 0; list-style: none; counter-reset: step; }
.er-ladder li { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); padding: 6px 0 6px 26px; border-bottom: 1px solid var(--rule); font-size: var(--text-xs); counter-increment: step; }
.er-ladder li::before { content: counter(step); position: absolute; left: 0; top: 7px; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--rule-strong); border-radius: 50%; font: 600 var(--text-2xs) var(--font-mono); color: var(--ink-faint); }
.er-ladder li[data-s="done"]::before { border-color: var(--good); background: var(--good); color: var(--paper); }
.er-ladder li[data-s="due"]::before { border-color: var(--danger); color: var(--danger); }
.er-ladder b { font-weight: 600; }
.er-ladder span { flex: 1 1 auto; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.er-ladder li[data-s="due"] span { color: var(--danger); font-weight: 600; }

/* ------------------------------------------------------------ re-listing and the data map */

.er-watch tr.is-due td { background: var(--accent-soft); }
.er-watch select { min-width: 7.5em; }
.er-watch-act, .er-map-act { white-space: nowrap; text-align: right; }
.er-watch-act > *, .er-map-act > * { margin-left: var(--space-1); vertical-align: middle; }
.er-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.er-map-act-sm { display: none; }
.er-chk { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 var(--space-3); margin: 0 0 var(--space-3); }
.er-chk legend { grid-column: 1 / -1; }
.er-mbox { max-height: 52vh; overflow-y: auto; }
.er-mbox .n { text-align: right; font-variant-numeric: tabular-nums; width: 6em; }
.er-mbox .er-pick { margin-top: 0; }
.er-needs li[data-k="complain"] { border-left-color: var(--danger); }
.er-needs li[data-k="watch"] { border-left-color: var(--warn); }
.er-packs-links { display: inline-flex; flex-wrap: wrap; gap: 0 var(--space-3); }

/* ---------------------------------------------------------------- foot */

.er-status { display: flex; align-items: center; gap: var(--space-4); min-width: 0; min-height: 26px; padding: 0 150px 0 var(--space-3); border-top: 1px solid var(--rule); background: var(--paper-raised); font-size: var(--text-2xs); color: var(--ink-faint); white-space: nowrap; overflow: hidden; }
.er-status span { overflow: hidden; text-overflow: ellipsis; }
.er-status [data-kind="bad"] { color: var(--danger); font-weight: 650; }
body.er-app #ppBadge { left: auto; right: var(--space-2); bottom: 1px; min-height: 24px; padding: 1px var(--space-2); font-size: var(--text-2xs); box-shadow: none; }

/* ---------------------------------------------------------------- dialogs */

.er-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--paper-raised); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 24px 60px rgba(16, 16, 24, .3); font: var(--text-sm)/var(--leading-ui) var(--font-sans); }
.er-dialog.is-wide { width: min(860px, calc(100vw - 24px)); }
.er-dialog::backdrop { background: rgba(10, 10, 14, .38); }
.er-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.er-dialog header { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule); }
.er-dialog header h2 { flex: 1; margin: 0; font-size: var(--text-md); font-weight: 650; overflow-wrap: anywhere; }
.er-dialog-body { padding: var(--space-4); overflow-y: auto; }
.er-dialog-body > p { max-width: var(--measure); margin: 0 0 var(--space-3); line-height: 1.55; }
.er-dialog-body .er-form { max-width: none; }
.er-dialog footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--rule); }
.er-dialog .er-letter { max-height: 48vh; }
.er-keys { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.er-keys td { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.er-keys td:first-child { width: 42%; white-space: nowrap; }
.er-dialog kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--paper); font: 600 var(--text-2xs) var(--font-mono); }
.er-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------------------------------------------------------------- narrow */

@media (max-width: 1100px) {
  .er-body { grid-template-columns: 60px minmax(0, 1fr); }
  .er-nav a { justify-content: center; padding: 0; }
  .er-nav a span { display: none; }
  .er-count { display: none; }
  .er-doc, .er-compose { grid-template-columns: minmax(0, 1fr); }
  .er-preview { position: static; }
  .er-ov { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-width: 760px) {
  body.er-app { height: auto; overflow: auto; }
  .er { height: auto; min-height: 100dvh; }
  .er-top { flex-wrap: wrap; row-gap: var(--space-1); }
  .er-state { order: 7; flex: 1 1 100%; max-width: none; }
  .er-hide-sm { display: none !important; }
  /* On a phone the list of requests fits the width, its Status column
     included: tighter cells, and a due date may take two lines. */
  .er-table th, .er-table td { padding: 8px 6px; }
  .er-table td.d { white-space: normal; }
  .er-sub { display: block; margin-top: 1px; color: var(--ink-faint); font-size: var(--text-2xs); }
  .er-body { display: block; }
  .er-nav { position: sticky; top: 0; z-index: 5; flex-direction: row; gap: 2px; padding: 6px 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rule); scrollbar-width: none; }
  .er-nav::-webkit-scrollbar { display: none; }
  .er-nav a { flex: none; justify-content: flex-start; padding: 0 12px; }
  .er-nav a span { display: inline; }
  .er-nav a svg { display: none; }
  .er-nav-sep { display: none; }
  .er-main { overflow: visible; }
  .er-page, .er-page.is-wide { height: auto; overflow: visible; padding: var(--space-4) var(--space-4) var(--space-7); }
  .er-start { grid-template-columns: minmax(0, 1fr); }
  .er-start > section { border-left: 0; border-top: 1px solid var(--rule); }
  .er-start > section:first-child { border-top: 0; }
  .er-form { grid-template-columns: minmax(0, 1fr); }
  .er-id-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .er-id-row .er-link { grid-column: 1 / -1; justify-self: start; }
  .er-timeline li { grid-template-columns: minmax(0, 1fr) auto; }
  .er-timeline time { grid-column: 1 / -1; }
  .er-due li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); }
  .er-due span { grid-column: 1 / -1; }
  .er-letter { padding: var(--space-3); font-size: var(--text-xs); max-height: none; }
  .er-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .er-stats > div { border-left: 0; border-top: 1px solid var(--rule); }
  .er-stats > div:nth-child(even) { border-left: 1px solid var(--rule); }
  .er-stats > div:nth-child(-n+2) { border-top: 0; }
  .er-due-sm li { grid-template-columns: minmax(0, 1fr) auto; }
  .er-selbar > span { flex-basis: 100%; }
  .er-watch-act, .er-map-act { white-space: normal; }
  .er-map-act-sm { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: center; margin-top: var(--space-1); }
  .er-watch-act > *, .er-map-act > * { margin: 2px 0 2px var(--space-1); }
  .er-stats-4 > div:nth-child(-n+2) { border-top: 0; }
  .er-status { flex-wrap: wrap; padding: 4px var(--space-3); white-space: normal; }
  .er-top > .er-grow { order: 1; }
  .er-menubar { order: 2; }
  .er-top > .er-icon-btn { order: 3; }
  .er-hide-xs { display: none !important; }
}

/* Replies from email files, the people-search walk and screenshots. */
.er-review { padding: var(--space-2) var(--space-3); border-left: 3px solid var(--warn); background: var(--paper-inset); color: var(--ink-soft); }
.er-mailhead { margin: 0 0 var(--space-3); font-size: var(--text-xs); line-height: 1.6; overflow-wrap: anywhere; }
.er-mailhead span { display: inline-block; min-width: 4.5em; font-size: var(--text-2xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.er-page.is-drop { outline: 1px dashed var(--accent); outline-offset: -6px; }
.er-reading-tag { font-size: var(--text-2xs); font-weight: 650; letter-spacing: .02em; color: var(--ink-soft); white-space: nowrap; }
.er-reading-tag[data-k="refused"] { color: var(--danger); }
.er-walk-who { margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
.er-walk-who span { margin-right: var(--space-2); font-size: var(--text-2xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.er-walk-q { margin: var(--space-4) 0 var(--space-2); font-weight: 650; color: var(--ink); }
.er-walk-res { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.er-btn.is-on { border-color: var(--accent); color: var(--accent); }
.er-walk-found { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.er-walk-found li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; border-bottom: 1px solid var(--rule); }
.er-walk-found small { color: var(--ink-faint); }
.er-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--space-3); margin: 0 0 var(--space-2); }
.er-shot { margin: 0; padding: var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); min-width: 0; }
.er-shot figcaption { margin-bottom: var(--space-2); font-size: var(--text-2xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.er-shot.is-empty p { margin: 0; color: var(--ink-faint); font-size: var(--text-xs); }
.er-shot-img { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm); background: var(--paper-inset); }
.er-shot-img img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.er-shot-meta { display: grid; gap: 2px; margin: var(--space-2) 0 0; font-size: var(--text-2xs); color: var(--ink-soft); min-width: 0; }
.er-shot-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.er-shot-meta code { font: var(--text-2xs) var(--font-mono); color: var(--ink-faint); overflow-wrap: anywhere; }

/* A finger needs more than a pointer. */
@media (pointer: coarse) {
  .er-mb, .er-icon-btn, .er-btn, .er-link, .er-seg button, .er-seg a, .er-nav a, .er-menu button, .er-check,
  .er input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .er select, .er-dialog input:not([type="checkbox"]), .er-dialog select { min-height: 44px; }
  .er-icon-btn { width: 44px; height: 44px; }
  .er-mb, .er-seg button, .er-seg a { min-width: 44px; }
  .er-check input { width: 22px; height: 22px; }
  .er-brokers li { grid-template-columns: 44px minmax(0, 1fr); }
  .er-pick { width: 44px; height: 44px; margin-top: -10px; }
  .er-pick input { width: 22px; height: 22px; }
  .er-fold summary { min-height: 44px; }
  body.er-app #ppBadge { min-height: 44px; }
}

@media print {
  body.er-app { height: auto; overflow: visible; }
  .er { display: block; height: auto; }
  .er-top, .er-nav, .er-status, .er-tools { display: none !important; }
  .er-body { display: block; }
  .er-page { height: auto; overflow: visible; padding: 0; animation: none; }
}
