/* TigerrBD — one stylesheet for the site and the admin portal. The site's values come from Admin → Design
   as CSS variables (design.py); the admin portal always uses the originals below. */
:root {
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --size-body: 15px; --size-wordmark: 30px; --size-title: 30px; --size-heading: 22px; --size-headline: 19px;
  --size-label: 11px; --size-section: 11px;
  --ink: #000; --paper: #fff; --on-ink: #fff; --muted: #6b6b6b; --faint: #a3a3a3; --line: #e4e4e4; --wash: #f6f5f3; --accent: #8c1c13;
  --page-width: 1400px; --gutter: 40px; --column-gap: 48px; --section-space: 28px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: var(--size-body); line-height: 1.5; color: var(--ink); background: var(--paper); }
a { color: inherit; }
.wrap { max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }
.hint { color: var(--muted); font-size: calc(var(--size-body) - 1px); }
.hint a { color: var(--ink); }
.empty { color: var(--muted); padding: 24px 0; border-bottom: 1px solid var(--line); margin: 0; }
.flash { border: 1px solid var(--ink); padding: 10px 14px; margin: 18px 0 0; }
.announce { background: var(--wash); padding: 10px var(--gutter); text-align: center; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- header and menu */
header .top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 0 0; border-bottom: 1px solid var(--ink); }
.wordmark { font-family: var(--serif); font-size: var(--size-wordmark); font-weight: 500; letter-spacing: var(--wordmark-tracking, .2em); text-transform: uppercase; text-decoration: none; line-height: 1; padding-bottom: 16px; }
nav.main { display: flex; align-items: flex-end; gap: 2px; }
nav.main a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font-family: var(--sans); font-size: calc(var(--size-label) + 1px); letter-spacing: .2em; text-transform: uppercase; text-decoration: none; white-space: nowrap; color: var(--muted); background: none; border: 1px solid transparent; border-bottom: 0; }
nav.main a.on { color: var(--ink); border-color: var(--ink); background: var(--paper); margin-bottom: -1px; padding-bottom: 1px; }
nav.main .navbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-family: var(--sans); font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: none; border: 0; cursor: pointer; }
nav.main .signout { display: flex; margin-left: 16px; }

.foot { display: none; justify-content: center; margin-top: 48px; padding: 16px 0 28px; border-top: 1px solid var(--line); }
.foot .navbtn { min-height: 44px; padding: 0 12px; font-family: var(--sans); font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: none; border: 0; cursor: pointer; }

