/*
 * Styles for the whole app. No build step: this file is served as written.
 * Brand colours switch on <html data-brand="collective|shield|digital">, which the app sets for the current
 * workspace or record (render() in public/app/layout.js). Later sections deliberately refine earlier ones, so order matters: add new rules
 * to the section they belong to, and check the narrow-screen @media blocks for that section.
 */
:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  color: #203632;
  background: #f3f5f1;
  font-size: 14px;
  --ink: #102c2a;
  --green: #226b56;
  --muted: #667871;
  --line: #dbe3db;
  --cream: #f7f9f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
/* Base elements: buttons, form fields, headings and text styles. */
button {
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 10px 15px;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-weight: 600;
}
button:hover {
  background: #e8efe8;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.danger {
  color: #a6302f;
  background: #fff1ef;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd8ce;
  border-radius: 6px;
  background: white;
  padding: 10px 11px;
  color: var(--ink);
}
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: #f3f5f1;
  opacity: 1;
  color: #52645d;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #52665d;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.small {
  font-size: 12px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  color: #698276;
  margin-bottom: 14px;
}
/* App layout: sidebar, navigation and the main area. */
.shell {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--ink);
  color: #dae8df;
  padding: 31px 21px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.logo {
  font-size: 27px;
  letter-spacing: 5px;
  font-weight: 750;
}
.logo small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: #9fb9aa;
  margin-top: 9px;
}
.nav {
  display: grid;
  gap: 7px;
}
.nav button {
  background: transparent;
  border: none;
  color: #abc3b6;
  text-align: left;
  padding: 13px 15px;
  font-size: 14px;
}
.nav button.active {
  color: white;
  background: #294640;
}
.nav button:hover {
  color: white;
  background: #25433d;
}
.account {
  margin-top: auto;
  border-top: 1px solid #34514a;
  padding-top: 22px;
  font-size: 12px;
}
.account strong {
  display: block;
  color: white;
  margin-bottom: 6px;
}
.account button {
  padding: 8px;
  margin-top: 14px;
  background: transparent;
  color: #c5d9cc;
  border-color: #496259;
}
.main {
  padding: 35px 42px;
  max-width: 1700px;
  width: 100%;
  margin: auto;
}
/* Page header, cards and dashboard metrics. */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}
.top p {
  margin: 0;
}
.actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 23px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px #18342904;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  padding: 21px;
  border-radius: 9px;
}
.metric strong {
  display: block;
  font-size: 32px;
  letter-spacing: -1px;
  margin: 10px 0;
}
.metric span {
  font-size: 12px;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid .card {
  margin: 0;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.full {
  grid-column: 1/-1;
}
.filters {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.filters.more {
  grid-template-columns: repeat(4, 1fr);
}
/* Prospects table, status pills and banners. */
.tablewrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #f8faf6;
  color: #718178;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px;
  border-bottom: 1px solid #e9eee8;
  vertical-align: top;
  font-size: 13px;
}
tr:last-child td {
  border-bottom: none;
}
td .open {
  border: 0;
  padding: 0;
  color: var(--ink);
  font-weight: 650;
  background: none;
  text-align: left;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.pill {
  display: inline-block;
  border-radius: 5px;
  padding: 5px 8px;
  background: #e7f1e8;
  color: #2b6753;
  font-size: 11px;
  white-space: nowrap;
}
.pill.digital {
  background: #eaf0fb;
  color: #476388;
}
.pill.warn {
  background: #fbefdb;
  color: #8a622b;
}
.pill.bad {
  background: #f9e7e2;
  color: #a24e3b;
}
.banner {
  background: #e8f2e8;
  padding: 14px 17px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.6;
}
.banner.warn {
  background: #fff0d8;
  color: #7a582c;
}
.banner.bad {
  background: #fbe7e1;
  color: #8a3c31;
}
/* Record tabs, save bar, pipeline board and activity timeline. */
.tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  margin: 21px 0;
  overflow: auto;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: none;
  white-space: nowrap;
  color: var(--muted);
  padding: 13px;
}
.tabs button.active {
  border-bottom: 3px solid var(--green);
  color: var(--green);
}
.savebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  bottom: 12px;
  padding: 14px 18px;
  background: #fff;
  box-shadow: 0 3px 24px #122e2920;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 20px;
  z-index: 3;
}
.pipeline {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 18px;
}
.lane {
  flex: 0 0 235px;
  background: #e8eee7;
  padding: 13px;
  border-radius: 9px;
}
.lane h3 {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin: 3px 0 15px;
}
.opcard {
  display: block;
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  margin-bottom: 10px;
  padding: 15px;
}
.opcard p {
  font-weight: 400;
  font-size: 12px;
  margin: 9px 0;
}
.timeline {
  border-left: 2px solid var(--line);
  padding-left: 18px;
  margin: 17px 0;
}
.timeline article {
  margin-bottom: 21px;
  line-height: 1.5;
}
.timeline p {
  margin: 7px 0;
  white-space: pre-wrap;
}
/* Sign-in screen. */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login aside {
  background: var(--ink);
  color: #e6eee4;
  padding: 11vw 7vw;
}
.login aside h1 {
  font-size: 48px;
  margin: 65px 0 20px;
  max-width: 450px;
  font-weight: 500;
}
.login aside p {
  color: #adc5b6;
  max-width: 360px;
}
.login main {
  display: grid;
  place-content: center;
  padding: 45px;
}
.login form {
  width: 360px;
  max-width: 80vw;
  display: grid;
  gap: 20px;
}
.login h2 {
  font-size: 27px;
}
.login form button {
  width: 100%;
}
.error {
  color: #ab3734;
  line-height: 1.5;
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
/* Folded sections, preformatted text and the hidden print area. */
details {
  margin-bottom: 15px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px/1.6 ui-monospace,
    monospace;
  background: #f5f7f2;
  padding: 15px;
  border-radius: 6px;
  max-height: 500px;
  overflow: auto;
}
.listitem {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.listitem:last-child {
  border: 0;
}
#toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  max-width: 420px;
  background: var(--ink);
  color: white;
  padding: 14px 20px;
  border-radius: 8px;
  z-index: 20;
  display: none;
  line-height: 1.6;
}
.print-area {
  display: none;
}
@media (max-width: 1000px) {
  .main {
    padding: 25px;
  }
  .shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .filters {
    grid-template-columns: repeat(3, 1fr);
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    gap: 18px;
  }
  .logo {
    font-size: 20px;
  }
  .nav {
    display: flex;
    overflow: auto;
  }
  .nav button {
    padding: 10px;
  }
  .account {
    display: none;
  }
  .main {
    padding: 20px 15px;
  }
  .grid,
  .fields {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 10px;
  }
  .filters,
  .filters.more {
    grid-template-columns: repeat(2, 1fr);
  }
  .top {
    align-items: flex-start;
    flex-direction: column;
  }
  h1 {
    font-size: 25px;
  }
  .login {
    display: block;
  }
  .login aside {
    padding: 25px;
  }
  .login aside h1,
  .login aside p {
    display: none;
  }
  .login main {
    padding: 40px 20px;
  }
  .full {
    grid-column: auto;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  body > .print-area {
    display: block !important;
    white-space: pre-wrap;
    font:
      12pt/1.5 Georgia,
      serif;
    margin: 2cm;
    color: black;
  }
}
@media (max-width: 700px) {
}

.grid {
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    border: 0;
    padding: 0;
  }
  .account strong,
  .account button {
    margin: 0;
  }
  .account button {
    margin-left: auto;
  }
}
/* Brand palettes. Palette roles follow the supplied Eland brand guides. This :root block replaces the
   starting colours above (Eland Collective); the [data-brand] blocks below switch to Digital or Shield. */
:root {
  --ink: #142952;
  --green: #142952;
  --muted: #525f7a;
  --line: #e5e7eb;
  --cream: #f1f2f4;
  --accent: #f97415;
  --on-accent: #142952;
  --page: #9da4ae;
  --field-border: #758199;
  color: #29303d;
  background: var(--page);
}
:root[data-brand='digital'] {
  --ink: #0f1729;
  --green: #0f1729;
  --muted: #526078;
  --line: #dcdfe4;
  --cream: #fafafa;
  --accent: #0080ff;
  --on-accent: #0f1729;
  --page: #e4f0ff;
  --field-border: #66758e;
}
:root[data-brand='shield'] {
  --ink: #1d2025;
  --green: #6629a3;
  --muted: #66527a;
  --line: #d1d6e0;
  --cream: #eff1f5;
  --accent: #6629a3;
  --on-accent: #eff1f5;
  --page: #efe5f9;
  --field-border: #66527a;
}
body {
  background: var(--page);
}
.shell {
  grid-template-columns: 296px minmax(0, 1fr);
}
.sidebar {
  background: #142952;
  padding: 24px;
  gap: 23px;
  color: #dce4f3;
}
.brand-logo {
  display: block;
  width: 240px;
  height: auto;
  flex-shrink: 0;
}
.sidebar > .brand-logo {
  width: 248px;
}
.sidebar .nav button {
  color: #dce4f3;
}
.sidebar .nav button.active {
  background: #1f3d7a;
  color: #fff;
  box-shadow: inset 3px 0 #f97415;
}
.sidebar .nav button:hover {
  background: #1f3d7a;
}
.sidebar .account {
  border-color: #525f7a;
}
.sidebar .account button {
  color: #fff;
  border-color: #9ba7be;
}
.workspace-select {
  color: #dce4f3;
}
.workspace-select select {
  color: #142952;
  background: #f97415;
  border-color: #f97415;
  font-size: 12px;
}
.main {
  margin: 0 auto;
  padding-top: 32px;
}
.top .brand-logo {
  margin: -9px 0 7px;
}
.top .eyebrow {
  color: var(--muted);
}
button {
  color: var(--ink);
}
button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
button:hover {
  background: var(--cream);
}
button.primary:hover {
  filter: brightness(0.96);
}
input,
textarea,
select {
  border-color: var(--field-border);
  color: var(--ink);
}
label {
  color: var(--muted);
}
input:disabled,
select:disabled,
textarea:disabled {
  color: var(--muted);
  background: var(--cream);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.sidebar select:focus-visible,
.sidebar button:focus-visible {
  outline-color: #fff;
}
th {
  color: var(--muted);
  background: var(--cream);
}
td {
  border-bottom-color: var(--line);
}
.metric span {
  color: var(--muted);
}
.pill.collective {
  background: #fff0e4;
  color: #142952;
}
.pill.digital {
  background: #e4f0ff;
  color: #0f1729;
}
.pill.shield {
  background: #efe5f9;
  color: #6629a3;
}
.pill.warn {
  background: #fff0d8;
  color: #765020;
}
.pill.bad {
  background: #fbe7e1;
  color: #8a3c31;
}
.login aside {
  background: #142952;
}
.login aside .brand-logo {
  width: 320px;
  max-width: 100%;
  min-width: 240px;
}
.login aside p {
  color: #dce4f3;
}
.login aside h1 {
  color: #fff;
}
.login main {
  background: #f1f2f4;
}
.brand-card,
.opportunity-card {
  border-top: 4px solid var(--line);
}
.brand-card.digital,
.opportunity-card.digital {
  border-top-color: #0080ff;
}
.brand-card.shield,
.opportunity-card.shield {
  border-top-color: #6629a3;
}
.brand-card > .brand-logo {
  margin: -8px 0 10px;
}
.brand-card.digital .primary {
  background: #0080ff;
  color: #0f1729;
  border-color: #0080ff;
}
.brand-card.shield .primary {
  background: #6629a3;
  color: #eff1f5;
  border-color: #6629a3;
}
.opportunity-card > .brand-logo {
  margin: -8px 0 14px;
}
.contact-brands {
  margin-bottom: 18px;
}
.queue-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.queue-buttons button {
  border-color: var(--field-border);
  font-size: 12px;
}
.queue-buttons button.selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.filter-actions {
  justify-content: space-between;
  margin-bottom: 12px;
}
.filter-actions p {
  margin: 0;
}
.brand-cards:has(> .card:only-child) {
  grid-template-columns: 1fr;
}
.lane {
  background: var(--cream);
  border: 1px solid var(--line);
}
.opcard {
  display: grid;
  gap: 12px;
}
.opcard .pill {
  justify-self: start;
}
#toast {
  background: #142952;
  bottom: auto;
  top: 22px;
  box-shadow: 0 4px 20px #14295226;
}
.tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--green);
}
@media (max-width: 1100px) {
  .main {
    padding: 24px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand-cards {
    grid-template-columns: 1fr;
  }
  .grid:not(.brand-cards) {
    grid-template-columns: 1fr;
  }
  .top {
    flex-wrap: wrap;
  }
  .fields {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    gap: 14px;
  }
  .sidebar > .brand-logo {
    width: 240px;
  }
  .workspace-select {
    max-width: 400px;
  }
  .nav {
    display: flex;
    overflow: auto;
  }
  .nav button {
    padding: 11px;
  }
  .account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    border: 0;
    padding: 0;
  }
  .account strong,
  .account button {
    margin: 0;
  }
  .account button {
    margin-left: auto;
  }
  .main {
    padding: 22px 15px;
  }
  .grid,
  .fields {
    grid-template-columns: 1fr;
  }
  .filters,
  .filters.more {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand-logo {
    width: 240px;
  }
  .queue-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .queue-buttons button {
    min-height: 45px;
  }
  .login aside .brand-logo {
    width: 240px;
  }
  .card {
    padding: 18px;
  }
  #toast {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .savebar {
    padding: 12px;
  }
  .savebar .muted {
    font-size: 12px;
  }
}
@media (max-width: 800px) {
  .login {
    display: block;
  }
  .login aside {
    padding: 25px;
  }
  .login aside h1,
  .login aside p {
    display: none;
  }
  .login main {
    padding: 40px 20px;
  }
}
/* iPhone: readable fields without automatic zoom, generous touch targets and safe areas. */
html {
  -webkit-text-size-adjust: 100%;
}
.main,
.card,
.metric,
.fields > *,
.grid > *,
.top > *,
.filters > * {
  min-width: 0;
}
@media (max-width: 800px), (hover: none) and (pointer: coarse) and (max-width: 1000px) {
  .shell {
    display: block;
    min-height: 100svh;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 18px
      max(18px, env(safe-area-inset-left));
    gap: 14px;
  }
  .sidebar > .brand-logo {
    width: 240px;
  }
  .workspace-select {
    max-width: 400px;
  }
  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
  }
  .nav button {
    flex: 1 0 auto;
    text-align: center;
    padding: 11px;
  }
  .account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    border: 0;
    padding: 0;
  }
  .account strong,
  .account button {
    margin: 0;
  }
  .account button {
    margin-left: auto;
  }
  .main {
    padding: 22px max(15px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom))
      max(15px, env(safe-area-inset-left));
  }
  button,
  summary {
    min-height: 44px;
    touch-action: manipulation;
  }
  input,
  select,
  textarea,
  .workspace-select select {
    font-size: 16px;
    min-height: 44px;
    max-width: 100%;
  }
  select {
    height: 44px;
  }
  .top {
    align-items: flex-start;
    flex-direction: column;
  }
  h1,
  .card,
  .banner,
  .account,
  .listitem,
  .opcard {
    overflow-wrap: anywhere;
  }
  .savebar {
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 12px;
    flex-wrap: wrap;
  }
  .savebar button {
    flex-shrink: 0;
  }
  .tabs,
  .pipeline {
    overscroll-behavior-x: contain;
  }
  .tabs {
    scroll-padding-inline: 12px;
  }
  .pipeline {
    scroll-snap-type: x proximity;
  }
  .lane {
    scroll-snap-align: start;
    max-width: 85vw;
  }
  .login {
    display: block;
    min-height: 100svh;
  }
  .login aside {
    padding: max(25px, env(safe-area-inset-top)) max(25px, env(safe-area-inset-right)) 25px
      max(25px, env(safe-area-inset-left));
  }
  .login aside h1,
  .login aside p {
    display: none;
  }
  .login main {
    padding: 32px 20px max(32px, env(safe-area-inset-bottom));
  }
  .login form {
    width: 360px;
    max-width: 100%;
  }
  #toast {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    max-width: none;
    pointer-events: none;
  }
}
@media (max-width: 800px) {
  #prospect-table {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }
  #prospect-table table,
  #prospect-table tbody {
    display: block;
  }
  #prospect-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #prospect-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    padding: 14px;
    gap: 14px;
    margin-bottom: 12px;
  }
  #prospect-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  #prospect-table colgroup {
    display: none;
  }
  #prospect-table td:first-child,
  #prospect-table td:nth-child(4) {
    grid-column: 1/-1;
  }
  #prospect-table td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
  }
  #prospect-table td .open {
    min-height: 44px;
    width: 100%;
    font-size: 16px;
    padding: 8px 0;
  }
}
@media (min-width: 801px) {
  #prospect-table table {
    table-layout: fixed;
    min-width: 1100px;
  }
  #prospect-table th,
  #prospect-table td {
    padding: 15px 10px;
    overflow-wrap: anywhere;
  }
  #prospect-table th {
    overflow-wrap: normal;
  }
  #prospect-table .pill {
    white-space: normal;
    max-width: 100%;
    overflow-wrap: normal;
  }
}
/* A single responsive grid keeps prospect filters aligned at every width. */
.prospect-filters {
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, max(150px, calc((100% - 42px) / 4))), 1fr)
  );
  gap: 14px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  align-items: end;
}
.prospect-filters .filter-search {
  grid-column: 1/-1;
}
.prospect-filters label {
  gap: 8px;
  min-width: 0;
}
.prospect-filters input,
.prospect-filters select {
  height: 48px;
  min-height: 48px;
  font-size: 16px;
  border-radius: 7px;
}
.queue-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}
.queue-buttons button {
  min-height: 48px;
  height: 100%;
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
}
@media (max-width: 800px) {
  .prospect-filters {
    padding: 14px;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 359px) {
  .prospect-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  flex-shrink: 0;
}
.sidebar-heading .brand-logo {
  width: 248px;
}
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 23px;
  flex: 1;
  min-height: 0;
}
@media (min-width: 801px) {
  .sidebar {
    overflow-y: auto;
  }
}
.menu-toggle {
  display: none;
}
@media (max-width: 800px), (hover: none) and (pointer: coarse) and (max-width: 1000px) {
  .sidebar-heading .brand-logo {
    width: 240px;
  }
  .sidebar-menu {
    gap: 14px;
  }
}
@media (max-width: 700px),
  (hover: none) and (pointer: coarse) and (max-width: 1000px) and (max-height: 500px) {
  .menu-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    color: #fff;
    border-color: #9ba7be;
  }
  .menu-toggle:hover {
    background: #1f3d7a;
  }
  .hamburger {
    display: grid;
    gap: 5px;
    width: 20px;
  }
  .hamburger span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }
  .sidebar-menu {
    display: none;
  }
  .sidebar.menu-open .sidebar-menu {
    display: flex;
  }
  .sidebar .nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .sidebar .nav button {
    text-align: left;
    min-height: 44px;
    padding: 12px 15px;
  }
  .sidebar .account {
    border-top: 1px solid #525f7a;
    padding-top: 14px;
  }
}

