/* Payroll Department (Vault). Existing Nexus tokens only. */

/* The Vault area switch gained a fourth button: let it scroll on a narrow phone instead of overflowing. */
.vault-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.vault-seg::-webkit-scrollbar { display: none; }
.vault-seg button { white-space: nowrap; flex: none; }

/* ---------------------------------------------------------------- chat */
.pd-chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; max-width: 880px; }
.pd-head { display: flex; gap: 12px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.pd-head h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.pd-head .muted { font-size: 13px; line-height: 1.45; }
.pd-head-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand); }
.pd-thread { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 280px;
  max-height: min(62vh, 640px); overflow-y: auto; background: var(--bg-2); }
.pd-row { display: flex; gap: 10px; align-items: flex-start; }
.pd-row.me { justify-content: flex-end; }
.pd-ava { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12.5px; }
.pd-ava.owner { background: var(--surface-3); color: var(--text); }
.pd-body { min-width: 0; max-width: min(660px, 86%); }
.pd-who { font-size: 12px; font-weight: 650; color: var(--text-dim); margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; }
.pd-who span { font-weight: 500; color: var(--text-faint); }
.pd-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px;
  font-size: 14px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.pd-bubble p { margin: 0 0 8px; }
.pd-bubble p:last-child, .pd-bubble ul:last-child, .pd-bubble ol:last-child, .pd-bubble table:last-child { margin-bottom: 0; }
.pd-bubble ul, .pd-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.pd-bubble li { margin: 2px 0; }
.pd-bubble table { border-collapse: collapse; margin: 6px 0 8px; font-size: 13px; display: block; overflow-x: auto; }
.pd-bubble th, .pd-bubble td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; white-space: nowrap; }
.pd-bubble th { background: var(--surface-2); font-weight: 650; }
.pd-bubble code { background: var(--surface-2); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }
.pd-bubble.me { background: var(--brand); color: #fff; border-color: transparent; max-width: min(560px, 86%); }
.pd-bubble.me strong { color: #fff; }
.pd-about { font-size: 12px; color: var(--text-dim); margin-bottom: 5px; overflow-wrap: anywhere; }
/* the question an answer belongs to, quoted inside the answer (like a chat reply) */
.pd-quote { display: block; margin: 0 0 9px; padding: 7px 10px; border-left: 3px solid var(--brand); border-radius: 8px;
  background: var(--surface-2); font-size: 12.5px; line-height: 1.45; color: var(--text-dim); overflow-wrap: anywhere; }
.pd-quote span { display: block; font-size: 11px; font-weight: 700; color: var(--brand); margin-bottom: 2px; letter-spacing: .02em; }
.pd-flag { margin-top: 6px; font-size: 12px; color: var(--amber); display: inline-flex; gap: 5px; align-items: center; }
.pd-typing { display: inline-flex; gap: 4px; align-items: center; padding: 13px 14px; }
.pd-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: pd-dot 1.2s infinite ease-in-out; }
.pd-typing span:nth-child(2) { animation-delay: .15s; }
.pd-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pd-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .pd-typing span { animation: none; } }
.pd-composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.pd-composer textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; line-height: 1.45; }
.pd-empty { text-align: center; padding: 26px 8px 10px; margin: auto 0; }
.pd-empty-ic { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); }
.pd-empty-title { font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.pd-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.pd-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 7px 13px; font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; }
.pd-chip:hover { border-color: var(--brand); color: var(--brand); }

/* ---------------------------------------------------------------- owner */
.pd-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 700; }
.pd-q { padding: 14px 16px; margin-bottom: 12px; max-width: 880px; }
.pd-q.open { border-color: var(--amber); }
.pd-q-head { display: flex; gap: 10px; align-items: center; }
.pd-q-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pd-q-who .muted { font-size: 12px; }
.pd-q-sum { font-weight: 650; margin: 10px 0 4px; }
.pd-q-asked, .pd-q-answer { font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.pd-q-answer { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.pd-q-reply { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.pd-q-reply textarea { flex: 1; resize: vertical; }
.pd-q-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }
.pd-sugg { margin-top: 12px; }
.pd-sugg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 8px; }
.pd-sugg-head .muted { font-size: 12px; }
.pd-sugg-title { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--brand); }
.pd-sugg-new { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim, var(--text)); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.pd-sugg-new:hover { border-color: var(--brand); color: var(--brand); }
.pd-sugg-new.solo { margin-left: 0; color: var(--brand); border-color: var(--brand-soft); background: var(--brand-soft); font-weight: 600; }
.pd-sugg-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.pd-sugg-card { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, background .15s, transform .12s ease; }
.pd-sugg-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.pd-sugg-card.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.pd-sugg-card b { font-size: 13px; }
.pd-sugg-card span { font-size: 11.5px; color: var(--text-dim, var(--text)); line-height: 1.4; }
.pd-sugg-dots { display: inline-flex; gap: 3px; padding: 0 !important; background: transparent !important; border: 0 !important; }
.pd-claim-tag { color: var(--brand); background: var(--brand-soft); }
.pd-claim-box { margin: 10px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft);
  font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.pd-claim-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); margin-bottom: 3px; }
