/* Lists: contacts (.ct-), settings (.st-). Tokens come from base.css. */

/* ---------- contacts ---------- */
.ct-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ct-search { flex: 1; min-width: 220px; max-width: 420px; }
.ct-seg { max-width: 100%; overflow-x: auto; }
.ct-note { margin: 0 0 10px; font-size: 13px; }
.ct-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ct-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 650; }
.ct-sub { font-size: 12.5px; }
.ct-mobile-only { display: none; }
.ct-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-table tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ct-drawer .ct-deals { display: flex; flex-direction: column; }
.ct-deal { display: flex; align-items: center; gap: 10px; padding: 9px 4px; min-height: 40px; background: none; border: 0; border-bottom: 1px solid var(--line-soft); text-align: left; cursor: pointer; width: 100%; }
.ct-deal:last-child { border-bottom: 0; }
.ct-deal:hover { background: var(--surface-2); }
.ct-deal .ct-sub { display: block; }
.ct-act { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.ct-act:last-child { border-bottom: 0; }
.ct-when { flex: none; width: 72px; font-size: 12.5px; }
@media (max-width: 860px) {
  .ct-mobile-only { display: block; }
  .ct-search { max-width: none; }
}

/* ---------- tasks ---------- */
@media (max-width: 860px) {
}

/* ---------- invoices ---------- */
@media (max-width: 860px) {
}

/* ---------- settings ---------- */
/* layout: sections on the left (desktop), a select on top (phone) */
.st-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1080px; }
.st-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.st-nav-item { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--muted); font-weight: 540; text-align: left; cursor: pointer; width: 100%; }
.st-nav-item:hover { background: var(--surface); color: var(--text); }
.st-nav-item.on { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: var(--shadow); }
.st-dot-dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.st-pick { display: none; }
.st-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.st-title { display: flex; flex-direction: column; gap: 2px; }
.st-title h2 { font-size: 18px; }
.st-title p { margin: 0; }

/* cards and text */
.st-stack { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.st-card { display: flex; flex-direction: column; gap: 12px; }
.st-card h3 { font-size: 15px; }
.st-card p { margin: 0; }
.st-sub { font-size: 13.5px; margin-top: 4px; }
.st-small { font-size: 12.5px; }
.st-hint { font-size: 12.5px; color: var(--muted); }
.st-wrap .btn { min-height: 36px; }
.st-wrap .btn-icon { min-width: 36px; justify-content: center; }
.st-wrap .input, .st-wrap .select { min-height: 38px; }
.st-link { color: var(--focus); font-weight: 560; }
.st-err { display: flex; align-items: flex-start; gap: 6px; color: var(--bad); font-size: 13px; font-weight: 520; }
.st-err svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.st-callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--info-bg); color: var(--text); border: 1px solid var(--line-soft); }
.st-callout svg { width: 18px; height: 18px; flex: none; color: var(--info); margin-top: 1px; }
.st-callout.warn { background: var(--warn-bg); }
.st-callout.warn svg { color: var(--warn); }
.st-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; }
.st-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.st-card .chip svg { width: 13px; height: 13px; }
.st-mono, .st-code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.st-code-input { max-width: 180px; letter-spacing: .15em; font-size: 16px; }
.st-form { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.st-narrow { max-width: 320px; }
.st-preview { font-weight: 600; }

/* save bar: sticks to the bottom of the screen while its form is on screen */
.st-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; margin-top: 4px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-card); }
.st-bar.is-dirty { border-color: var(--warn); box-shadow: var(--shadow-pop); }
.st-bar:not(.is-dirty) { position: static; } /* stays in place when nothing is waiting to be saved */
.st-bar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-bar-note { flex: 1 1 200px; font-size: 13px; }

/* switch (role=switch): track plus the words On / Off, so colour is not the only signal */
.st-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 6px; border: 0; background: none; cursor: pointer; border-radius: var(--r-ctl); flex: none; }
.st-switch[disabled] { opacity: .5; cursor: not-allowed; }
.st-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--line); transition: background .15s; }
.st-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.st-switch[aria-checked="true"] .st-track { background: var(--good); }
.st-switch[aria-checked="true"] .st-knob { transform: translateX(18px); }
.st-switch-text { min-width: 24px; font-weight: 600; font-size: 13px; text-align: left; }
.st-switch-row { display: flex; align-items: center; gap: 12px; }
.st-main-switch h3 { font-size: 16px; }
.st-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.st-alerts .st-switch-row { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.st-alerts .st-switch-row:last-child { border-bottom: 0; }
.st-inline-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.st-inline-form .field { min-width: 0; }
.st-wide-form .field { flex: 1 1 280px; }
.st-chats { display: flex; flex-wrap: wrap; gap: 8px; }
.st-status { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-ctl); font-size: 13px; }
.st-status .label { margin-right: 6px; }