/* Prospect tabs share one spacing scale and never stretch short controls. */
.record-view {
  --record-gap: 20px;
  --record-padding: 24px;
}
.record-view .card {
  padding: var(--record-padding);
  margin-bottom: var(--record-gap);
}
.record-view .card > h2 {
  margin: 0 0 var(--record-gap);
  line-height: 1.4;
}
.record-view .card > .muted {
  margin: 0 0 var(--record-gap);
}
.record-view .fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--record-gap);
  align-items: start;
}
.record-view .record-field {
  align-content: start;
  gap: 8px;
  font-size: 13px;
  line-height: 20px;
}
.record-view .field-label {
  min-height: 40px;
  display: flex;
  align-items: flex-end;
}
.record-view .fields input,
.record-view .fields select {
  height: 48px;
  min-height: 48px;
  padding: 12px;
  border-radius: 7px;
  font-size: 16px;
}
.record-view .field-wide {
  grid-column: 1/-1;
}
.record-view .field-wide .field-label {
  min-height: 20px;
}
.record-view .fields textarea {
  height: 144px;
  min-height: 144px;
  padding: 12px;
  border-radius: 7px;
  font-size: 16px;
  line-height: 1.6;
}
.record-view .field-draft textarea {
  height: 360px;
  min-height: 144px;
}
.record-view .fields + .muted,
.record-view .fields + button {
  margin-top: var(--record-gap);
}
.record-view .card > .actions {
  margin-top: var(--record-gap);
}
.record-view .card > .brand-logo {
  margin: 0 0 var(--record-gap);
}
.record-view .tabs {
  margin: var(--record-gap) 0;
}
.record-view details {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.record-view details:last-child {
  border-bottom: 0;
}
.record-view details > summary {
  padding: 12px 0;
  line-height: 20px;
  min-height: 44px;
}
.record-view .timeline {
  margin: 0;
  padding-left: var(--record-gap);
}
.record-view .timeline article {
  padding: 0 0 var(--record-gap);
  margin: 0 0 var(--record-gap);
  border-bottom: 1px solid var(--line);
}
.record-view .timeline article:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
.record-view .timeline article > .muted {
  margin: 8px 0 0;
}
@media (max-width: 1100px) {
  .record-view .fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .record-view .field-label {
    min-height: 20px;
  }
}
@media (max-width: 800px) {
  .record-view {
    --record-gap: 20px;
    --record-padding: 18px;
  }
  .record-view .field-draft textarea {
    height: 320px;
  }
}

/* Keep discard and save together, including narrow phone layouts. */
.savebar {
  flex-wrap: wrap;
}
.save-actions {
  margin-left: auto;
  flex-wrap: nowrap;
}
.save-actions button {
  min-height: 48px;
}
button.cancel-changes {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}
button.cancel-changes:hover {
  background: #912018;
  border-color: #912018;
}

/* A compact, descriptive summary below the existing record banners. */
.permission-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 20px 0;
}
.permission-strip > strong {
  font-size: 13px;
  color: var(--ink);
}
.permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.permission-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 24px;
  font-size: 12px;
  line-height: 20px;
}
.permission-badge.allowed {
  background: #e8f4ed;
  color: #14532d;
  border-color: #a9cdb8;
}
.permission-badge.blocked {
  background: #fdecec;
  color: #912018;
  border-color: #e3b5b2;
}
.permission-badge.review {
  background: #fff2d7;
  color: #765020;
  border-color: #d9be8d;
}
.permission-badge:hover {
  filter: brightness(0.96);
}
.permission-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .permission-strip {
    padding: 12px;
    gap: 10px;
  }
  .permission-badges {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .permission-badge {
    width: 100%;
  }
}

