/* Barq CRM design tokens and components. */
:root {
  --bg: #eef0f3;
  --frame: #ffffff;
  --side: #f6f7f9;
  --ink: #141922;
  --muted: #5a6372;
  --faint: #8a93a2;
  --line: #dfe3e9;
  --line2:#eceff3;
  --accent: #2d4fc4;
  --accent-ink: #ffffff;
  --accent-soft: #e6ebfa;
  --ok: #0e7a4f;
  --ok-soft: #e1f3ea;
  --warn: #a86300;
  --warn-soft: #fbefdc;
  --bad: #b4233c;
  --bad-soft: #fbe4e8;
  --info: #6a45bd;
  --info-soft: #efe8fb;
  --skip: #6f7786;
  --skip-soft: #eceef1;
  --prio: #b4233c;
  --good: #0e7a4f;
  --cons: #2d62c4;
  --care: #a86300;
  --rev: #6a45bd;
  --slack: #f8f8f8;
  --slack-ink: #1d1c1d;
  --sans: "IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono: "IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --frame: #161a20;
    --side: #12161b;
    --ink: #e6e9ee;
    --muted: #9aa3b1;
    --faint: #6f7886;
    --line: #2a303a;
    --line2:#20252d;
    --accent: #7d97ff;
    --accent-ink: #0f1216;
    --accent-soft: #1e2640;
    --ok: #4cc38a;
    --ok-soft: #15291f;
    --warn: #e3a54a;
    --warn-soft: #2e2414;
    --bad: #f07a8c;
    --bad-soft: #331920;
    --info: #b59af0;
    --info-soft: #251d38;
    --skip: #9aa3b1;
    --skip-soft: #20252d;
    --prio: #f07a8c;
    --good: #4cc38a;
    --cons: #7da6ff;
    --care: #e3a54a;
    --rev: #b59af0;
    --slack: #1d2026;
    --slack-ink: #e6e9ee;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --frame: #161a20;
  --side: #12161b;
  --ink: #e6e9ee;
  --muted: #9aa3b1;
  --faint: #6f7886;
  --line: #2a303a;
  --line2:#20252d;
  --accent: #7d97ff;
  --accent-ink: #0f1216;
  --accent-soft: #1e2640;
  --ok: #4cc38a;
  --ok-soft: #15291f;
  --warn: #e3a54a;
  --warn-soft: #2e2414;
  --bad: #f07a8c;
  --bad-soft: #331920;
  --info: #b59af0;
  --info-soft: #251d38;
  --skip: #9aa3b1;
  --skip-soft: #20252d;
  --prio: #f07a8c;
  --good: #4cc38a;
  --cons: #7da6ff;
  --care: #e3a54a;
  --rev: #b59af0;
  --slack: #1d2026;
  --slack-ink: #e6e9ee;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

button,input,select,textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono,.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.small {
  font-size: 12.5px;
}

h1,h2,h3,h4 {
  margin: 0;
  text-wrap: balance;
}

/* app frame */
.app {
  background: var(--frame);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px minmax(0,1fr);
  min-height: 720px;
}

@media (max-width:760px) {
  .app {
    grid-template-columns: minmax(0,1fr);
  }
}

.nav {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width:760px) {
  .nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding: 10px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  padding: 0 6px;
}

.brand i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  display: inline-block;
}

@media (max-width:760px) {
  .brand {
    display: none;
  }
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

@media (max-width:760px) {
  .nav-group {
    flex-direction: row;
    gap: 4px;
  }
}

.nav-group b {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--faint);
  padding: 0 8px 4px;
  font-weight: 600;
}

@media (max-width:760px) {
  .nav-group b {
    display: none;
  }
}

.nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13.5px;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--line2);
}

.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav a .count {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--bad);
  color: var(--frame);
  border-radius: 99px;
  padding: 0 6px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.topbar .crumbs {
  font-size: 13px;
  color: var(--muted);
}