/* numbered steps (Telegram, two-step verification) */
.st-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.st-step { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.st-step:last-child { border-bottom: 0; }
.st-step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); border: 1.5px solid var(--line); color: var(--muted); }
.st-step-n svg { width: 15px; height: 15px; }
.st-step.is-current .st-step-n { border-color: var(--ink); color: var(--ink); }
.st-step.is-done .st-step-n { background: var(--good); border-color: var(--good); color: #fff; }
.st-step-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.st-howto { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.st-secret-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .06em; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-ctl); word-break: break-word; }

/* pipeline editor */
.st-ribbon { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-ribbon-pay { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--good); padding: 0 4px; }
.st-ribbon-pay svg { width: 13px; height: 13px; }
.st-stages-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.st-stage { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.st-stage.st-over { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus); }
.st-stage-head { display: flex; align-items: center; gap: 8px; }
.st-grip { display: grid; place-items: center; width: 22px; height: 36px; color: var(--faint); cursor: grab; flex: none; }
.st-grip svg { width: 18px; height: 18px; transform: rotate(90deg); }
.st-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-weight: 650; font-size: 12.5px; }
.st-stage-name { font-weight: 600; }
.st-move { display: flex; gap: 4px; flex: none; }
.st-rot-up, .st-rot-down { display: inline-flex; }
.st-rot-up svg { transform: rotate(-90deg); }
.st-rot-down svg { transform: rotate(90deg); }
.st-stage-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.st-stage-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; }
.st-due { display: flex; gap: 6px; }
.st-due .input { width: 80px; flex: none; }
.st-due .select { flex: 1; min-width: 0; }
.st-check { display: flex; flex-direction: column; gap: 6px; }
.st-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-items li { display: flex; gap: 6px; align-items: center; }
.st-stage-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.st-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.st-rule { display: flex; flex-direction: column; gap: 6px; }
.st-rule > label { font-weight: 600; }
.st-rule-in { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.st-rule-in .input { width: 90px; flex: none; }

/* lists */
.st-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.st-row > .input { flex: 1 1 200px; width: auto; min-width: 0; }
.st-row .st-err { flex-basis: 100%; }
.st-fixed { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; padding: 6px 2px; min-width: 0; }
.st-price { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.st-price .input { width: 120px; }
.st-src { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.st-src code { color: var(--faint); }

/* import and export */
.st-exports { display: flex; flex-wrap: wrap; gap: 8px; }
.st-exports .btn { text-decoration: none; }
.st-progress { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; }
.st-progress li { display: flex; align-items: center; gap: 8px; }
.st-progress li.on { color: var(--text); font-weight: 650; }
.st-progress li.on .st-step-n { border-color: var(--ink); color: var(--ink); }
.st-progress li.done .st-step-n { background: var(--good); border-color: var(--good); color: #fff; }
.st-progress .st-step-n { width: 24px; height: 24px; font-size: 12px; }
.st-file { min-height: 38px; padding: 6px 0; max-width: 100%; }
.st-hint svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--good); }
.st-map { display: flex; flex-direction: column; gap: 6px; }
.st-map-row { display: grid; grid-template-columns: 180px minmax(0, 260px) minmax(0, 1fr); gap: 10px; align-items: center; }
.st-map-row > label { font-weight: 560; }
.st-imp-table { max-height: 260px; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); }
.st-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-checkline { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; cursor: pointer; }
.st-checkline input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--good); }
.st-result-list { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }

/* connections, businesses, general */
.st-biz { display: flex; flex-direction: column; gap: 14px; }
.st-biz-item { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.st-biz-item:last-child { border-bottom: 0; padding-bottom: 0; }
.st-biz-item .row { flex-wrap: wrap; }
.st-dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.st-dl dt { color: var(--muted); }
.st-dl dd { margin: 0; overflow-wrap: anywhere; }
.st-color { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 12.5px; }
.st-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.st-stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: st; }
.st-stages li { counter-increment: st; }
.st-stages li::before { content: counter(st) '. '; color: var(--faint); margin-right: 3px; }
.st-key { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-ctl); }
.st-code, .st-card code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.st-pre-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.st-pre { margin: 0; width: 100%; max-height: 340px; overflow: auto; padding: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-ctl); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; white-space: pre; }
.st-details summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--muted); }
.st-fields { line-height: 2; }
.st-keys { display: flex; flex-direction: column; gap: 8px; }
.st-kbd { display: inline-block; min-width: 30px; text-align: center; padding: 1px 8px; margin-right: 8px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font-family: inherit; font-size: 12.5px; font-weight: 600; }

@media (max-width: 860px) {
  .st-wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .st-nav { display: none; }
  .st-pick { display: flex; }
  .st-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .st-grip { display: none; }
  .st-stage-grid { grid-template-columns: minmax(0, 1fr); }
  .st-rules { grid-template-columns: minmax(0, 1fr); }
  .st-map-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
  .st-color { margin-left: 0; }
  .st-key { flex-wrap: wrap; }
  .st-price .input { width: 110px; }
  .st-switch-row { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .st-track, .st-knob { transition: none; } }

.ct-nowrap { white-space: nowrap; }
.ct-mail { border: 0; background: none; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; text-align: left; overflow-wrap: anywhere; }
.ct-mail:hover { color: var(--ink); }