.pd-people { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 14px; align-items: start; }
.pd-plist { padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; }
.pd-person { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; border: 0;
  background: transparent; text-align: left; cursor: pointer; color: var(--text); width: 100%; }
.pd-person:hover, .pd-person.on { background: var(--surface-2); }
.pd-person-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pd-person-main .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-people .pd-chat { max-width: none; }
.pd-know-bar { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; max-width: 880px; }
.pd-know-bar .muted { flex: 1; font-size: 13px; line-height: 1.45; }
.pd-know { padding: 14px 16px; margin-bottom: 14px; max-width: 880px; }
.pd-know h4 { margin: 0 0 10px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.pd-item { border-top: 1px solid var(--border-soft); padding: 11px 0; }
.pd-item:first-of-type { border-top: 0; padding-top: 2px; }
.pd-item-head { display: flex; gap: 10px; align-items: flex-start; }
.pd-item-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-item-title .muted { font-size: 12px; }
.pd-item-actions { display: flex; gap: 6px; flex: none; }
.pd-item-body { font-size: 13.5px; line-height: 1.55; margin-top: 6px; overflow-wrap: anywhere; }
.pd-item-body p { margin: 0 0 6px; }
.pd-item-body ul, .pd-item-body ol { margin: 2px 0 6px; padding-left: 20px; }

@media (max-width: 860px) {
  .pd-people { grid-template-columns: 1fr; }
  .pd-plist { max-height: 240px; }
}
@media (max-width: 560px) {
  .pd-thread { padding: 12px; max-height: 58vh; }
  .pd-body { max-width: 88%; }
  .pd-q-reply, .pd-know-bar { flex-direction: column; align-items: stretch; }
  .pd-composer { padding: 10px; }
}

/* ---------------------------------------------------------------- v2: the friendly two-person chat */
.pd-chat2 { max-width: 920px; border-radius: 18px; }
.pd-head2 { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--brand-soft), transparent 140%); }
.pd-faces { position: relative; display: flex; flex: none; }
.pd-faces .pd-face + .pd-face { margin-left: -12px; }
.pd-faces .pd-face { box-shadow: 0 0 0 3px var(--surface); }
.pd-online { position: absolute; right: -1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2.5px var(--surface); }
.pd-face { display: inline-grid; place-items: center; border-radius: 50%; flex: none; font-weight: 750; font-size: 13px; }
.pd-face.pd { background: linear-gradient(140deg, var(--brand-soft), var(--surface-2)); color: var(--brand); }
.pd-face.cfo { background: linear-gradient(140deg, var(--violet-soft), var(--surface-2)); color: var(--violet); }
.pd-face.owner { width: 34px; height: 34px; background: var(--surface-3); color: var(--text); }
img.pd-face { display: block; object-fit: cover; background: var(--surface-3); }
.pd-flag img.pd-face { box-shadow: 0 0 0 1.5px var(--amber-soft); }
.pd-head-txt { flex: 1; min-width: 0; }
.pd-head-txt h3 { margin: 0 0 3px; font-size: 15.5px; font-weight: 750; letter-spacing: -.01em; }
.pd-head-sub { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.pd-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; animation: pd-live 2.4s ease-in-out infinite; }
@keyframes pd-live { 0%, 100% { box-shadow: 0 0 0 0 var(--green-soft); } 50% { box-shadow: 0 0 0 5px transparent; } }
.pd-private-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; background: var(--surface); flex: none; }