.topbar .crumbs b {
  color: var(--ink);
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.quota {
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 10px;
}

.quota b {
  color: var(--ok);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

.ws {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ws-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.ws-head h2 {
  font-size: 19px;
  font-weight: 700;
}

.ws-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.job-refresh-status {
  flex-basis: 100%;
}

.job-refresh-spinner {
  display: none;
  width: 0.9em;
  height: 0.9em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: job-refresh-spin 0.7s linear infinite;
}

.htmx-request .job-refresh-spinner {
  display: inline-block;
}

@keyframes job-refresh-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .job-refresh-spinner { animation: none; }
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.grid2 {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(0,1fr);
  gap: 16px;
  align-items: start;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
}

@media (max-width:900px) {
  .grid2 {
    grid-template-columns: minmax(0,1fr);
  }
  .grid4 {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .grid3 {
    grid-template-columns: minmax(0,1fr);
  }
}

/* components */
.btn {
  border: 1px solid var(--line);
  background: var(--frame);
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  border-color: var(--faint);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.danger {
  color: var(--bad);
}

.btn.sm {
  padding: 2px 8px;
  font-size: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.field input,.field select,.field textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  background: var(--frame);
  font-size: 13.5px;
  color: var(--ink);
  min-width: 0;
}

.field textarea {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--side);
}

.filters .field {
  min-width: 120px;
}

/* A single filter that sits inline in a screen header, next to its status chips. */
.head-actions {
  align-items: center;
}

.inline-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.inline-filter select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 9px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--frame);
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.card h3 {
  font-size: 14px;
  font-weight: 600;
}

.card h3 .muted {
  font-weight: 400;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 9px;
  border-radius: 99px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.t-must {
  color: var(--rev);
  background: var(--info-soft);
  border-color: currentColor;
}

.t-prio {
  color: var(--prio);
  background: var(--bad-soft);
}

.t-good {
  color: var(--good);
  background: var(--ok-soft);
}

.t-cons {
  color: var(--cons);
  background: var(--accent-soft);
}

.t-care {
  color: var(--care);
  background: var(--warn-soft);
}

.t-rev {
  color: var(--rev);
  background: var(--info-soft);
}

.t-skip {
  color: var(--skip);
  background: var(--skip-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  white-space: nowrap;
  color: var(--muted);
}

.c-ok {
  color: var(--ok);
  border-color: currentColor;
  background: var(--ok-soft);
}

.c-warn {
  color: var(--warn);
  border-color: currentColor;
  background: var(--warn-soft);
}

.c-bad {
  color: var(--bad);
  border-color: currentColor;
  background: var(--bad-soft);
}

.c-info {
  color: var(--info);
  border-color: currentColor;
  background: var(--info-soft);
}

.c-acc {
  color: var(--accent);
  border-color: currentColor;
  background: var(--accent-soft);
}

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line2);
  vertical-align: top;
}

th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--faint);
  font-weight: 600;
  background: var(--side);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

td.n {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.jobs td:nth-child(2) {
  min-width: 280px;
}

table.jobs {
  min-width: 900px;
}

tr.dim td {
  opacity: .55;
}

tr.hl td {
  background: var(--bad-soft);
}

tr.hl td:first-child {
  box-shadow: inset 3px 0 0 var(--prio);
}

.jt {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.jt:hover {
  text-decoration: underline;
}

.sub {
  font-size: 12px;
  color: var(--muted);
}

.banner {
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.banner.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.banner.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.banner.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.banner.info {
  background: var(--accent-soft);
  color: var(--accent);
}

.banner b {
  color: inherit;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.empty b {
  color: var(--ink);
  font-size: 15px;
}

.skel {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg,var(--line2),var(--line),var(--line2));
  background-size: 200% 100%;
  animation: sh 1.4s infinite linear;
}

@keyframes sh {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .skel {
    animation: none;
  }
}

.kv {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 4px 14px;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bar {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr) 54px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}

.bar .track {
  height: 8px;
  background: var(--line2);
  border-radius: 99px;
  overflow: hidden;
}

.bar .track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.bar .v {
  font-family: var(--mono);
  text-align: right;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}

.checks div {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr) auto;
  gap: 6px;
  align-items: start;
}

.ic {
  font-weight: 700;
  font-family: var(--mono);
}

.ic.ok {
  color: var(--ok);
}

.ic.bad {
  color: var(--bad);
}

.ic.warn {
  color: var(--warn);
}

.ic.off {
  color: var(--faint);
}

.proposal {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: var(--side);
  margin: 0;
}

.proposal mark {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 3px;
}

.hook {
  border-bottom: 2px solid var(--warn);
}

.tl {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 12.5px;
}

.tl div {
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  gap: 8px;
  padding: 5px 0;
  border-left: 2px solid var(--line);
  padding-left: 10px;
  margin-left: 4px;
}

.tl div span:first-child {
  font-family: var(--mono);
  color: var(--muted);
}

.switch {
  width: 34px;
  height: 19px;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  border: 0;
  cursor: pointer;
  flex: none;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--frame);
  transition: left .15s;
}

.switch[aria-checked="true"] {
  background: var(--ok);
}

.switch[aria-checked="true"]::after {
  left: 17px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4,minmax(190px,1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.col {
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 170px;
}

.col h4 {
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 600;
  padding: 2px 4px;
}

.kc {
  background: var(--frame);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}

.kc b {
  font-size: 13px;
  line-height: 1.35;
}

.kc.alert {
  border-color: var(--bad);
  box-shadow: inset 3px 0 0 var(--bad);
}

.tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile .big {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
}

.tile .l {
  font-size: 12.5px;
  color: var(--muted);
}

.tile .tgt {
  font-size: 12px;
  font-family: var(--mono);
}

.diff {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  font-size: 13px;
}

.diff div {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line2);
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  gap: 6px;
}

.diff div:last-child {
  border-bottom: 0;
}

.diff .add {
  background: var(--ok-soft);
}

.diff .add .ic {
  color: var(--ok);
}

.diff .del {
  background: var(--bad-soft);
}

.diff .del .ic {
  color: var(--bad);
}

.diff .chg {
  background: var(--warn-soft);
}

.diff .chg .ic {
  color: var(--warn);
}

.card h4 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.qa {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.qa p {
  margin: 0;
  line-height: 1.55;
}

pre.code {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  overflow-x: auto;
  line-height: 1.5;
}

.tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.cond {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,.9fr) minmax(0,1fr) auto;
  gap: 6px;
  align-items: center;
}

@media (max-width:640px) {
  .cond {
    grid-template-columns: minmax(0,1fr);
  }
}

.cond select,.cond input {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--frame);
  font-size: 13px;
  min-width: 0;
}

.gauge {
  height: 10px;
  background: var(--line2);
  border-radius: 99px;
  overflow: hidden;
}

.gauge i {
  display: block;
  height: 100%;
  background: var(--ok);
}

.login {
  max-width: 360px;
  margin: 60px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

.toast {
  position: relative;
  align-self: flex-start;
  background: var(--ink);
  color: var(--frame);
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 13px;
}

/* Application shell */
body {
  margin: 0;
}

.app {
  border: 0;
  border-radius: 0;
  min-height: 100dvh;
}

.screen, .login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login {
  background: var(--frame);
  margin-inline: auto;
  width: calc(100% - 32px);
}

.login button {
  align-self: flex-start;
}

.pause-banner {
  margin: 10px 18px 0;
}

/* Keep controls and data layouts usable on touch screens. */
@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding: 10px;
    overscroll-behavior-x: contain;
  }

  .brand, .nav-group b {
    display: none;
  }

  .nav-group {
    flex-direction: row;
    gap: 4px;
  }

  .nav a, .btn, button:not(.switch), summary {
    min-height: 40px;
    min-width: 40px;
    align-items: center;
  }

  .field input, .field select, .cond input, .cond select,
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select {
    min-height: 40px;
    max-width: 100%;
  }

  input[type="checkbox"], input[type="radio"] {
    width: 40px;
    height: 40px;
    vertical-align: middle;
  }

  .switch {
    width: 54px;
    height: 40px;
    border: 10px solid transparent;
    border-radius: 99px;
    background-clip: padding-box;
  }

  .switch[aria-checked] {
    background-clip: padding-box;
  }

  .tbl-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .tbl-wrap table {
    min-width: 760px;
  }

  .proposal, .card, .banner, .ws-head {
    overflow-wrap: anywhere;
  }
}

/* Job page: stats, skill matches, questions, qualifications and client history (p6-jobpage). */
.ws-head .job-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--ink);
}

