/* Copied from poll-tool (feedback-tool), which follows serify-page. Keep the two in step. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --paper: #faf9f6;
  --surface: #ffffff;
  --primary-50: #f5f6f8;
  --primary-200: #ccd1db;
  --primary-300: #a6afc0;
  --primary-400: #7a869f;
  --primary-600: #48536d;
  --primary-700: #3d4559;
  --secondary-50: #f6f5f2;
  --secondary-100: #edebe6;
  --secondary-200: #dcd8d1;
  --secondary-500: #726c62;
  --secondary-600: #666057;
  --secondary-900: #3e3a35;
  --accent-600: #8f5c2e;
  --err-bg: #fdf2f1;
  --err-line: #f0c4bf;
  --err-ink: #8a2c22;

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

/* Room for the scrollbar on every page, so the centered layout does not
   shift between short and long pages when scrollbars are always shown. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.6 var(--font-sans);
  color: var(--secondary-900);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(40rem 40rem at 15% -10%, rgb(72 83 109 / .10), transparent 60%),
    radial-gradient(38rem 38rem at 90% 0%, rgb(168 112 60 / .09), transparent 60%),
    var(--paper);
  background-repeat: no-repeat;
}

::selection { background: var(--primary-600); color: #fff; }
:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--secondary-900);
}
h1 { font-size: 2rem; font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .75rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

a {
  color: var(--primary-600);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--primary-300);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
a:hover { color: var(--primary-700); text-decoration-color: var(--primary-600); }

/* Layout */

.container { max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }
.wide .container { max-width: 64rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(255 255 255 / .95);
  border-bottom: 1px solid var(--secondary-100);
}
.site-header .container { display: flex; align-items: center; gap: 1rem; height: 4rem; }

.brand { display: flex; align-items: center; gap: .625rem; margin-right: auto; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand .wordmark {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--primary-700);
}
.brand .product {
  padding-left: .625rem;
  border-left: 1px solid var(--secondary-200);
  font-size: .875rem;
  font-weight: 500;
  color: var(--secondary-600);
}

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a, .nav button.link {
  padding: .5rem .75rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--secondary-600);
  text-decoration: none;
}
.nav a:hover, .nav button.link:hover { color: var(--primary-600); }
.nav a[aria-current] { color: var(--primary-700); font-weight: 600; }
/* Each link reserves the width of its bold label, so marking the current
   page does not push its neighbours. */
.nav a { display: inline-grid; }
.nav a::after { content: attr(data-label); font-weight: 600; height: 0; overflow: hidden; visibility: hidden; }
.nav form { margin: 0; }

main.container { padding-top: 2.5rem; padding-bottom: 4rem; }

/* Footer at the bottom of the viewport on short pages. */
body { display: flex; flex-direction: column; }
main.container { flex: 1 0 auto; width: 100%; }
.site-footer { border-top: 1px solid var(--secondary-100); font-size: .875rem; color: var(--secondary-600); }
.site-footer .container { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.site-footer a { color: inherit; text-decoration-thickness: 1px; }
.site-footer form { display: inline; margin: 0; }
.site-footer button.link { padding: 0; font-size: inherit; font-weight: 500; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--secondary-100);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin: 0 0 1.25rem;
}
.card.narrow { max-width: 26rem; margin: 2rem auto; }

.eyebrow {
  margin: 0 0 .75rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-600);
}
.eyebrow a { color: inherit; text-decoration-color: rgb(143 92 46 / .35); }
.muted, .note { color: var(--secondary-600); }
.note { font-size: .9rem; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; color: var(--secondary-600); margin: 0 0 1.5rem; }

.msg {
  padding: .875rem 1.125rem;
  border-radius: .75rem;
  border: 1px solid var(--secondary-100);
  background: var(--secondary-50);
}
.msg.ok { background: var(--primary-50); border-color: var(--primary-200); }
.msg.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }

/* Forms */