/* Optional handwritten help, with a self-hosted open-licensed font and pen-stroke arrow. */
@font-face {
  font-family: Caveat;
  src: url('/fonts/Caveat.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}
.record-view .record-field {
  display: grid;
}
.record-view .field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}
.record-view .field-heading .field-label {
  display: block;
  min-height: 0;
  font-size: 13px;
  line-height: 20px;
  margin: 0;
}
.record-view .field-help {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  color: #49589b;
  touch-action: manipulation;
}
.field-help span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #a9b1d0;
  border-radius: 50%;
  font:
    600 14px/1 Arial,
    sans-serif;
  background: #f5f6fc;
}
.field-help:hover span,
.field-help[aria-expanded='true'] span {
  background: #e8eaf8;
  border-color: #49589b;
}
.handnote {
  position: fixed;
  z-index: 1002;
  box-sizing: border-box;
  width: 330px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 16px 20px;
  background: #fffef9;
  border: 1px dashed #b6bed8;
  border-radius: 12px;
  box-shadow: 0 7px 24px #14295224;
  color: #364586;
}
.handnote-heading {
  display: block;
  margin: 0 0 6px;
  font:
    600 12px/1.4 Arial,
    sans-serif;
  color: #526174;
}
.handnote p {
  margin: 0;
  font:
    600 25px/1.15 Caveat,
    'Bradley Hand',
    cursive;
  overflow-wrap: anywhere;
}
.handnote-arrow {
  position: fixed;
  inset: 0;
  z-index: 1001;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  overflow: hidden;
  color: #49589b;
}
.handnote-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media print {
  .field-help,
  .handnote,
  .handnote-arrow {
    display: none !important;
  }
}