.job-stats b {
  font-variant-numeric: tabular-nums;
}

.chip.skill-match {
  color: var(--ok);
  border-color: currentColor;
  background: var(--ok-soft);
}

.job-questions,
.job-qualifications,
.client-history {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-history li {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stars {
  color: var(--warn);
  letter-spacing: 1px;
}

/* Job page: client company description, two lines until opened (p7-clientmoney). */
.company-about summary {
  cursor: pointer;
  list-style: none;
}

.company-about:not([open]) summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* Job page: attachments card, one compact row per file (p9-attach). */
.job-attachments {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-attachments li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.job-attachment-name {
  overflow-wrap: anywhere;
}

/* Draft editor: highlighted [CONFIRM ...] blanks, the Blanks list, the editor and Ask AI (p9-editor). */
mark.ph,
.proposal mark.ph {
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 2px dashed currentColor;
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 600;
}

.draft-answer {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.blanks,
.draft-chat {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blanks {
  border-color: var(--warn);
}

.blanks > .sub {
  margin: 0;
}

.blank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  font-size: 13px;
}

.blank .field {
  flex: 1 1 240px;
}

.draft-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.draft-editor .sub {
  margin: 0;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--side);
}

.chat-msg.user {
  background: var(--accent-soft);
}

.chat-msg p,
.chat-msg ul {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-msg ul {
  padding-left: 18px;
  white-space: normal;
}

.draft-chat form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.draft-chat .field {
  align-self: stretch;
}

/* Draft editor: the Filled list with Undo (p10-editor). */
.filled {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filled .blank {
  justify-content: space-between;
  align-items: center;
}

/* Connects: one line under the job title, and a panel beside the submit form. */
.job-connects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 4px 0;
}

.connects-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.submit-split {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(240px,300px);
  gap: 16px;
  align-items: start;
}

.submit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}

.submit-pay-by,
.submit-milestones {
  flex-basis: 100%;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.submit-pay-by legend {
  margin-bottom: 4px;
  padding: 0;
}

.milestone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.milestone-row input {
  max-width: 100%;
}

.submit-form:not(:has([name="pay_by"][value="milestones"]:checked)) .submit-milestones,
.submit-form:has([name="pay_by"][value="milestones"]:checked) .submit-project-amount,
.submit-form:not([data-milestones-ready]) :is([data-add-milestone], [data-remove-milestone]),
.milestone-row:only-child [data-remove-milestone] {
  display: none;
}

.connects-panel {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--side);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connects-panel h4,.connects-panel h5 {
  margin: 0;
  font-size: 13px;
}

.connects-panel h5 {
  color: var(--muted);
  font-weight: 500;
}

.connects-facts {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  margin: 0;
}

.connects-facts dt {
  font-size: 12px;
  color: var(--muted);
}

.connects-facts dd {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.boost-spots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
}

.boost-spot {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: baseline;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--frame);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
}

button.boost-spot {
  cursor: pointer;
}

button.boost-spot:hover,button.boost-spot:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.boost-spot .sub {
  grid-column: 1 / -1;
}

.boost-spot.open {
  color: var(--muted);
  border-style: dashed;
}

.boost-rank {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width:760px) {
  .submit-split {
    grid-template-columns: minmax(0,1fr);
  }
}

/* Proposals sent, on the job page. */
.sent-proposal {
  border-top: 1px solid var(--line2);
  padding: 10px 0;
}

.sent-proposal:first-of-type {
  border-top: 0;
}

.sent-proposal.hl {
  background: var(--accent-soft);
  border-radius: 7px;
  padding: 10px;
}

.sent-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 4px;
}

.sent-actions {
  margin-top: 12px;
}

.sent-edit-form {
  display: grid;
  gap: 14px;
  max-width: 68rem;
}

.sent-edit-form textarea {
  resize: vertical;
}

.sent-change + .sent-change {
  margin-top: 16px;
}

.draft-suggestion fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  margin: 10px 0;
}

.draft-suggestion summary {
  color: var(--muted);
  cursor: pointer;
}

.draft-review ul {
  margin-bottom: 0;
}

.sent-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sent-comparison h4 {
  margin-bottom: 6px;
}

.sent-comparison .proposal {
  margin: 0;
  min-height: 4rem;
}

@media (max-width: 760px) {
  .sent-comparison {
    grid-template-columns: minmax(0, 1fr);
  }
}

.proposals-filters input[type="search"] {
  width: 14ch;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 9px;
  font: inherit;
  color: var(--ink);
  background: var(--frame);
}

.proposals-table td:first-child {
  width: 34%;
  min-width: 280px;
  overflow-wrap: anywhere;
}

.proposal-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.link-btn {
  font: inherit;
  font-size: 12.5px;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 2px 0;
  margin-top: 2px;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

/* An opened proposal spans the whole table: cover letter left, screening answers right. */
.proposals-table tr:has(+ .proposal-open-row:not([hidden])) td {
  border-bottom: 0;
  background: var(--accent-soft);
}

.proposal-open-row td {
  background: var(--side);
}

.proposal-open {
  display: grid;
  grid-template-columns: minmax(0,1.7fr) minmax(0,1fr);
  gap: 20px;
  padding: 4px 0 8px;
}

.proposal-open h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.proposal-open .proposal {
  max-width: 90ch;
  margin: 0;
}

.proposal-open dt {
  font-weight: 600;
  margin-top: 8px;
}

.proposal-open dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

@media (max-width:900px) {
  .proposal-open {
    grid-template-columns: minmax(0,1fr);
  }
}

/* Client invitations: the inbox section and the job page card. */
.invitation-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.invitation-list li {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line2);
}

.invitation-list li:first-child {
  border-top: 0;
}

.invitation-card .decline {
  margin-top: 8px;
}

.invitation-card .decline summary {
  cursor: pointer;
  color: var(--muted);
}

/* Upwork MCP connections on the Upwork accounts screen. */
.mcp-connection {
  border-top: 1px solid var(--line2);
  padding: 10px 0;
}

.mcp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 4px;
}