.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.stack > * { margin: 0; }
.stack > button { align-self: flex-start; }

label { display: block; font-weight: 500; margin: 0 0 .375rem; }
input, textarea, select, button { font: inherit; color: inherit; }
/* 16px text in fields keeps iOS from zooming on focus. */
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--secondary-200);
  border-radius: .75rem;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--primary-50); }
input::placeholder, textarea::placeholder { color: var(--secondary-500); opacity: 1; }
textarea { resize: vertical; min-height: 5.5rem; }
input[type=checkbox] { accent-color: var(--primary-600); width: 1.05rem; height: 1.05rem; }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border: 1px solid var(--secondary-200);
  border-radius: .75rem;
  background: var(--surface);
  color: var(--secondary-900);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
}
button:hover { border-color: var(--primary-300); color: var(--primary-700); }
button.primary {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
button.primary:hover { background: var(--primary-700); border-color: var(--primary-700); color: #fff; box-shadow: var(--shadow-md); transform: translateY(-2px); }
button.danger { color: var(--err-ink); border-color: var(--err-line); }
button.danger:hover { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-ink); }
button.link { border: 0; background: none; box-shadow: none; }
button:disabled { opacity: .35; cursor: default; transform: none; }

.row { display: flex; gap: .5rem; }
.row input { flex: 1; }

/* Admin */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; align-items: end; }
.grid-2 .full { grid-column: 1 / -1; }
.grid-2 .check label { font-weight: 500; display: flex; gap: .5rem; align-items: center; padding-bottom: .75rem; }

table.list {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--secondary-100);
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
table.list th, table.list td { text-align: left; padding: .875rem 1rem; border-bottom: 1px solid var(--secondary-100); }
table.list tbody tr:last-child td { border-bottom: 0; }
/* The action column takes only what its buttons need. */
table.list td.actions { width: 1%; text-align: right; white-space: nowrap; }
table.list td:first-child { overflow-wrap: anywhere; }
/* Closed stages, folded away below the open ones. */
details.archive summary { cursor: pointer; color: var(--primary-600); font-weight: 600; margin: 0 0 .75rem; }
table.list td.actions form { display: inline-block; margin: .25rem 0 .25rem .5rem; }
table.list th {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--secondary-500);
  background: var(--secondary-50);
}
.num { text-align: right !important; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: .2rem .75rem;
  border: 1px solid var(--secondary-200);
  border-radius: 999px;
  background: var(--secondary-50);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--secondary-600);
}
.pill.open { border-color: var(--primary-200); background: var(--primary-50); color: var(--primary-700); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* CRM */

.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin: 0 0 1rem; }
.head h1 { margin: 0; margin-right: auto; }
.head a.button, a.button {
  display: inline-flex;
  align-items: center;
  padding: .5rem 1rem;
  border: 1px solid var(--primary-600);
  border-radius: .75rem;
  background: var(--primary-600);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
a.button:hover { background: var(--primary-700); border-color: var(--primary-700); color: #fff; }

/* Pipeline switcher: one pill per type, the current one filled. */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.tabs a {
  padding: .375rem 1rem;
  border: 1px solid var(--secondary-200);
  border-radius: 999px;
  background: var(--surface);
  font-size: .875rem;
  color: var(--secondary-600);
  text-decoration: none;
}
.tabs a:hover { border-color: var(--primary-300); color: var(--primary-700); }
.tabs a[aria-current] { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }

h2 .count { font-family: var(--font-sans); font-size: .875rem; font-weight: 500; color: var(--secondary-500); margin-left: .375rem; }
.stage { margin-bottom: 1.5rem; }
.stage h2 { margin-bottom: .5rem; }
.stage .empty { margin: 0 0 .5rem; font-size: .9rem; }

.danger-zone { border-color: var(--err-line); }
/* Deal tables: fixed columns, so they line up across stages and pipelines
   instead of each sizing itself to its own content. */
table.deals { table-layout: fixed; }
table.deals td { overflow-wrap: break-word; }
table.deals .c-stage { width: 9rem; }
table.deals .c-contact { width: 9.5rem; }
table.deals .c-owner { width: 8.5rem; }
table.deals .c-follow { width: 9rem; }
table.deals .c-deadline { width: 7.5rem; }
table.deals .c-amount { width: 8rem; }

.pill.warn { border-color: var(--err-line); background: var(--err-bg); color: var(--err-ink); }
td .sub { display: block; font-size: .875rem; color: var(--secondary-600); }

/* Key facts of a deal or contact, label above value. */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem 1.25rem; margin: 0 0 1.5rem; }
.facts div { min-width: 0; overflow-wrap: anywhere; }
.facts dt { font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--secondary-500); }
.facts dd { margin: 0; }

