/* SiteFlow — Project detail page (sf-project.js). Uses the tokens in sf-v3.css. */

.pj { padding: 12px 16px 32px; display: flex; flex-direction: column; gap: 12px; color: var(--n9); }
.pj-main, .pj-body, .pj-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Header band */
.pj-head { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.pj-head .row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 28px; }
.pj-head .hc { font-size: 14px; font-weight: 600; color: var(--n5); }
.pj-head .sp { flex: 1; }
.pj-head h1 { margin: 8px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.pj-head .meta { margin-top: 4px; font-size: 14px; color: var(--n5); }
.pj-acts { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
.pj-acts::-webkit-scrollbar { display: none; }
.pj-acts .sf-b { flex: none; }
body.v3 #app .pj-acts .sf-b.ghost.sm { border-width: 1.5px !important; font-size: 14px; }
.pj-cur { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--or-ink); }
.pj-cur .ms, .pj-link .ms { font-size: 18px; }
button.pj-link { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--in-ink); }
button.pj-link:hover { text-decoration: underline; }

/* KPI row */
.pj-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pj-kpi { background: var(--card); padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pj-kpi small { font-size: 13px; font-weight: 600; color: var(--n5); }
.pj-kpi b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-kpi span { font-size: 12px; color: var(--n4); line-height: 1.35; }

/* Tabs: segmented control, scrolls sideways on phone */
.pj-tabs { display: flex; gap: 3px; padding: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pj-tabs::-webkit-scrollbar { display: none; }
.pj-tabs button { all: unset; box-sizing: border-box; cursor: pointer; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 4px; font-size: 14px; font-weight: 700; color: var(--n9); white-space: nowrap; }
.pj-tabs button:hover { background: var(--ground); }
.pj-tabs button span { font-size: 12px; font-weight: 600; color: var(--n4); }
.pj-tabs button.on { background: var(--n9); color: #fff; }
.pj-tabs button.on span { color: var(--nm); }
.pj-tabs button:focus-visible { outline: 2px solid var(--or); outline-offset: 1px; }

/* Cards */
.pj-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pj-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px 10px; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.pj-h .r { font-size: 13px; font-weight: 600; color: var(--n5); text-align: right; }
.pj-cardfoot { padding: 12px 16px; border-top: 1px solid var(--line2); }
.pj-cardfoot.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pj-note { padding: 10px 16px 14px; font-size: 13px; color: var(--n5); line-height: 1.45; }
.pj-none { display: flex; align-items: center; gap: 10px; padding: 4px 16px 16px; font-size: 14px; color: var(--n5); line-height: 1.4; }
.pj-none .ms { color: var(--n4); font-size: 22px; flex: none; }
.pj-card .sf-empty { margin: 0; border: none; }
.pj-list.flush { border-top: 1px solid var(--line2); }
.pj-list > * { border-bottom: 1px solid var(--line2); }
.pj-list > *:last-child { border-bottom: none !important; }
.pj-list button.sf-rec:hover, .pj-list button.sf-row:hover { background: #FAFBFC; }
.pj-prose { margin: 0 16px 12px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Progress ring */
.pj-ringwrap { display: flex; align-items: center; gap: 18px; padding: 4px 16px 16px; flex-wrap: wrap; justify-content: center; }
.pj-ringwrap svg { flex: none; margin: 0 !important; }
.pj-legend { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.pj-legend .lg { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line2); }
.pj-legend .lg i { width: 10px; height: 10px; border-radius: 100px; flex: none; }
.pj-legend .lg span { flex: 1; color: var(--n5); }
.pj-legend .lg b { font-weight: 700; }
.pj-legend .tot { display: flex; justify-content: space-between; padding-top: 8px; font-size: 14px; }
.pj-legend .tot span { color: var(--n5); }
.pj-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 20px 20px; }
.pj-empty > .ms { font-size: 30px; color: var(--n4); }
.pj-empty b { font-size: 15px; }
.pj-empty p { margin: 0 0 6px; font-size: 14px; color: var(--n5); line-height: 1.45; max-width: 300px; }

/* Key dates */
.pj-dates { border-top: 1px solid var(--line2); }
.pj-date { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k v" "k r"; column-gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line2); align-items: center; }
.pj-date:last-child { border-bottom: none; }
.pj-date .k { grid-area: k; font-size: 14px; color: var(--n5); }
.pj-date .v { grid-area: v; font-size: 15px; font-weight: 700; text-align: right; }
.pj-date .v.mu { color: var(--n4); font-weight: 600; }
.pj-date .r { grid-area: r; font-size: 12px; color: var(--n4); text-align: right; }
.pj-date .r.soon { color: var(--or-ink); font-weight: 700; }
.pj-date .r.past { color: var(--n4); }

/* Contacts */
.pj-contact { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line2); align-items: flex-start; }
.pj-av { width: 36px; height: 36px; border-radius: 100px; background: var(--dr-t); color: var(--n9); display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.pj-av .ms { font-size: 18px; }
.pj-contact .grow { flex: 1; min-width: 0; }
.pj-contact b { display: block; font-size: 15px; font-weight: 700; }
.pj-contact small { display: block; font-size: 13px; color: var(--n5); }
.pj-contact .ln { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; min-width: 0; }
.pj-contact .ln .ms { font-size: 17px; color: var(--n4); flex: none; }
.pj-contact .ln a { color: var(--in-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-contact .ln a:hover { text-decoration: underline; }
.pj-contact .mu { color: var(--n4); }

/* Contract key/values */
.pj-kv { border-top: 1px solid var(--line2); }
.pj-kv .sf-row.kv { min-height: 44px; }
.pj-kv .sf-row.kv:last-child { border-bottom: none; }

/* Next claim strip inside the Claims tab */
.pj-next { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--ground); border-bottom: 1px solid var(--line2); font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.pj-next .ms { color: var(--or-ink); font-size: 20px; }
.pj-next .grow { flex: 1; min-width: 160px; }

/* Diary sheet */
.pj-sheet { margin: 0 -16px; }
.pj-sheet .sf-row.kv small { font-size: 12px; color: var(--n4); }

/* Skeleton */
.pj-sk { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--line2) 0%, var(--ground) 50%, var(--line2) 100%); background-size: 200% 100%; animation: pjSk 1.2s ease-in-out infinite; }
.pj-sk.h { height: 20px; margin: 6px 0; }
.pj-head .pj-acts .pj-sk { flex: none; border-radius: 6px; }
@keyframes pjSk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .pj-sk { animation: none; } }

/* Projects list: claimed-to-date bar on each card */
.sf-jobcard .pj-cbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; border-top: 1px solid var(--line2); }
.sf-jobcard .pj-cbar .tr { flex: 1; height: 6px; border-radius: 100px; background: var(--line2); overflow: hidden; display: flex; }
.sf-jobcard .pj-cbar .tr i { display: block; height: 100%; }
.sf-jobcard .pj-cbar .tr i.pd { background: var(--ok); }
.sf-jobcard .pj-cbar .tr i.cl { background: var(--or); }
.sf-jobcard .pj-cbar span { font-size: 12px; font-weight: 600; color: var(--n5); white-space: nowrap; }

/* Desktop */
@media (min-width: 900px) {
  .sf-scr .pj { padding: 0; gap: 16px; }
  .pj-head { padding: 20px 22px; }
  .pj-head h1 { font-size: 28px; }
  .pj-acts { margin-left: 0; margin-right: 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .pj-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pj-kpi { padding: 14px 18px; }
  .pj-kpi b { font-size: 22px; }
  .pj-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
  .pj-main, .pj-body, .pj-side { gap: 16px; }
  .pj-tabs { align-self: flex-start; max-width: 100%; }
  .sf-scr .pj-card .sf-list { border: none; border-radius: 0; }
}
@media (min-width: 1280px) {
  .pj-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Phone: keep action labels on one line and let buttons wrap to a second row */
.pj-acts { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }
.pj-acts .sf-b { white-space: nowrap; width: auto !important; }