.suppression-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}
.suppression-filters input,
.suppression-filters select,
.suppression-filters button {
  height: 48px;
}
.suppression-entry h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.suppression-entry .actions {
  margin-bottom: 16px;
}
#global-suppression-warning[hidden] {
  display: none;
}
@media (max-width: 700px) {
  .suppression-filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .suppression-entry .actions {
    align-items: flex-start;
  }
  .suppression-entry .actions button {
    width: 100%;
    min-height: 44px;
  }
}

.do-not-dial {
  color: #a11925;
  overflow-wrap: anywhere;
}
.do-not-dial p {
  margin: 8px 0;
}
.record-field:has(label[for]) input[readonly] {
  background: #f4f6f9;
}
.screening-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  margin: 20px 0;
}
.screening-guide .card {
  margin: 0;
  min-width: 0;
}
.screening-guide li {
  margin: 0 0 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.screening-guide ul {
  padding-left: 22px;
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .screening-guide {
    grid-template-columns: minmax(0, 1fr);
  }
}

.permission-details {
  flex-basis: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.permission-details summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}

.sales-pipeline {
  margin-bottom: 20px;
}
.pipeline-bars {
  display: grid;
  gap: 8px;
}
.pipeline-stage {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  text-align: left;
  background: transparent;
  border-color: transparent;
  padding: 8px 10px;
}
.pipeline-stage strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pipeline-track {
  display: block;
  height: 18px;
  background: var(--cream);
  border-radius: 5px;
  overflow: hidden;
}
.pipeline-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 5px;
}
.pipeline-outcomes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.pipeline-outcomes > span {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 480px) {
  .pipeline-stage {
    grid-template-columns: 76px minmax(0, 1fr) 36px;
    gap: 8px;
    padding: 8px 0;
  }
  .pipeline-stage-name {
    font-size: 12px;
  }
  .pipeline-outcomes {
    gap: 8px;
  }
}