.pd-chat2 .pd-thread { min-height: 380px; max-height: min(64vh, 680px); gap: 16px; padding: 20px 20px 14px; }
.pd-ava-wrap { flex: none; padding-top: 18px; }
.pd-chat2 .pd-who { gap: 7px; align-items: center; }
.pd-chat2 .pd-who b { color: var(--text); font-weight: 700; }
.pd-tag { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; letter-spacing: .01em; }
.pd-tag.pd { background: var(--brand-soft); color: var(--brand); }
.pd-tag.cfo { background: var(--violet-soft); color: var(--violet); }
.pd-tag.owner { background: var(--amber-soft); color: var(--amber); }
.pd-chat2 .pd-bubble { border-radius: 6px 16px 16px 16px; padding: 11px 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.pd-chat2 .pd-bubble.me { border-radius: 16px 6px 16px 16px; box-shadow: 0 6px 16px -10px var(--brand); }
.pd-pop { animation: pd-pop .32s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes pd-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.pd-welcome { margin: auto 0; padding: 8px 4px 6px; text-align: center; }
.pd-hello { font-size: 21px; font-weight: 760; letter-spacing: -.02em; margin-bottom: 6px; animation: pd-pop .4s ease both; }
.pd-wave { display: inline-block; transform-origin: 70% 70%; animation: pd-wave 1.6s ease-in-out .3s 1; }
@keyframes pd-wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.pd-intro { max-width: 520px; margin: 0 auto 16px; font-size: 13.5px; line-height: 1.55; color: var(--text-dim); animation: pd-pop .45s ease .05s both; }
.pd-team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 720px; margin: 0 auto 16px; text-align: left; }
.pd-member { display: flex; gap: 11px; align-items: center; padding: 11px 13px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); animation: pd-pop .45s ease both; }
.pd-member:nth-child(2) { animation-delay: .08s; }
.pd-member:nth-child(3) { animation-delay: .16s; }
.pd-member div { display: flex; flex-direction: column; min-width: 0; }
.pd-member b { font-size: 13.5px; }
.pd-member span { font-size: 12px; color: var(--text-dim); line-height: 1.35; }
.pd-chat2 .pd-chips { margin-top: 0; animation: pd-pop .5s ease .12s both; }
.pd-chat2 .pd-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 14px; }
.pd-chat2 .pd-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -10px var(--brand); }
.pd-private-note { margin-top: 16px; font-size: 11.5px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 5px; }

.pd-composer2 { padding: 12px 14px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.pd-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.pd-quick[hidden] { display: none; }
.pd-quick-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim, var(--text)); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer;
  transition: border-color .15s, color .15s, transform .12s ease; }
.pd-quick-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.pd-inputwrap { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-2);
  padding: 6px 6px 6px 14px; transition: border-color .15s, box-shadow .15s; }
.pd-inputwrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.pd-inputwrap textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; color: var(--text); font: inherit;
  font-size: 14px; line-height: 1.45; padding: 7px 0; min-height: 22px; max-height: 140px; }
.pd-send { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; cursor: pointer;
  background: var(--brand); color: #fff; transition: transform .12s ease, opacity .15s; }
.pd-send:hover { transform: scale(1.06); }
.pd-send:active { transform: scale(.94); }
.pd-send:disabled { opacity: .5; cursor: default; transform: none; }

/* the owner's inner tabs (under the Payroll tabs): a lighter segmented look */
.subnav.pd-seg { display: inline-flex; background: transparent; border: 0; padding: 0; gap: 6px; margin-bottom: 14px; }
.subnav.pd-seg button { border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; }
.subnav.pd-seg button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: none; }

@media (max-width: 640px) {
  .pd-head2 { padding: 13px 14px; gap: 11px; }
  .pd-private-pill { display: none; }
  .pd-team { grid-template-columns: 1fr; }
  .pd-hello { font-size: 19px; }
  .pd-chat2 .pd-thread { padding: 14px 12px 10px; min-height: 320px; }
  .pd-ava-wrap { padding-top: 16px; }
  .pd-ava-wrap .pd-face { width: 30px !important; height: 30px !important; }
  .pd-q-reply { flex-direction: column; align-items: stretch; }
  .pd-q-btns { flex-direction: row; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-pop, .pd-hello, .pd-intro, .pd-member, .pd-chat2 .pd-chips, .pd-wave, .pd-live { animation: none !important; }
}