.notes { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.notes li { padding: .875rem 0; border-top: 1px solid var(--secondary-100); }
.notes .by { display: flex; align-items: center; gap: .75rem; font-size: .875rem; color: var(--secondary-600); }
.notes .by form { margin: 0 0 0 auto; }
.notes .by button { padding: 0 .375rem; font-size: .8rem; font-weight: 500; }
.notes p { margin: .25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Header search: between logo and nav; a row of its own on small screens. */
.site-search { margin: 0; }
/* input[type=search] to outrank the general field rule above. */
.site-search input[type=search] { width: 12rem; padding: .375rem .75rem; font-size: .875rem; border-radius: .5rem; }

.hits { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--secondary-100); border-radius: 1rem; box-shadow: var(--shadow-sm); }
.hits li { padding: .75rem 1rem; border-top: 1px solid var(--secondary-100); overflow-wrap: anywhere; }
.hits li:first-child { border-top: 0; }
.hits .snippet { display: block; font-size: .9rem; color: var(--secondary-600); }
mark { background: var(--primary-50); color: var(--primary-700); font-weight: 600; border-radius: 3px; padding: 0 .1em; }
a.mention { font-weight: 600; }

.search { display: flex; gap: .5rem; margin: 0 0 1.25rem; }
.search input { flex: 1; }
.actions-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.actions-row form { margin: 0; }

@media (max-width: 36rem) {
  h1 { font-size: 1.6rem; }
  .card { padding: 1.25rem; }
  table.list td.actions form { display: block; margin: .25rem 0; }
  table.list td.actions button { width: 100%; white-space: nowrap; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Narrower windows: deadline and amount go first, the deal page has them. */
@media (max-width: 68rem) {
  table.list .opt-md { display: none; }
}

/* Tablets and phones: secondary columns go, the first column carries them
   as sub lines. */
@media (max-width: 52rem) {
  table.list th, table.list td { padding: .75rem .5rem; }
  table.list th, table.list .pill { letter-spacing: 0; }
  table.list .pill { padding: .2rem .5rem; }
  table.list .opt { display: none; }
  table.deals .c-follow { width: 7.5rem; }
}
@media (min-width: 52.01rem) {
  table.list td .sub.sm { display: none; }
}

/* The nav gets a row of its own below the logo. */
@media (max-width: 48rem) {
  .site-header .container { flex-wrap: wrap; height: auto; padding-top: .5rem; padding-bottom: .25rem; gap: 0; }
  .brand { margin-right: auto; }
  .site-search input[type=search] { width: 9rem; }
  .nav { width: 100%; justify-content: space-between; }
  .nav a { padding: .5rem .25rem; font-size: .875rem; white-space: nowrap; }
  .nav a:first-child { padding-left: 0; }
  .nav a:last-child { padding-right: 0; }
}
@media (max-width: 25rem) {
  .nav a { font-size: .8125rem; }
  main.container, .site-header .container, .site-footer .container { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 21rem) {
  .nav a { padding-left: 0; padding-right: 0; }
  .site-search input[type=search] { width: 7rem; }
}