:root[data-brand='collective'] .main > .top {
  color: #142952;
}
:root[data-brand='collective'] .main > .top .muted {
  color: #142952;
}

/* Dashboard: sales pipeline and prospect scores side by side; brand workspace buttons; sidebar account spacing. */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}
.dashboard-charts .card {
  margin: 0;
}
.pipeline-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.pipeline-total span {
  font-size: 12px;
  color: var(--muted);
}
.pipeline-total strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.score-chart .pipeline-stage {
  cursor: default;
}
.score-chart-key {
  font-size: 12px;
}
.priority-bands {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.priority-bands-title {
  grid-column: 1/-1;
}
.priority-band {
  min-width: 0;
  border-top: 3px solid var(--score-6);
  padding-top: 8px;
}
.priority-band.score-high {
  border-color: var(--score-14);
}
.priority-band.score-medium {
  border-color: var(--score-10);
}
.priority-band span {
  display: block;
  line-height: 1.5;
}
.priority-band > span:first-child {
  min-height: 36px;
}
.priority-band .priority-range {
  display: inline-block;
  white-space: nowrap;
}
.priority-band strong {
  display: block;
  margin: 4px 0;
  font-size: 23px;
}
.workspace-select {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.workspace-label {
  font-size: 12px;
  font-weight: 600;
}
.workspace-buttons {
  display: grid;
  gap: 8px;
}
.workspace-button {
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 10px 13px;
  border-width: 2px;
}
.workspace-button.collective {
  background: #f97415;
  border-color: #f97415;
  color: #142952;
}
.workspace-button.shield {
  background: #6629a3;
  border-color: #6629a3;
  color: #eff1f5;
}
.workspace-button.digital {
  background: #0080ff;
  border-color: #0080ff;
  color: #0f1729;
}
.workspace-button:not(.selected) {
  opacity: 0.72;
}
.workspace-button.selected {
  opacity: 1;
  box-shadow:
    0 0 0 2px #142952,
    0 0 0 4px #fff;
}
.workspace-button:hover {
  filter: brightness(1.07);
}
.workspace-button.collective:hover {
  background: #f97415;
}
.workspace-button.shield:hover {
  background: #6629a3;
}
.workspace-button.digital:hover {
  background: #0080ff;
}
@media (min-width: 801px) {
  .sidebar .account {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .sidebar .account strong {
    margin: 0;
  }
  .sidebar .account button {
    margin: 12px 0 0;
  }
}
@media (max-width: 1100px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  .workspace-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .workspace-button {
    text-align: center;
    padding: 10px 6px;
    font-size: 12px;
  }
}
.dashboard-charts {
  align-items: stretch;
}
.dashboard-charts .card {
  display: flex;
  flex-direction: column;
}
.dashboard-charts .pipeline-total {
  margin-top: auto;
}
.dashboard-charts .pipeline-outcomes + .pipeline-total,
.dashboard-charts .pipeline-bars + .pipeline-total {
  margin-top: auto;
}
.dashboard-charts .pipeline-bars {
  margin-bottom: 16px;
}
.pipeline-total-gap {
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.banner.untrusted {
  background: #b42318;
  color: #fff;
  border-left: 6px solid #7a1209;
}
.banner.untrusted strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.banner.untrusted ul {
  margin: 6px 0 8px;
  padding-left: 20px;
}
.banner.untrusted p {
  margin: 0;
}
/* Prospect scores use their own sequential scale, independent of the brand colour: dark to light grey (0–8), yellows (9–11), greens (12–15). */
:root {
  --score-0: #2b2f34;
  --score-1: #363b41;
  --score-2: #42474e;
  --score-3: #4f555c;
  --score-4: #5e646b;
  --score-5: #6f757c;
  --score-6: #82878d;
  --score-7: #979ca1;
  --score-8: #b0b4b8;
  --score-9: #ead46e;
  --score-10: #e6c23a;
  --score-11: #d9ad16;
  --score-12: #b8c13a;
  --score-13: #86b445;
  --score-14: #3f9a4c;
  --score-15: #24773d;
}
.score-chart .score-value-0 .pipeline-fill {
  background: var(--score-0);
}
.score-chart .score-value-1 .pipeline-fill {
  background: var(--score-1);
}
.score-chart .score-value-2 .pipeline-fill {
  background: var(--score-2);
}
.score-chart .score-value-3 .pipeline-fill {
  background: var(--score-3);
}
.score-chart .score-value-4 .pipeline-fill {
  background: var(--score-4);
}
.score-chart .score-value-5 .pipeline-fill {
  background: var(--score-5);
}
.score-chart .score-value-6 .pipeline-fill {
  background: var(--score-6);
}
.score-chart .score-value-7 .pipeline-fill {
  background: var(--score-7);
}
.score-chart .score-value-8 .pipeline-fill {
  background: var(--score-8);
}
.score-chart .score-value-9 .pipeline-fill {
  background: var(--score-9);
}
.score-chart .score-value-10 .pipeline-fill {
  background: var(--score-10);
}
.score-chart .score-value-11 .pipeline-fill {
  background: var(--score-11);
}
.score-chart .score-value-12 .pipeline-fill {
  background: var(--score-12);
}
.score-chart .score-value-13 .pipeline-fill {
  background: var(--score-13);
}
.score-chart .score-value-14 .pipeline-fill {
  background: var(--score-14);
}
.score-chart .score-value-15 .pipeline-fill {
  background: var(--score-15);
}
.heading-help,
.banner-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.heading-help h2 {
  margin: 0;
}
.card > .heading-help {
  margin-bottom: 8px;
}
.queue-item {
  position: relative;
  min-width: 0;
}
.queue-item > button:first-child {
  width: 100%;
  padding-right: 46px;
}
.queue-buttons .queue-item > .field-help {
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}
.queue-buttons .queue-item > button.selected + .field-help {
  color: #fff;
}
.banner.untrusted .field-help,
.banner.not-pursued .field-help {
  color: inherit;
}
.banner.not-pursued {
  background: #3b3f45;
  color: #fff;
}
.banner.not-pursued .not-pursued-part + .not-pursued-part {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #5d636b;
}
.banner.not-pursued ul {
  margin: 4px 0 0;
  padding-left: 20px;
}
.banner.untrusted .field-help span,
.banner.not-pursued .field-help span {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
}
.banner.untrusted .field-help:hover span,
.banner.not-pursued .field-help:hover span,
.banner.untrusted .field-help[aria-expanded='true'] span,
.banner.not-pursued .field-help[aria-expanded='true'] span {
  background: rgba(255, 255, 255, 0.18);
}
.banner.not-pursued strong {
  font-size: 15px;
}

/* Source evidence and audit: label/value lists, folded sections and change tables. */
.kv {
  margin: 0;
}
.kv-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 4px 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.kv-row:last-child {
  border-bottom: 0;
}
.kv dt {
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  color: var(--muted);
}
.kv dd {
  margin: 0;
  min-width: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.kv-wide {
  grid-template-columns: minmax(0, 1fr);
}
.kv-wide > dd > .kv,
.kv-wide > dd > .kv-rows {
  padding-left: 14px;
  border-left: 2px solid var(--line);
}
.kv-empty dd {
  font-size: 13px;
  color: var(--muted);
}
.kv-none {
  color: var(--muted);
  font-style: italic;
}
.kv-text {
  white-space: pre-wrap;
}
.kv-block {
  max-width: 80ch;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  white-space: pre-wrap;
  line-height: 1.6;
}
.kv-list {
  margin: 0;
  padding-left: 18px;
}
.record-view .kv-fold {
  margin: 0;
  padding: 0;
  border: 0;
}
.record-view .kv-fold > summary {
  padding: 0;
  min-height: 0;
  cursor: pointer;
  list-style: none;
}
.kv-fold > summary::-webkit-details-marker {
  display: none;
}
.kv-preview {
  display: block;
}
.kv-more {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}
.kv-fold[open] .kv-preview {
  display: none;
}
.kv-fold[open] .kv-more {
  margin: 0 0 8px;
}
.kv-group h4 {
  margin: 14px 0 2px;
  font-size: 13px;
}
.evidence-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.record-view .evidence-section {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.record-view .evidence-section > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 16px;
  cursor: pointer;
}
.record-view .evidence-section > summary {
  list-style: none;
  min-height: 44px;
}
.record-view .evidence-section > summary::-webkit-details-marker {
  display: none;
}
.evidence-title {
  font-weight: 600;
}
.evidence-title::before {
  content: '';
  display: inline-block;
  margin: 0 10px 1px 0;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s;
}
details[open] > summary .evidence-title::before {
  transform: rotate(90deg);
}
.evidence-meta {
  font-size: 13px;
  color: var(--muted);
}
.evidence-body {
  padding: 0 16px 12px;
  min-width: 0;
}
.evidence-body > .muted:first-child {
  margin-top: 0;
}
.record-view .evidence-section .evidence-section {
  margin: 10px 0;
  background: var(--cream);
}
.record-view .evidence-section .evidence-section .kv-block {
  background: #fff;
}
.evidence-file {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.evidence-difference {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.evidence-difference:last-child {
  border-bottom: 0;
}
.evidence-difference h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.audit-list {
  display: grid;
  gap: 16px;
}
.audit-entry {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.audit-entry:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.audit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.audit-head .muted {
  margin: 0;
}
.audit-entry > .muted {
  margin: 6px 0;
}
.audit-entry > .kv {
  margin-top: 8px;
}
.change-table {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.change-head,
.change-line {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr);
  gap: 16px;
  padding: 8px 12px;
}
.change-head {
  background: var(--cream);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.change-line {
  border-top: 1px solid var(--line);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.change-field {
  font-weight: 600;
}
.change-line .kv-block {
  max-width: none;
  padding: 8px 10px;
}
.change-line .kv-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 4px 0;
}
.change-text del {
  background: #fde8e8;
  color: #8a1c1c;
  text-decoration: line-through;
}
.change-text ins {
  background: #e3f4e6;
  color: #1d5e2b;
  text-decoration: none;
  font-weight: 600;
}
.record-view .change-more {
  margin: 0;
  padding: 0;
  border: 0;
}
.record-view .change-more > summary {
  min-height: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  font-weight: 600;
}
@media (max-width: 640px) {
  .kv-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .evidence-body {
    padding: 0 12px 10px;
  }
  .record-view .evidence-section > summary {
    padding: 12px;
  }
  .change-head {
    display: none;
  }
  .change-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .change-line > [data-label]:not(.change-field)::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
  }
}
@media print {
  .evidence-tools {
    display: none;
  }
}

/* Pipeline scroll hint: handwritten word between two pen arrows. */
.scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 6px;
  color: var(--ink);
}
.scroll-hint[hidden] {
  display: none;
}
.scroll-word {
  font:
    600 28px/1 Caveat,
    'Bradley Hand',
    cursive;
}
.scroll-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.scroll-arrow svg {
  width: 150px;
  height: 26px;
  overflow: visible;
}
.scroll-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scroll-left svg {
  transform: scaleX(-1);
}
.scroll-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}
@media (max-width: 640px) {
  .scroll-arrow svg {
    width: 84px;
  }
  .scroll-word {
    font-size: 24px;
  }
}
@media print {
  .scroll-hint {
    display: none !important;
  }
}
.scroll-hint .scroll-arrow,
.scroll-hint .scroll-arrow:hover,
.scroll-hint .scroll-arrow:active,
.scroll-hint .scroll-arrow:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: inherit;
}
.scroll-hint .scroll-arrow:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 8px;
}