/* Answer Library: a review queue. Tabs on top, questions grouped by topic on the left, one question to
   review on the right with its suggested answer first and the details folded away. */
.answers-intro {
  margin: 4px 0 0;
  color: var(--muted);
}

.answers-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.answers-progress p {
  margin: 0;
}

.answers-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}

.answers-meter {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: var(--line2);
}

.answers-meter::-webkit-progress-bar {
  background: var(--line2);
}

.answers-meter::-webkit-progress-value {
  background: var(--ok, var(--accent));
}

.answers-meter::-moz-progress-bar {
  background: var(--ok, var(--accent));
}

.answers-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.answers-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.answers-tabs a:hover {
  color: var(--ink);
}

.answers-tabs a[aria-current] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.answers-tabs .count {
  padding: 0 7px;
  border-radius: 99px;
  background: var(--line2);
  font-size: 12px;
}

.answers-selection {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(0, 5fr);
  align-items: start;
  gap: 14px;
}

.answers-entries {
  max-height: 78vh;
  overflow-y: auto;
}

.answers-entries h3 {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.answers-entries h3:first-of-type {
  margin-top: 0;
}

.answers-entries ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.answers-entries a {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.answers-entries a:hover {
  background: var(--line2);
}

.answers-entries a[aria-current] {
  background: var(--accent-soft);
  color: var(--accent);
}

.answers-list-note {
  margin: 0 0 10px;
}

.answers-detail {
  display: grid;
  gap: 14px;
}

.answers-detail header h3 {
  margin: 0;
  font-size: 18px;
}

.answers-detail header p,
.answers-detail .banner {
  margin: 4px 0 0;
}

.answers-main {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--side);
}

.answers-main h4,
.answers-others h4 {
  margin: 0;
}

.answers-main p,
.answers-example p {
  margin: 0;
}

.answers-main-text {
  font-size: 15px;
}

.answers-others {
  display: grid;
  gap: 8px;
}

.answers-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.answers-example {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.answers-example + .answers-example,
.answers-others details .answers-example {
  margin-top: 0;
}

.answers-others details {
  display: grid;
  gap: 8px;
}

.answers-others details[open] summary {
  margin-bottom: 8px;
}

.answers-others details .answers-example + .answers-example {
  margin-top: 8px;
}

.answers-example-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 10px;
}

.answers-more {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.answers-more summary,
.answers-others summary {
  cursor: pointer;
  font-weight: 600;
}

.answers-more > p {
  margin: 8px 0;
}

.answers-more .answers-example {
  margin-top: 8px;
}

.answers-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.answers-phrases li {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--side);
  overflow-wrap: anywhere;
}

.answers-new {
  display: grid;
  gap: 10px;
}

.answers-new > p {
  margin: 0;
}

.answers-new h4 {
  margin: 0;
}

.answers-new select {
  max-width: min(100%, 19rem);
}

@media (max-width: 1050px) {
  .answers-selection {
    grid-template-columns: minmax(0, 1fr);
  }

  .answers-entries {
    max-height: 16rem;
  }
}

/* A job whose attachments VirusTotal flagged as malware: red stripes in the inbox, whatever its tier
   (Prioritize rows already have a light red tint, so a plain tint would not stand out). */
tr.malware td {
  background: repeating-linear-gradient(135deg, var(--bad-soft) 0 10px, var(--frame) 10px 20px);
}

tr.malware td:first-child {
  box-shadow: inset 5px 0 0 var(--bad);
}

.chip.malware {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
  font-weight: 600;
}
.chat-settings {
  display: grid;
  gap: 10px;
}

.chat-settings input[type="number"] {
  width: 5rem;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(0, 2.2fr);
  gap: 16px;
  align-items: start;
}

.chat-list,
.chat-conversation {
  padding: 0;
  gap: 0;
  background: var(--frame);
  overflow: hidden;
}

.chat-list {
  max-height: min(70vh, 48rem);
  overflow-y: auto;
}

.chat-item {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-inline-start: 3px solid transparent;
  color: var(--ink);
  text-decoration: none;
}

.chat-item + .chat-item {
  border-top: 1px solid var(--line);
}

.chat-item:hover {
  background: var(--side);
  text-decoration: none;
}

.chat-item[aria-current="page"] {
  border-inline-start-color: var(--accent);
  background: var(--accent-soft);
}

.chat-item-head,
.chat-conversation-head,
.chat-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
}