/* ---------- type */
.title { font-family: var(--serif); font-size: var(--size-title); font-weight: 400; line-height: 1.1; margin: 36px 0 8px; }
.sub { color: var(--muted); margin: 0 0 24px; max-width: 720px; }
.section { font-family: var(--sans); font-size: var(--size-section); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; margin: var(--section-space) 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section .count { margin-left: 10px; color: var(--muted); font-weight: 400; }
.heading { font-family: var(--serif); font-size: var(--size-heading); font-weight: 400; line-height: 1.15; margin: 0 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }

/* ---------- forms and buttons */
.f { display: block; font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; margin: 18px 0 6px; }
.f input, .f select, .f textarea { margin-top: 6px; }
.f .hint { text-transform: none; letter-spacing: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: 8px 12px; min-height: 40px; width: 100%; max-width: 480px; display: block; }
textarea { max-width: none; min-height: 96px; resize: vertical; }
input:disabled, textarea:disabled { background: var(--wash); color: var(--muted); border-color: var(--line); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; display: inline; margin: 0 8px 0 0; }
.check { display: block; margin: 10px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 22px; font-family: var(--sans); font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--on-ink); background: var(--ink); border: 1px solid var(--ink); border-radius: 0; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 14px; }
.btn:disabled { opacity: .35; cursor: default; }
.btn.danger-btn { background: var(--accent); border-color: var(--accent); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- sign in */
.auth { max-width: 340px; margin: 14vh auto 0; text-align: center; }
.auth .wordmark { display: block; font-size: calc(var(--size-wordmark) * 1.4); padding: 0; margin-bottom: 10px; }
.auth form { text-align: left; }
.auth input { max-width: none; }
.auth .btn { width: 100%; margin-top: 24px; }
.auth .alt { margin-top: 18px; }

/* ---------- dashboards */
.tabs { display: flex; gap: 4px; align-items: flex-end; border-bottom: 1px solid var(--line); margin-top: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab:hover { color: var(--ink); }
.tab.add { font-size: 20px; padding: 0 14px; color: var(--ink); }
.criteria { margin: 24px 0 0; }
.criteria summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.criteria summary::-webkit-details-marker { display: none; }
.criteria summary::before { content: "+"; font-size: 18px; margin-right: 10px; width: 14px; }
.criteria[open] summary::before { content: "–"; }
.criteria summary span:first-child { flex: none; }
.criteria summary .hint { flex: 1; text-transform: none; letter-spacing: 0; text-align: right; }
.criteria summary .load-form { flex: none; margin: 4px 0; }
.highlights { margin-top: 18px; }
.highlights .f { margin: 0 0 4px; }
.highlights ul { margin: 0; padding-left: 20px; }
.highlights li { margin: 4px 0; }
.criteria-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 24px; }
.criteria-grid .f { margin-top: 20px; }
.criteria-actions { margin: 16px 0 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--column-gap); margin-top: 36px; }
.split.three { grid-template-columns: 1.2fr 1.2fr 1fr; }   /* stories, companies, connections */
.mentions .who { display: block; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.mentions .who .who-tag { margin-left: 4px; }
.mentions li { cursor: default; }
.mentions .headline a { text-decoration: none; }
.mentions .headline a:hover { text-decoration: underline; }
.mentions .hint { margin-top: 6px; }
.tabs form { display: contents; }
.subheading { font-family: var(--sans); font-size: var(--size-section); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; margin: 28px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.subheading:first-of-type { margin-top: 14px; }
.empty.small { padding: 12px 0; }
textarea.prompt { min-height: 72px; }
.name-field { max-width: 360px; }
.criteria-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 0; }
.loadbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: calc(var(--size-body) - 1px); }
.notice { border: 1px solid var(--accent); color: var(--accent); padding: 10px 14px; margin: 16px 0 0; }
.note { border: 1px solid var(--ink); color: var(--ink); padding: 10px 14px; margin: 16px 0 0; }
.stories, .companies, .plain { list-style: none; margin: 0; padding: 0; }
.story, .company, .mentions li { display: flex; gap: 14px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 0; font: inherit; color: inherit; cursor: pointer; min-height: 48px; }
.story:hover .headline, .company:hover .headline { text-decoration: underline; }
.story .n, .company .n, .mentions .n { font-family: var(--serif); font-size: var(--size-headline); color: var(--faint); width: 24px; text-align: right; flex: none; padding-top: 2px; }
.story .body, .company .body, .mentions .body { display: block; min-width: 0; }
.headline { display: block; font-family: var(--serif); font-size: var(--size-headline); line-height: 1.2; }
.story .summary, .company .summary { display: block; margin-top: 4px; }
.meta { display: block; color: var(--muted); font-size: calc(var(--size-body) - 1px); margin-top: 4px; }
.tag { font-family: var(--sans); font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--ink); padding: 0 6px; margin-left: 8px; vertical-align: middle; }
dialog.card { border: 1px solid var(--ink); padding: 28px; max-width: 640px; width: calc(100% - 32px); background: var(--paper); color: var(--ink); font: inherit; line-height: 1.5; }
dialog.card::backdrop { background: rgba(0, 0, 0, .35); }
.card h2 { font-family: var(--serif); font-size: var(--size-heading); font-weight: 400; line-height: 1.15; margin: 0 0 6px; }
.card .section { margin-top: 22px; }
.card .excerpt { color: var(--muted); border-left: 2px solid var(--line); padding-left: 12px; margin-top: 12px; }
.card p { margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1px solid var(--line); padding: 4px 10px; font-size: calc(var(--size-body) - 1px); }
.card .actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 0; }
.card .plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.card .plain .meta { display: inline; }
/* history */
.month-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.month-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-family: var(--serif); font-size: 28px; text-decoration: none; }
.month-link[aria-disabled="true"] { color: var(--faint); pointer-events: none; }
.month-nav .title { margin: 0; text-align: center; flex: 1; }
.calendar a.day { text-decoration: none; display: block; }
.calendar .day.has { background: var(--wash); }
.calendar .day.has:hover .num { text-decoration: underline; }
.calendar .day .count { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.day-dashboard { font-family: var(--serif); font-size: calc(var(--size-heading) + 2px); font-weight: 400; margin: 44px 0 0; }
.day-dashboard .hint { font-family: var(--sans); font-size: calc(var(--size-body) - 1px); margin-left: 12px; }
.day-dashboard + .highlights, .day-dashboard + .split { margin-top: 14px; }

/* connections */
.conn { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px 84px; position: relative; }   /* a wide gutter for the lines */
.conn > section { position: relative; z-index: 1; }
.conn-lines { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; z-index: 0; }
.conn-lines path { fill: none; stroke: var(--muted); stroke-width: 1; opacity: .5; }
.conn-lines path.off { opacity: .15; }
.conn-lines path.on { stroke: var(--ink); stroke-width: 1.5; opacity: 1; }
.conn-people .subheading { margin-top: 24px; }
.conn-people .people .meta { display: block; }
.conn-list { list-style: none; margin: 0; padding: 0; }
.conn-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 0; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.conn-item .name { font-family: var(--serif); font-size: var(--size-headline); line-height: 1.2; }
.conn-item .badge { font-size: var(--size-label); letter-spacing: .1em; color: var(--muted); border: 1px solid var(--line); padding: 2px 8px; flex: none; }
.conn-item.on { border-bottom-color: var(--ink); }
.conn-item.on .name { text-decoration: underline; }
.conn-item.linked .badge { border-color: var(--ink); color: var(--ink); }
.conn-item.dim { color: var(--faint); }
.conn-item.dim .badge { color: var(--faint); }
.conn-detail { margin-top: 36px; padding-top: 8px; border-top: 1px solid var(--ink); }
.conn-detail .heading { border: 0; padding: 0; }

/* alerts */
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.title-row .title { margin-bottom: 0; }
.title-row + .sub { margin-top: 8px; }
.mark-read { margin: 28px 0 18px; }
nav.main .dot { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border: 1px solid var(--ink); font-size: 10px; line-height: 16px; text-align: center; letter-spacing: 0; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.alerts .kind { flex: none; width: 120px; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.alerts li.unread .kind { color: var(--ink); }
.alerts .body { display: block; min-width: 0; }
.alerts .headline a { text-decoration: none; }
.alerts .headline a:hover { text-decoration: underline; }
.alerts li.unread .headline { font-weight: 500; }
.alerts .summary { display: block; margin-top: 4px; }
.switches { border-collapse: collapse; margin-top: 8px; }
.switches th, .switches td { text-align: left; padding: 8px 18px 8px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.switches thead th { font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.switches tbody th { font-family: var(--serif); font-size: var(--size-headline); }
.switches input { margin: 0; }
.days { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 4px 26px; }
.court-watch { margin-top: 18px; max-width: 520px; }
.court-watch textarea { margin-top: 6px; }
.court-watch .hint { display: block; margin-top: 6px; }
.followed-cases { list-style: none; margin: 0; padding: 0; max-width: 640px; }
.followed-cases li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.followed-cases li a { flex: 1 1 240px; }
.msg .tool-status { display: block; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; }
.refresh-every { margin-top: 22px; }
.refresh-every select { display: inline-block; width: auto; margin: 0 10px 0 0; }
.refresh-every .hint { display: block; margin-top: 6px; }
.threshold { margin-top: 20px; max-width: 520px; }
.threshold output { font-family: var(--serif); font-size: var(--size-headline); letter-spacing: 0; text-transform: none; margin-left: 6px; }
.threshold input[type=range] { width: 100%; max-width: none; min-height: 0; padding: 0; border: 0; accent-color: var(--ink); margin: 6px 0 4px; }
.check.inline { margin: 0; }
.criteria-grid.two { grid-template-columns: 2fr 1fr; }

/* story threads: the arrow and the timeline of earlier chapters */
.thread-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 38px; padding: 6px 0; min-height: 36px; background: none; border: 0; font-family: var(--sans); font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.thread-toggle:hover { color: var(--ink); }
.thread-toggle .arrow { display: inline-block; transition: transform .15s; }
.thread-toggle[aria-expanded="true"] .arrow { transform: rotate(180deg); }
.thread { list-style: none; margin: 0 0 10px 38px; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.thread li { display: flex; gap: 12px; padding: 6px 0; }
.thread .when { flex: none; width: 92px; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.thread .body { min-width: 0; }
.thread .body a { text-decoration: none; }
.thread .body a:hover { text-decoration: underline; }
.thread li.now .body { font-style: italic; color: var(--muted); }
.thread.small { margin-left: 0; margin-top: 6px; }
.card .thread { margin-left: 0; }

/* angle, targets, people */
.tag.angle { border-color: var(--accent); color: var(--accent); }
.approach { margin-left: 8px; }
.page-tabs { margin-top: 18px; }   /* the same gap under the menu as the dashboard tabs */
.page-tabs + .title { margin-top: 28px; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.people .body { display: block; }
.people .summary { display: block; margin-top: 2px; }
.target-box { margin-top: 8px; max-width: 520px; }
.target-box select { max-width: 260px; }
.target-box textarea { min-height: 72px; }
.targets { list-style: none; margin: 0; padding: 0; }
.targets li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.target-head .headline a { text-decoration: none; }
.target-head .headline a:hover { text-decoration: underline; }
.target-latest { margin: 8px 0 0; }
.target-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.target-row select { width: auto; max-width: 200px; min-height: 36px; }
.target-row input[type=text] { flex: 1 1 240px; min-height: 36px; max-width: none; }

/* the colour rule: blue client, green potential client, red conflict */
:root { --client: #1a56a6; --target: #1f7a3f; --conflict: #b3261e; }
.who-client, .who-client a { color: var(--client); }
.who-target, .who-target a { color: var(--target); }
.who-conflict, .who-conflict a { color: var(--conflict); }
.who-tag { font-family: var(--sans); font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; border: 1px solid currentColor; padding: 0 6px; margin-left: 8px; vertical-align: middle; }
.scrollbox { max-height: 440px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.scrollbox.short { max-height: 240px; }
.known .row-actions { display: flex; gap: 10px; flex: none; }
.known .edit-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.known .edit-form[hidden] { display: none; }
.known .edit-form input, .known .edit-form select { width: auto; flex: 1 1 140px; min-height: 36px; }
.known .edit-form .btn { min-height: 36px; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.add-row input, .add-row select { width: auto; flex: 1 1 150px; min-height: 36px; }
.add-row .btn { min-height: 36px; }
.add-row .btn-pair { display: flex; gap: 8px; flex: none; }
[hidden] { display: none !important; }   /* the hidden attribute always wins, whatever else styles the element */
.linkedin { margin-top: 18px; }
.linkedin summary { cursor: pointer; font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; min-height: 40px; display: flex; align-items: center; }
.linkedin summary .hint { text-transform: none; letter-spacing: 0; margin-left: 8px; }
.conflicts { margin-top: 36px; }

/* who I know */
.know-forms, .know-lists { margin-top: 32px; }
.know-add { margin-top: 6px; padding-bottom: 14px; }
.know-add + .know-add { border-top: 1px solid var(--line); padding-top: 4px; }
.known { list-style: none; margin: 0; padding: 0; }
.known li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.known .body { display: block; min-width: 0; }
.known .headline a { text-decoration: none; }
.known .headline a:hover { text-decoration: underline; }
.known .linkbtn.small { font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-decoration: none; min-height: 32px; flex: none; }
.known .linkbtn.small:hover { color: var(--ink); }
.filter { max-width: none; margin: 10px 0 4px; }
input[type=file] { border: 0; padding: 6px 0; min-height: 0; }

.email-frame { border: 1px solid var(--line); margin-top: 20px; background: #fff; }
.sort-row { margin: 0 0 8px; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; }
.sort-link { color: var(--muted); text-decoration: none; margin-right: 14px; padding: 8px 0; display: inline-block; }
.sort-link.on { color: var(--ink); border-bottom: 1px solid var(--ink); }

/* company card page */
.back { margin: 24px 0 0; font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; }
.back a { text-decoration: none; }
.ticker { font-family: var(--sans); font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: 10px; vertical-align: middle; }
.lede { max-width: 760px; margin: 0 0 8px; }
.card-bar { margin-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card-split { margin-top: 28px; }
.card-facts { grid-template-columns: 170px 1fr; margin: 14px 0 0; }
.card-facts dd { margin-bottom: 6px; }
.card-split .heading + .heading, .card-split ul + .heading, .card-split p + .heading, .card-facts + .heading { margin-top: 36px; }
.disputes { list-style: none; margin: 0; padding: 0; }
.disputes li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.disputes .when { flex: none; width: 78px; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.disputes .body { display: block; min-width: 0; }
.disputes .what { display: block; }
.card-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.sources a { color: var(--muted); }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain .meta { display: inline; }

.slots { list-style: none; margin: 0; padding: 0; }
.slots li { display: flex; align-items: center; gap: 16px; min-height: 48px; border-bottom: 1px solid var(--line); }
.slots .n { font-family: var(--serif); font-size: var(--size-headline); color: var(--faint); width: 24px; text-align: right; }
.slots .line { flex: 1; }
.slots + .hint { margin-top: 14px; }

/* ---------- history calendar */
.month-nav { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.month { font-family: var(--serif); font-size: var(--size-heading); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--line); margin-top: 14px; }
.calendar .dow { font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar .day { min-height: 76px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: var(--size-headline); }
.calendar .day.off { color: var(--faint); }
.calendar .day.today { background: var(--wash); }
.calendar + .hint { margin-top: 14px; }

/* ---------- admin portal */
body.admin { display: flex; min-height: 100vh; }
.admin-nav { width: 210px; flex: none; border-right: 1px solid var(--line); padding: 28px 22px; display: flex; flex-direction: column; }
.admin-brand { font-family: var(--serif); font-size: 24px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 24px; line-height: 1.1; }
.admin-brand span { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .2em; color: var(--muted); margin-top: 4px; }
.admin-nav nav a { display: flex; align-items: center; min-height: 36px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.admin-nav nav a.on { color: var(--ink); }
.admin-who { margin-top: auto; padding-top: 24px; font-size: 12px; color: var(--muted); }
.admin-who form, .admin-who a { display: block; margin-top: 6px; color: var(--ink); }
.admin-main { flex: 1; min-width: 0; max-width: 1180px; padding: 28px 40px 80px; }
.admin-main .auth { margin-top: 10vh; }
.admin-flash { margin: 0 0 16px; }
.admin-title { font-family: var(--serif); font-size: 32px; font-weight: 400; line-height: 1.1; margin: 0 0 10px; }
.count { font-family: var(--sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: 12px; vertical-align: middle; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.admin-table th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink); }
.admin-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table.compact td { padding: 7px 12px 7px 0; }
.admin-table .num { text-align: right; }
.admin-table a { color: var(--ink); }
.admin-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 10px 0; }
.admin-row input { width: auto; flex: 1 1 200px; margin: 0; }
.pill { display: inline-block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line); padding: 1px 8px; margin-right: 6px; line-height: 1.6; }
.pill.bad { border-color: var(--accent); color: var(--accent); }
.pill.ok { border-color: var(--ink); }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; margin: 18px 0; }
.facts dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; }
.admin-actions .admin-act { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.admin-pw { max-width: 400px; }
.admin-pw input { max-width: none; }
.admin-delete input { max-width: 260px; display: inline-block; vertical-align: middle; margin-right: 10px; }
.section.danger { color: var(--accent); border-color: var(--accent); }
.back-link { text-decoration: none; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.code-reveal { border: 1px solid var(--ink); padding: 14px 18px; margin: 14px 0; max-width: 640px; }
.code-block { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.steps-list { padding-left: 20px; }
.steps-list li { margin: 6px 0; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.service-grid h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 6px; }
.email-fields, .design-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; }
.email-fields .f { margin-top: 10px; }
.email-fields input { max-width: none; }
.twostep-setup { display: flex; gap: 28px; flex-wrap: wrap; margin: 12px 0; }
.twostep-qr svg { width: 180px; height: 180px; }
.live-tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--ink); padding: 0 6px; margin-left: 6px; }
.row-actions form { display: inline; }
.row-actions .linkbtn { margin-right: 12px; }

/* design schemes */
.schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 8px; }
.scheme { display: flex; flex-direction: column; gap: 6px; }
.scheme .sample { border: 1px solid; padding: 12px 12px 10px; line-height: 1.35; overflow: hidden; min-height: 150px; }
.scheme .sp-mark { text-transform: uppercase; font-weight: 500; line-height: 1; margin-bottom: 8px; }
.scheme .sp-nav { display: flex; gap: 8px; text-transform: uppercase; letter-spacing: .12em; border-bottom: 1px solid; padding-bottom: 5px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; }
.scheme .sp-nav span:first-child { border-bottom: 1px solid; }
.scheme .sp-heading { border-bottom: 1px solid; padding-bottom: 3px; margin-bottom: 6px; line-height: 1.1; }
.scheme .sp-headline { line-height: 1.15; margin-bottom: 3px; }
.scheme .sp-body { margin-bottom: 8px; }
.scheme .sp-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid; padding-top: 8px; }
.scheme .sp-btn { display: inline-block; padding: 3px 7px; text-transform: uppercase; letter-spacing: .12em; line-height: 1.2; }
.scheme .sp-alert { text-transform: uppercase; letter-spacing: .12em; }
.scheme .sp-wash { margin-left: auto; width: 22px; height: 14px; border: 1px solid; }
.scheme .btn { align-self: flex-start; margin-top: 4px; }
.auth .alt { font-size: 13px; }
.auth .alt .linkbtn { font-size: 13px; }

/* design page */
.design-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.design-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin: 8px 0; }
.design-field > span { color: var(--muted); }
.design-field input, .design-field select { margin: 0; max-width: none; }
.color-pair { display: flex; gap: 8px; }
.color-pair input[type=color] { width: 46px; flex: none; padding: 2px 4px; }
.px-field { display: flex; align-items: center; gap: 8px; }
.px-field input { max-width: 110px; }
.design-words summary { cursor: pointer; padding: 10px 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.design-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.design-preview { position: sticky; top: 20px; }
.dp-frame { border: 1px solid var(--line); padding: 20px; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: var(--size-body); }
.dp-wordmark { font-family: var(--serif); font-size: var(--size-wordmark); letter-spacing: .2em; text-transform: uppercase; font-weight: 500; line-height: 1; }
.dp-nav { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 20px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.dp-label { font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; }
.dp-label.on { border-bottom: 1px solid var(--ink); }
.dp-title { font-family: var(--serif); font-size: var(--size-title); line-height: 1.1; margin-bottom: 14px; }
.dp-heading { font-family: var(--serif); font-size: var(--size-heading); border-bottom: 1px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px; }
.dp-story { padding: 10px 0; border-bottom: 1px solid var(--line); }
.dp-headline { font-family: var(--serif); font-size: var(--size-headline); line-height: 1.2; }
.dp-body { font-size: var(--size-body); }
.dp-muted { color: var(--muted); font-size: calc(var(--size-body) - 1px); }
.dp-accent { color: var(--accent); }
.dp-btn { display: inline-block; padding: 9px 16px; background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; }
.dp-btn.ghost { background: transparent; color: var(--ink); }
.dp-section { font-size: var(--size-section); letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 16px; }

/* ---------- phones and narrow windows */
@media (max-width: 1000px) {
  .design-layout { grid-template-columns: 1fr; }
  .design-preview { position: static; }
}
@media (max-width: 900px) {
  .criteria-grid { grid-template-columns: 1fr; }
  .split { gap: 28px; }
  .split.three { grid-template-columns: 1fr 1fr; }   /* narrow windows: connections go underneath, full width */
  .split.three .mentions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .split, .split.three { grid-template-columns: 1fr; gap: 36px; }   /* phones only: stories, then companies, then connections */
  .alerts li { flex-direction: column; gap: 2px; }
  .alerts .kind { width: auto; }
  .switches th, .switches td { padding-right: 10px; font-size: 13px; }
  .switches tbody th { font-size: 15px; }
}
@media (max-width: 560px) {
  .conn { grid-template-columns: 1fr; gap: 28px; }
  .conn-lines { display: none; }
}
@media (max-width: 700px) {
  .criteria-grid.two { grid-template-columns: 1fr; }
  .month-nav .title { font-size: calc(var(--size-title) * .8); }
}
@media (max-width: 800px) {
  body.admin { flex-direction: column; }
  .admin-nav { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .admin-brand { margin-bottom: 10px; }
  .admin-nav nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
  .admin-who { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding-top: 0; }
  .admin-who form, .admin-who a { margin: 0; }
  .admin-main { padding: 20px 16px 60px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .card-facts { grid-template-columns: 1fr; gap: 2px; }
  .card-facts dd { margin-bottom: 10px; }
  .disputes li { flex-direction: column; gap: 2px; }
  .disputes .when { width: auto; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .announce { padding: 8px 16px; }
  header .top { flex-direction: column; align-items: stretch; gap: 0; padding-top: 18px; }
  .wordmark { text-align: center; padding-bottom: 12px; }
  nav.main { gap: 0; overflow-x: auto; scrollbar-width: none; }
  nav.main::-webkit-scrollbar { display: none; }
  nav.main a { font-size: var(--size-label); letter-spacing: .1em; padding: 0 7px; min-height: 42px; }
  nav.main .dot { min-width: 14px; padding: 0 3px; margin-left: 3px; }
  nav.main .signout { display: none; }   /* on phones, Sign out is at the foot of the page instead */
  .foot { display: flex; }
  .criteria summary .hint { display: none; }
  .criteria summary span:first-child { flex: 1; }
  .title { margin-top: 28px; }
  .tab { padding: 0 12px; }
  .calendar .day { min-height: 52px; padding: 6px; font-size: 15px; }
  .calendar .dow { padding: 8px 4px; font-size: 11px; letter-spacing: .1em; }
  .auth { margin-top: 10vh; }
}

/* Ask Claude: a thumb tab on the right edge; the chat slides out beside the page content */
:root { --ask-w: min(440px, 50vw); }   /* never more than half the window */
.ask-thumb { position: fixed; right: 0; top: 128px; z-index: 51; writing-mode: vertical-rl; min-width: 40px; padding: 16px 11px; background: var(--ink); color: var(--on-ink); border: 0; font-family: var(--sans); font-size: var(--size-label); letter-spacing: .2em; text-transform: uppercase; cursor: pointer; transition: right .2s; }
html.ask-open .ask-thumb { right: var(--ask-w); }
html.ask-open body { padding-right: var(--ask-w); transition: padding-right .2s; }
.ask-thumb .x { display: none; margin-bottom: 10px; font-size: 14px; letter-spacing: 0; }
html.ask-open .ask-thumb .x { display: inline; }
.ask-foot { margin: 6px 0 0; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ask-foot .hint { text-transform: none; letter-spacing: 0; }
/* a floating panel: clear of the top and bottom of the window, bordered all round, with a soft shadow */
.ask-drawer { position: fixed; top: 16px; right: 0; bottom: 16px; width: var(--ask-w); max-width: 50vw; z-index: 50; display: flex; flex-direction: column; padding: 12px 18px 12px 18px; background: var(--paper, #fff); border: 1px solid var(--ink); border-right: 0; box-shadow: -10px 0 28px rgba(0, 0, 0, .1); }
.ask-drawer[hidden] { display: none; }
.ask-drawer .messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.ask-drawer .ask-box { flex: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ask-drawer .ask-box textarea { min-height: 44px; max-height: 160px; resize: none; padding: 8px 10px; }
.ask-drawer .ask-box .btn[hidden] { display: none; }
/* like a chat: the member's questions right-aligned in a soft grey bubble, Claude's answers plain on the left */
.ask-drawer .msg { display: flex; padding: 6px 0; border: 0; }
.ask-drawer .msg .who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ask-drawer .msg.user { justify-content: flex-end; }
.ask-drawer .msg.user .text { max-width: 85%; padding: 9px 14px; background: var(--wash); border-radius: 18px 18px 4px 18px; font-family: var(--sans); font-size: var(--size-body); line-height: 1.45; }
.ask-drawer .msg.assistant .text { max-width: 100%; padding: 4px 0; }
.ask-drawer .messages { padding-top: 4px; }
.messages { list-style: none; margin: 0; padding: 0; }
.msg { padding: 14px 0; border-bottom: 1px solid var(--line); }
.msg .who { display: block; font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.msg.user .text { font-family: var(--serif); font-size: var(--size-headline); line-height: 1.3; }
.msg .text p { margin: 0 0 10px; }
.msg .text p:last-child { margin-bottom: 0; }
.msg .text ul, .msg .text ol { margin: 0 0 10px; padding-left: 22px; }
.msg .text .section { margin: 12px 0 6px; }
.msg.thinking .text:empty::after { content: 'Thinking…'; color: var(--muted); }
.ask-box textarea { width: 100%; }
.ask-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.conversations li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.conversations .pick { flex: 1 1 auto; min-width: 0; min-height: 40px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; padding: 0; }
.conversations .pick:hover .headline { text-decoration: underline; }
.conversations .headline, .conversations .meta { display: block; }
@media (max-width: 700px) {
  :root { --ask-w: 100vw; }
  .ask-drawer { max-width: 100vw; top: 8px; bottom: 8px; padding: 8px 12px 10px; border-right: 1px solid var(--ink); }
  html.ask-open body { padding-right: 0; }
  html.ask-open .ask-thumb { right: 0; z-index: 52; }   /* the tab stays on top of the panel to close it */
}

.model-table th { text-align: left; font-weight: normal; font-size: var(--size-body); letter-spacing: 0; text-transform: none; color: var(--ink); padding: 10px 16px 10px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.model-table th .hint { display: block; max-width: 420px; }
.model-table td { padding: 10px 0; vertical-align: top; }
.model-table select { min-width: 200px; }

.usage-days th, .usage-days td { white-space: nowrap; }

.colour-key { margin-top: 28px; }
.target-add { margin: 0 0 8px; }
.target-heading { margin-top: 30px; }
.target-add + .target-heading { margin-top: 36px; }

/* delete in dark red, archive in dark blue; the library tab */
.btn.danger { color: #8c1c13; border-color: #8c1c13; background: transparent; }
.btn.danger:hover { background: #8c1c13; color: var(--on-ink); }
.btn.archive { color: #1a3d6d; border-color: #1a3d6d; background: transparent; }
.btn.archive:hover { background: #1a3d6d; color: var(--on-ink); }
.tab.library { padding: 0 12px; color: var(--muted); }   /* right after the + */
.tab.library.on, .tab.library:hover { color: var(--ink); }
.tab.archived-tab { font-style: italic; }
.tab.archived-tab .hint { margin-left: 6px; letter-spacing: 0; text-transform: none; }
.archived-note { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.archived-note .criteria-actions { margin: 0; display: flex; gap: 10px; }
.archived-list .target-row { gap: 10px; }

/* an action Claude proposed in the chat */
.ask-action { margin: 10px 0 4px; padding: 10px 12px 12px; border: 1px solid var(--ink); }
.ask-action .what { display: block; font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.ask-action dl { margin: 0 0 8px; }
.ask-action dt { font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.ask-action dd { margin: 1px 0 0; white-space: pre-line; }
.ask-action .act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ask-action .done { font-weight: 500; }

/* right-click menu on a dashboard tab */
.ctx-menu { position: absolute; z-index: 60; min-width: 160px; background: var(--paper); border: 1px solid var(--ink); padding: 4px 0; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.ctx-menu button { display: block; width: 100%; min-height: 40px; padding: 0 16px; background: none; border: 0; font-family: var(--sans); font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; text-align: left; color: var(--ink); cursor: pointer; }
.ctx-menu button:hover { background: var(--wash); }
.ctx-menu button.archive { color: #1a3d6d; }
.ctx-menu button.danger { color: #8c1c13; }

/* paging within the alert lists */
.pager { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pager button { min-width: 40px; min-height: 40px; background: none; border: 1px solid var(--line); font-size: 16px; color: var(--ink); cursor: pointer; }
.pager button:disabled { color: var(--faint); cursor: default; }
.alerts-section { margin-top: 28px; }

/* ---------- phones (iOS first): no zoom on focus, safe areas, tap targets, the calendar, wide tables */
@supports (padding: env(safe-area-inset-top)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  header .top { padding-top: calc(22px + env(safe-area-inset-top)); }
  .foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
.tab[data-did] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
@media (max-width: 700px) {
  input, select, textarea { font-size: 16px; }   /* Safari zooms the page on focus below 16px */
  .tab { min-height: 40px; }
  .sort-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0; }
  .calendar .day { padding: 6px 4px; min-height: 60px; }
  .calendar .day .count { letter-spacing: 0; margin-top: 2px; }
  .calendar .day .count .word { display: none; }
  .calendar .dow { padding: 8px 4px; letter-spacing: .06em; }
  .admin-table { display: block; max-width: 100%; overflow-x: auto; white-space: nowrap; }
  .ask-drawer { padding-top: 60px; }
}

/* coming up (dates from the news) and reminders */
.coming li .when { font-family: var(--sans); font-size: var(--size-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.coming .meta-inline { color: var(--muted); font-size: calc(var(--size-body) - 1px); }
.coming .meta-inline a { color: var(--muted); text-decoration: none; }
.coming .meta-inline a:hover { text-decoration: underline; }
.target-row .next-step { flex: 1 1 160px; }
.target-row .next-at { flex: 0 0 150px; }
.reminder { color: var(--ink); }

/* not relevant: muted chips; search */
.muted-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.muted-list .chip { display: inline-flex; align-items: center; gap: 4px; }
.muted-list .unmute { min-height: 24px; color: var(--muted); }
nav.main .search-tab { padding: 0 10px; }
.search-form { display: flex; gap: 8px; margin-top: 28px; }
.search-form input { flex: 1 1 auto; }
.search-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.search-list .summary { display: block; margin-top: 2px; color: var(--muted); }
.admin h3.subsection { font-family: var(--sans); font-size: var(--size-label); letter-spacing: .14em; text-transform: uppercase; font-weight: 500; margin: 22px 0 8px; }
.known .row-actions .court.on { color: var(--ink); font-weight: 500; }
.known .row-actions .court:not(.on) { color: var(--muted); }
/* Wordmark parts: the editor rows on the Design page, and the parts themselves */
.wm-rows { display: flex; flex-direction: column; gap: 4px; }
.wm-row { display: grid; grid-template-columns: 1.1fr 1.5fr 1.1fr auto .6fr .7fr .9fr .8fr; gap: 10px; align-items: end; }
.wm-row .design-field { margin: 4px 0; }
.wm-row .check-field input { width: 18px; height: 18px; min-height: 0; margin: 0 0 9px; }
.wordmark .wm { display: inline-block; line-height: 1; }
@media (max-width: 900px) { .wm-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
