/* contacts.css: Contacts list and contact detail pages.
   Every colour comes from tokens.css (no literals here). Dark mode lives in tokens.css only. */
.dt-item dd a:not(.btn) { text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1px; transition: background-size .38s cubic-bezier(.6, 0, .2, 1); padding-bottom: 2px; }
.dt-item dd a:not(.btn):focus-visible { background-size: 100% 1px; }
@media (hover: hover) {
  .dt-item dd a:not(.btn):hover { background-size: 100% 1px; }
}
@media (hover: none) {
  .dt-item dd a:not(.btn) { background-size: 100% 1px; }
}
.dt-status { align-items: center; gap: 10px; margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.dt-status::before { content: ""; width: 10px; height: 10px; background: var(--wait); }
.dt-status.fail::before { background: var(--err); }
.dt-list { margin: 10px 0 0; border-top: 1px solid var(--line); }
.dt-item { display: grid; grid-template-columns: 150px 1fr; gap: 4px 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.dt-item dt { color: var(--muted); font-size: 15px; padding-top: 4px; }
.dt-item dd { margin: 0; font-size: 20px; line-height: 1.4; color: var(--ink); font-weight: 400; overflow-wrap: anywhere; }
.dt-item dd a { color: var(--ink); }
.dt-item dd.pre { white-space: pre-wrap; }
@media (max-width: 560px) {
  .dt-item { grid-template-columns: 1fr; }
  .dt-item dt { padding-top: 0; }
}
#detail .bar { border-top: 0; }
.dt-top { padding-top: 6px; }
.dt-top h1 { margin: 0 0 6px; font: 300 clamp(36px, 7vw, 48px)/1.05 var(--serif); letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.dt-delete { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 0 100%; background: none; border: 0; color: var(--err); }
.dt-delete[hidden] { display: none; }
@media (min-width: 880px) {
  .dt-delete { flex: 0 0 auto; margin-right: auto; }
}
.dt-note { margin-top: 18px; }
@media (max-width: 879px) {
  #detail .bar .btn { flex: 1 1 110px; }
  #detail .bar #dtAdd { flex: 2 1 200px; }
}
#contacts .paper { min-height: 0; }
.ct-owner select{ width: 100%; font: 400 19px/1.3 var(--sans); color: var(--ink); background: var(--field); border: 0; border-bottom: 1px solid var(--field-line); border-radius: 0; padding: 0 12px; }
.ct-owner select:focus{ outline: none; border-bottom: 2px solid var(--ink); }
.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-chips .chipb { min-height: 44px; padding: 8px 14px; font-size: 16px; }
.ct-n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.chipb[aria-pressed="true"] .ct-n { color: inherit; opacity: .75; }
#ctList { margin-top: 0; }
#ctList .row { width: 100%; border-bottom: 1px solid var(--line); }
.ct-more { text-align: center; }
@media (max-width: 720px) {
  .ct-owner select{ height: 50px; font-size: 17px; }
  .ct-chips { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 0 20px; scrollbar-width: none; }
  .ct-chips::-webkit-scrollbar { display: none; }
  .ct-chips .chipb { flex: none; white-space: nowrap; }
}
.dt-act { margin: 36px 0 120px; }
.dt-actrow { padding: 14px 0; border-bottom: 1px solid var(--line); }
.dt-actmeta { font-size: 14px; color: var(--muted); }
.dt-actmeta b { color: var(--ink); font-weight: 600; }
.dt-acttext { font-size: 17px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  #ctImport { display: none; }
}
@media (min-width: 641px) {
  .dt-act .sec-head h2{ font-size: 26px; }
  .dt-item dd { font-size: 17px; }
  .dt-item dt { font-size: 14px; }
  .dt-actmeta{ font-size: 13px; }
  .dt-acttext{ font-size: 15px; }
  .ct-owner select{ font-size: 16px; height: 48px; }
  .ct-chips .chipb { min-height: 40px; padding: 6px 14px; font-size: 14.5px; }
  #contacts > .band { box-sizing: border-box; }
}
#contacts > .band { min-height: 0; }
#detail .dt-band .cm-navwrap { margin-top: 0; border-bottom: 0; }
@media (min-width: 641px) {
  #detail .dt-band .inner { gap: var(--s5); min-height: 56px; }
}
#detail .dt-top h1 { font-size: var(--t-h1); }
.dt-acts { flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0 var(--s5); }
.dt-acts .btn { width: auto; min-height: 40px; padding: 0 var(--s4); font-size: var(--t-body); flex: 0 0 auto; }
.dt-crm { margin-top: var(--s5); }
.dt-crm .sec-head h2, #detail .dt-act .sec-head h2 { font-size: var(--t-h2); }
.dt-row { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--row-pad) 0; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font: inherit; color: inherit; }
button.dt-row { cursor: pointer; }
.dt-row .m { flex: 1 1 auto; min-width: 0; }
.dt-row .n { font-size: var(--t-row); font-weight: 500; }
.dt-row .s { font-size: var(--t-meta); color: var(--muted); }
.dt-row .st { font-size: var(--t-body); font-weight: 500; white-space: nowrap; }
#detail .owner { padding: var(--s3); }
#detail .bar #dtAdd { font-size: var(--t-body); }
#detail .dt-delete { font-size: var(--t-meta); font-weight: 400; min-height: 40px; }
@media (max-width: 640px) {
  .dt-acts .btn { flex: 1 1 auto; }
}
@media (pointer: fine) {
  #detail #dtAdd { display: none; }
}
.dl-seg .ct-n { color: inherit; margin: 0; font-weight: 500; }
@media (max-width: 640px) {
  .dl-seg button:not([aria-checked="true"]) .ct-n { display: none; }
}
#firms .ct-more { margin: 14px 0 0; }
#contacts .dl-date { display: none; }
.ct-tr { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) 110px 100px 20px; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--bd-line); cursor: pointer; }
.ct-tr > * { min-width: 0; }
.ct-tr:not(.ct-th):hover .ct-p .bd-n { text-decoration: underline; text-underline-offset: 3px; }
.ct-th { padding: 8px 0; border-bottom-color: var(--bd-ink); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--bd-muted); cursor: default; }
.ct-p { display: flex; gap: 10px; align-items: center; }
.ct-p .bd-n, .ct-p .bd-s { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-p > span:last-child { min-width: 0; }
.ct-av { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: var(--bd-seg); font-size: 12px; font-weight: 500; color: var(--bd-ink); }
.ct-f { display: flex; gap: 8px; align-items: center; }
.ct-fn { border: 0; border-bottom: 1px solid var(--bd-line2); background: none; padding: 0; font: 15px var(--sans); color: var(--bd-ink); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: left; }
.ct-o, .ct-lc { font-size: 13px; }
.ct-lc.late { color: var(--bd-burg); }
.ct-chev { color: var(--bd-muted); display: grid; place-items: center; }
#contacts .ct-more { margin: 14px 0 0; }
@media (max-width: 640px) {
  .ct-th { display: none; }
  .ct-tr:not(.ct-th) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "p l"; gap: 6px 12px; align-items: start; padding: 14px 0; }
  .ct-p { grid-area: p; }
  .ct-lc { grid-area: l; }
  .ct-f { display: none; }
  .ct-o, .ct-chev { display: none; }
}
#ctOwnerBox { display: none; }
:is(#crm, #deals, #deal, #contacts, #firms) .mnav-back { display: none; }