.chat-item-title,
.chat-preview {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-item-title {
  font-weight: 500;
}

.chat-preview,
.chat-message-meta time,
.chat-day {
  color: var(--muted);
  font-size: 12px;
}

.chat-conversation-head,
.chat-status,
.chat-footer {
  padding: 14px 16px;
}

.chat-conversation-head {
  border-bottom: 1px solid var(--line);
}

.chat-conversation-head h3 {
  font-size: 17px;
  margin: 0 0 4px;
}

.chat-history {
  max-height: min(65vh, 42rem);
  overflow-y: auto;
  padding: 0 16px 14px;
}

.chat-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  font-weight: 500;
}

.chat-day::before,
.chat-day::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.chat-messages {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.chat-message {
  justify-self: start;
  max-width: min(88%, 44rem);
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 10px 3px;
  background: var(--side);
  overflow-wrap: anywhere;
}

.chat-message-team {
  justify-self: end;
  border-radius: 10px 10px 3px 10px;
  background: var(--accent-soft);
}

.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  font-size: 12px;
}

.chat-message-text {
  white-space: pre-wrap;
}

.chat-message > :not(:first-child),
.chat-message details p {
  margin-top: 4px;
}

.chat-message summary {
  color: var(--accent);
  cursor: pointer;
}

.chat-footer {
  border-top: 1px solid var(--line);
  background: var(--side);
}

@media (max-width: 1050px) {
  .chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-list {
    max-height: 21rem;
  }
}

/* Scout content reuses Barq CRM's workspace and component styles. */
.scout-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40rem; overflow: auto; }
