/*
 * BirdGigs — seller backend (2026-10-10)
 * Loaded only on seller-dashboard.php, after style.css + stone.css.
 * Uses the Stone tokens (--fph-*, --accent, --radius, --ok-*, --warn-*, --danger*).
 */

/* Keep the header image logo at the Stone 127x40 size. The signed-in nav is
   crowded (Dashboard + search + account icons), and without flex-shrink: 0
   the logo is squeezed far below 127px. */
.sn-nav .sn-logo { flex-shrink: 0; width: 127px; height: 40px; min-width: 127px; }

.sd { padding: 28px 0 64px; }
.sd-wrap { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 32px; align-items: start; max-width: 1280px; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sd-side { position: sticky; top: calc(var(--fph-nav-h) + 16px); }
.sd-me { display: flex; gap: 10px; align-items: center; padding: 0 4px 16px; border-bottom: 1px solid var(--fph-border); margin-bottom: 8px; }
.sd-me-txt { min-width: 0; line-height: 1.3; }
.sd-me-txt strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-me-txt span { font-size: .8rem; color: var(--fph-muted); }
.sd-side-toggle { display: none; }
.sd-nav-group { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--fph-faint); padding: 14px 10px 4px; }
.sd-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; font-size: .92rem;
  color: var(--fph-mid); text-decoration: none; border-left: 2px solid transparent; border-radius: 0 var(--radius) var(--radius) 0; }
.sd-nav a:hover { background: var(--fph-subtle); color: var(--fph-dark); }
.sd-nav a.active { background: var(--fph-white); color: var(--fph-dark); border-left-color: var(--accent); font-weight: 500; }

.sd-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--accent); color: var(--on-accent, #fff); font-size: .72rem; font-weight: 500; line-height: 1; }
.sd-badge--warn { background: var(--warn-bg); color: var(--warn-ink); }

/* ── Main column + page header ───────────────────────────────── */
.sd-main { min-width: 0; }
.sd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sd-head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sd-eyebrow { font-size: .8rem; color: var(--fph-muted); margin: 0 0 4px; letter-spacing: .02em; }
.sd-eyebrow a { color: var(--fph-muted); }
.sd-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 300; letter-spacing: -.03em; margin: 0; }
.sd-note { font-size: .9rem; color: var(--fph-mid); background: var(--fph-white); border: 1px solid var(--fph-border); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: var(--radius); margin: 0 0 20px; }
.sd-banner { background: var(--accent-light); border: 1px solid var(--accent-tint); color: var(--fph-dark); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: .92rem; }
.sd-banner--warn { background: var(--warn-bg); border-color: #DCC9A3; }
.sd-banner--bad { background: var(--danger-bg); border-color: var(--danger-line); }
.sd-banner a { margin-left: 6px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.sd-range .form-select, .sd-filters .form-select { width: auto; min-width: 160px; padding-top: .45rem; padding-bottom: .45rem; font-size: .9rem; }
.sd-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

/* ── Cards ───────────────────────────────────────────────────── */
.sd-card { background: var(--fph-white); border: 1px solid var(--fph-border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.sd-card--flush { padding: 0; overflow: hidden; }
.sd-card-pad { padding: 18px 20px 12px; }
.sd-card-title { font-size: 1.02rem; font-weight: 500; margin: 0 0 12px; letter-spacing: 0; }
.sd-card-titlebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sd-card-titlebar .sd-card-title { margin: 0; }
.sd-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sd-split > .sd-card { margin-bottom: 0; }
.sd-split { margin-bottom: 20px; }

.sd-help { font-size: .86rem; color: var(--fph-muted); line-height: 1.55; }
.sd-mute { color: var(--fph-muted); font-size: .82rem; }
.sd-strong { color: var(--fph-dark); font-weight: 500; text-decoration: none; }
.sd-strong:hover { color: var(--accent); }
.sd-nowrap { white-space: nowrap; }
.sd-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.sd-req { color: var(--danger); }
.sd-mini-link { font-size: .84rem; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.sd-empty { padding: 28px 20px; text-align: center; }
.sd-empty p { color: var(--fph-muted); margin: 0 0 12px; font-size: .92rem; }
.sd-empty p:last-child { margin-bottom: 0; }
.sd-empty--tall { min-height: 360px; display: flex; flex-direction: column; justify-content: center; }

/* ── Tabs ────────────────────────────────────────────────────── */
.sd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--fph-border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.sd-tabs a { padding: 9px 12px; font-size: .92rem; color: var(--fph-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.sd-tabs a:hover { color: var(--fph-dark); }
.sd-tabs a.active { color: var(--fph-dark); border-bottom-color: var(--accent); font-weight: 500; }
.sd-tabs--small { margin: 0 0 8px; }
.sd-tabs--small a { padding: 7px 10px; font-size: .85rem; }

/* ── Tables ──────────────────────────────────────────────────── */
.sd-scroll { overflow-x: auto; }
.sd-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sd-table th { font-size: .76rem; font-weight: 500; color: var(--fph-muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--fph-border); white-space: nowrap; }
.sd-table td { padding: 12px; border-bottom: 1px solid var(--fph-border); vertical-align: middle; }
.sd-table tbody tr:last-child td { border-bottom: 0; }
.sd-table tbody tr:hover td { background: rgba(221,227,225,.4); }
.sd-table th:first-child, .sd-table td:first-child { padding-left: 20px; }
.sd-table th:last-child, .sd-table td:last-child { padding-right: 20px; }
.sd-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-table tfoot th { border-top: 1px solid var(--fph-edge); border-bottom: 0; color: var(--fph-dark); font-size: .88rem; }
.sd-table--compact td, .sd-table--compact th { padding: 6px 10px; font-size: .84rem; }
.sd-card:not(.sd-card--flush) .sd-table th:first-child, .sd-card:not(.sd-card--flush) .sd-table td:first-child { padding-left: 0; }
.sd-card:not(.sd-card--flush) .sd-table th:last-child, .sd-card:not(.sd-card--flush) .sd-table td:last-child { padding-right: 0; }
.sd-table .fph-status { white-space: nowrap; }

.sd-tag { display: inline-block; font-size: .72rem; padding: 1px 6px; border-radius: var(--radius); background: var(--fph-subtle); color: var(--fph-mid); }
.sd-tag--warn { background: var(--warn-bg); color: var(--warn-ink); }
.sd-due { display: inline-block; font-size: .78rem; font-weight: 500; padding: 2px 8px; border-radius: var(--radius); white-space: nowrap; }
.sd-due--late { background: var(--danger-bg); color: var(--danger); }
.sd-due--soon { background: var(--warn-bg); color: var(--warn-ink); }
.sd-due--ok { background: var(--fph-subtle); color: var(--fph-mid); }

.sd-listing { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.sd-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--fph-border); flex-shrink: 0; }
.sd-thumb--ph { display: inline-flex; align-items: center; justify-content: center; background: var(--fph-subtle); color: var(--fph-mid); font-size: .7rem; font-weight: 500; letter-spacing: .03em; }
.sd-thumb--lg { width: 96px; height: 72px; }

/* "⋯" row menus */
.sd-more { display: inline-block; position: relative; }
.sd-more > summary { list-style: none; }
.sd-more > summary::-webkit-details-marker { display: none; }
.sd-more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; background: var(--fph-white); border: 1px solid var(--fph-edge);
  border-radius: var(--radius); padding: 4px; text-align: left; }
.sd-more-menu a, .sd-more-menu button { display: block; width: 100%; padding: 8px 10px; font-size: .88rem; color: var(--fph-dark); background: none; border: 0; text-align: left; text-decoration: none; border-radius: var(--radius); }
.sd-more-menu a:hover, .sd-more-menu button:hover { background: var(--fph-subtle); }
.sd-more-menu .danger { color: var(--danger); }
.sd-more-menu form { margin: 0; }

/* ── KPI tiles ───────────────────────────────────────────────── */
.sd-kpis { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 1px; background: var(--fph-border); border: 1px solid var(--fph-border); border-radius: var(--radius); overflow: hidden; }
.sd-kpis--page { margin-bottom: 20px; grid-template-columns: 1.3fr repeat(4, 1fr); }
.sd-kpis--4 { grid-template-columns: repeat(4, 1fr); }
.sd-kpi { background: var(--fph-white); padding: 16px 18px; position: relative; min-width: 0; }
.sd-kpi-label { font-size: .8rem; color: var(--fph-muted); margin-bottom: 6px; }
.sd-kpi-value { font-size: 1.7rem; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; color: var(--fph-dark); }
.sd-kpi--hero .sd-kpi-value { font-size: 2.6rem; font-weight: 300; }
.sd-kpi-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.sd-kpi-cmp { font-size: .76rem; color: var(--fph-faint); }
.sd-delta { font-size: .78rem; font-weight: 500; color: var(--fph-mid); }
.sd-delta--good { color: var(--ok-ink); }
.sd-delta--bad { color: var(--danger); }
.sd-delta--none { color: var(--fph-light); }
.sd-spark { position: absolute; right: 14px; top: 14px; width: 84px; height: 24px; }
.sd-spark polyline { fill: none; stroke: var(--fph-light); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sd-spark circle { fill: var(--accent); stroke: var(--fph-white); stroke-width: 2; }
.sd-w .sd-kpis { border-radius: var(--radius); }
.sd-minis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0 0; }
.sd-minis div { min-width: 0; }
.sd-minis dt { font-size: .76rem; font-weight: 400; color: var(--fph-muted); }
.sd-minis dd { margin: 2px 0 0; font-size: .98rem; color: var(--fph-dark); font-variant-numeric: tabular-nums; }
.sd-minis--stack { grid-template-columns: 1fr 1fr; margin-top: 16px; }

/* ── Widget grid ─────────────────────────────────────────────── */
.sd-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; align-items: start; }
.sd-w { grid-column: span 2; background: var(--fph-white); border: 1px solid var(--fph-border); border-radius: var(--radius); min-width: 0; transition: border-color .15s; }
.sd-w--md { grid-column: span 3; }
.sd-w--lg { grid-column: span 4; }
.sd-w--full { grid-column: 1 / -1; }
.sd-w[hidden] { display: none; }
.sd-w-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 18px 0; min-height: 40px; }
.sd-w-head h2 { font-size: .95rem; font-weight: 500; margin: 0; letter-spacing: 0; }
.sd-w-body { padding: 12px 18px 18px; }
.sd-w--full > .sd-w-head { padding-bottom: 4px; }
.sd-w-sub { font-size: .84rem; color: var(--fph-muted); margin: 0 0 8px; }
.sd-w-link { display: inline-block; margin-top: 12px; font-size: .86rem; color: var(--accent); text-decoration: none; }
.sd-w-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sd-w .sd-empty { padding: 16px 0 4px; text-align: left; }
.sd-w-edit { display: none; gap: 4px; align-items: center; }
.sd-editing .sd-w-edit { display: flex; }
.sd-editing .sd-w { border-style: dashed; border-color: var(--fph-edge); }
.sd-editing .sd-w-body { pointer-events: none; opacity: .55; max-height: 220px; overflow: hidden; }
.sd-editing .sd-w[draggable=true] .sd-w-head { cursor: grab; }
.sd-w.is-dragging { opacity: .4; }
.sd-w.is-over { border-color: var(--accent); border-style: solid; }
.sd-w-btn, .sd-w-sizes button { height: 28px; min-width: 28px; padding: 0 7px; font-size: .78rem; border: 1px solid var(--fph-border); background: var(--fph-bg); color: var(--fph-mid); border-radius: var(--radius); line-height: 1; }
.sd-w-btn:hover, .sd-w-sizes button:hover { border-color: var(--fph-dark); color: var(--fph-dark); }
.sd-w-sizes { display: inline-flex; gap: 2px; margin-right: 6px; }
.sd-w-sizes button.on { background: var(--fph-dark); color: var(--fph-bg); border-color: var(--fph-dark); }
.sd-w-grip { color: var(--fph-light); letter-spacing: -2px; padding: 0 2px 0 4px; font-size: .9rem; user-select: none; }

.sd-customizer { background: var(--fph-white); border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.sd-customizer-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.sd-customizer-head p { margin: 4px 0 0; font-size: .86rem; color: var(--fph-muted); max-width: 560px; }
.sd-customizer-btns { display: flex; gap: 8px; }
.sd-addable { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 14px; }
.sd-add { text-align: left; background: var(--fph-bg); border: 1px dashed var(--fph-edge); border-radius: var(--radius); padding: 10px 12px; }
.sd-add[hidden] { display: none; }
.sd-add:hover { border-color: var(--accent); border-style: solid; }
.sd-add strong { display: block; font-size: .88rem; font-weight: 500; color: var(--fph-dark); }
.sd-add span { display: block; font-size: .78rem; color: var(--fph-muted); line-height: 1.4; margin-top: 2px; }
.sd-addable-empty { font-size: .86rem; color: var(--fph-muted); margin: 0; }
.sd-save-msg { font-size: .84rem; color: var(--danger); margin: 8px 0 0; min-height: 1em; }

/* ── Charts ──────────────────────────────────────────────────── */
.sd-chart-wrap { position: relative; width: 100%; }
.sd-colchart { width: 100%; height: 220px; }
.sd-chart { width: 100%; height: 100%; display: block; overflow: visible; }
.sd-chart .sd-gl { stroke: var(--fph-border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sd-chart .sd-axis { stroke: var(--fph-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sd-chart .sd-tick { font-size: 11px; fill: var(--fph-faint); font-family: var(--fph-font); font-variant-numeric: tabular-nums; }
.sd-chart .sd-val { font-size: 11px; fill: var(--fph-dark); font-weight: 500; font-family: var(--fph-font); }
.sd-chart .sd-bar { fill: var(--accent); }
.sd-chart .sd-hit { fill: transparent; }
.sd-chart .sd-col { cursor: default; outline: none; }
.sd-chart .sd-col.is-hot .sd-hit, .sd-chart .sd-col:focus-visible .sd-hit { fill: var(--fph-subtle); opacity: .7; }
.sd-chart .sd-col.is-hot .sd-bar { fill: var(--fph-dark); }
.sd-chart-note { font-size: .84rem; color: var(--fph-muted); margin: 6px 0 0; }
.sd-tooltip { position: fixed; z-index: 2000; pointer-events: none; background: var(--fph-dark); color: var(--fph-bg); border-radius: var(--radius);
  padding: 7px 10px; font-size: .8rem; line-height: 1.35; max-width: 220px; }
.sd-tooltip strong { display: block; font-size: .95rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.sd-tooltip span { display: block; opacity: .8; }
.sd-tooltip .sub { opacity: .65; }
.sd-table-toggle { margin-top: 10px; }
.sd-table-toggle summary { font-size: .82rem; color: var(--fph-muted); cursor: pointer; }
.sd-table-toggle .sd-table { margin-top: 8px; }

/* ── Small widget parts ──────────────────────────────────────── */
.sd-bal-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--fph-border); font-size: .9rem; }
.sd-bal-row strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.sd-bal-row--main { border-bottom: 0; padding-bottom: 0; }
.sd-bal-row--main strong { font-size: 1.8rem; font-weight: 300; letter-spacing: -.02em; }
.sd-bal-row--warn { color: var(--warn-ink); }
.sd-bal-row--muted { color: var(--fph-muted); }
.sd-bal .sd-help { margin: 2px 0 8px; }

.sd-pipe { list-style: none; padding: 0; margin: 0; }
.sd-pipe a { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--fph-border); color: var(--fph-mid); text-decoration: none; font-size: .9rem; }
.sd-pipe li:last-child a { border-bottom: 0; }
.sd-pipe a:hover { color: var(--fph-dark); }
.sd-count { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; padding: 1px 8px; border-radius: var(--radius); background: var(--fph-subtle); color: var(--fph-mid); font-size: .84rem; }
.sd-count--accent { background: var(--accent); color: var(--on-accent, #fff); }
.sd-count--warn { background: var(--warn-bg); color: var(--warn-ink); }
.sd-count--bad { background: var(--danger-bg); color: var(--danger); }

.sd-status { display: inline-flex; gap: 8px; align-items: center; font-size: .95rem; }
.sd-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fph-light); box-shadow: 0 0 0 3px var(--fph-white); flex-shrink: 0; }
.sd-status--good .sd-dot { background: var(--ok-ink); }
.sd-status--warn .sd-dot { background: var(--warn); }
.sd-status--bad .sd-dot { background: var(--danger); }
.sd-checks { list-style: none; padding: 0; margin: 8px 0 0; font-size: .86rem; }
.sd-checks li { padding: 3px 0 3px 22px; position: relative; color: var(--fph-muted); }
.sd-checks li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 11px; height: 11px; border: 1.5px solid var(--fph-light); border-radius: 50%; }
.sd-checks li.ok { color: var(--fph-dark); }
.sd-checks li.ok::before { border-color: var(--ok-ink); background: var(--ok-ink); box-shadow: inset 0 0 0 2px var(--fph-white); }
.sd-checks--inline { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 0; }

.sd-rating-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.sd-rating-big { font-size: 2.6rem; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.sd-stars { color: var(--star); letter-spacing: 1px; font-size: .95rem; }
.sd-stars .off { color: var(--fph-border); }
.sd-dist { list-style: none; padding: 0; margin: 0; }
.sd-dist li { display: grid; grid-template-columns: 34px 1fr 28px; gap: 8px; align-items: center; font-size: .82rem; padding: 2px 0; color: var(--fph-mid); }
.sd-dist-track { display: block; height: 8px; background: var(--accent-light); border-radius: 4px; overflow: hidden; }
.sd-dist-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.sd-dist-n { text-align: right; font-variant-numeric: tabular-nums; }
.sd-hbars { list-style: none; padding: 0; margin: 0; }
.sd-hbars li { margin-bottom: 12px; }
.sd-hb-top { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; margin-bottom: 4px; color: var(--fph-mid); }
.sd-hb-top strong { color: var(--fph-dark); font-weight: 500; }

.sd-meter { height: 8px; background: var(--accent-light); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.sd-meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.sd-goal-num { font-size: .92rem; color: var(--fph-muted); }
.sd-goal-num strong { font-size: 1.6rem; font-weight: 300; color: var(--fph-dark); letter-spacing: -.02em; }
.sd-inline-form { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.sd-inline-form .form-control { max-width: 110px; padding: .4rem .6rem; }
.sd-prefix { color: var(--fph-muted); }
.sd-todo { list-style: none; padding: 0; margin: 6px 0 0; font-size: .86rem; }
.sd-todo li { padding: 3px 0 3px 16px; position: relative; }
.sd-todo li::before { content: '+'; position: absolute; left: 0; color: var(--accent); }
.sd-todo a { color: var(--fph-dark); }
.sd-pair { display: flex; gap: 24px; }
.sd-pair > div { display: flex; flex-direction: column; }
.sd-pair-n { font-size: 1.6rem; font-weight: 300; letter-spacing: -.02em; line-height: 1.15; }
.sd-jobs { list-style: none; padding: 0; margin: 4px 0 0; }
.sd-jobs li { padding: 7px 0; border-bottom: 1px solid var(--fph-border); display: flex; flex-direction: column; font-size: .88rem; }
.sd-jobs li:last-child { border-bottom: 0; }
.sd-jobs a { color: var(--fph-dark); text-decoration: none; font-weight: 500; }
.sd-actions { display: flex; flex-direction: column; gap: 8px; }
.sd-vac { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--fph-border); font-size: .86rem; color: var(--fph-mid); flex-wrap: wrap; }

.sd-threads-mini, .sd-notes, .sd-revs { list-style: none; padding: 0; margin: 0; }
.sd-threads-mini a, .sd-threads a { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: var(--fph-dark); padding: 8px 0; }
.sd-threads-mini li + li a { border-top: 1px solid var(--fph-border); }
.sd-tm-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sd-tm-top { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; }
.sd-tm-top strong { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-tm-top time { font-size: .74rem; color: var(--fph-faint); flex-shrink: 0; }
.sd-tm-msg { font-size: .82rem; color: var(--fph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-tm-meta { font-size: .74rem; color: var(--fph-faint); display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.is-unread .sd-tm-top strong { font-weight: 600; }
.is-unread .sd-tm-msg { color: var(--fph-dark); }
.sd-notes li a { display: grid; gap: 1px; padding: 8px 0; border-bottom: 1px solid var(--fph-border); text-decoration: none; color: var(--fph-dark); font-size: .86rem; }
.sd-notes li:last-child a { border-bottom: 0; }
.sd-notes strong { font-weight: 400; }
.sd-notes .is-unread strong { font-weight: 600; }
.sd-notes span { color: var(--fph-muted); font-size: .8rem; }
.sd-notes time { color: var(--fph-faint); font-size: .74rem; }
.sd-revs li { padding: 10px 0; border-bottom: 1px solid var(--fph-border); }
.sd-revs li:last-child { border-bottom: 0; }
.sd-revs p { font-size: .88rem; margin: 4px 0; }
.sd-rev-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.sd-av { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; }
.sd-av--ph { display: inline-flex; align-items: center; justify-content: center; background: var(--fph-dark); color: var(--fph-bg); font-size: .9rem; font-weight: 500; }

/* ── Inbox ───────────────────────────────────────────────────── */
.sd-inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); background: var(--fph-white); border: 1px solid var(--fph-border); border-radius: var(--radius); min-height: 560px; }
.sd-inbox-list { border-right: 1px solid var(--fph-border); padding: 12px; overflow-y: auto; max-height: 72vh; }
.sd-inbox-search { margin-bottom: 8px; }
.sd-threads { list-style: none; padding: 0; margin: 0; }
.sd-threads a { padding: 10px 8px; border-radius: var(--radius); }
.sd-threads a:hover { background: var(--fph-subtle); }
.sd-threads li.is-open a { background: var(--accent-light); }
.sd-inbox-thread { display: flex; flex-direction: column; min-width: 0; max-height: 72vh; }
.sd-thread-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--fph-border); }
.sd-back { display: none; text-decoration: none; font-size: 1.2rem; color: var(--fph-dark); padding: 0 6px; }
.sd-thread-orders { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--fph-border); background: var(--fph-bg); }
.sd-chip { font-size: .78rem; color: var(--fph-mid); text-decoration: none; background: var(--fph-white); border: 1px solid var(--fph-border); border-radius: var(--radius); padding: 3px 8px; display: inline-flex; gap: 6px; align-items: center; }
.sd-chip .fph-status { font-size: .7rem; padding: 0 6px; }
.sd-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sd-msg { max-width: 78%; align-self: flex-start; }
.sd-msg--mine { align-self: flex-end; text-align: right; }
.sd-msg-bubble { display: inline-block; text-align: left; background: var(--fph-bg); border: 1px solid var(--fph-border); padding: 9px 12px; border-radius: 10px 10px 10px 2px; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.sd-msg--mine .sd-msg-bubble { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); border-radius: 10px 10px 2px 10px; }
.sd-msg-file { display: inline-block; font-size: .84rem; margin-top: 4px; }
.sd-msg-meta { font-size: .72rem; color: var(--fph-faint); margin-top: 3px; }
.sd-msg-day { text-align: center; font-size: .74rem; color: var(--fph-faint); margin: 6px 0; }
.sd-msg-day span { background: var(--fph-white); padding: 0 8px; }
.sd-composer { border-top: 1px solid var(--fph-border); padding: 12px 16px; }
.sd-composer textarea { resize: vertical; min-height: 72px; }
.sd-composer-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sd-composer-bar .form-select { width: auto; max-width: 200px; padding-top: .35rem; padding-bottom: .35rem; font-size: .84rem; }
.sd-attach { cursor: pointer; }
.sd-attach-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-replies { list-style: none; padding: 0; margin: 0 0 16px; }
.sd-replies li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--fph-border); }
.sd-replies p { font-size: .86rem; color: var(--fph-mid); margin: 4px 0 0; }
.sd-form-grid { display: grid; grid-template-columns: 220px 1fr auto; gap: 10px; align-items: end; }

/* ── Reviews page ────────────────────────────────────────────── */
.sd-review .sd-rev-text { margin: 8px 0; color: var(--fph-dark); }
.sd-reply { background: var(--fph-bg); border-left: 2px solid var(--accent); padding: 8px 12px; margin: 8px 0; font-size: .88rem; }
.sd-reply p { margin: 2px 0 0; }
.sd-reply-edit summary { list-style: none; display: inline-block; }
.sd-reply-edit summary::-webkit-details-marker { display: none; }
.sd-tips { padding-left: 18px; margin: 0; font-size: .88rem; color: var(--fph-mid); }
.sd-tips li { margin-bottom: 6px; }

/* ── Payouts page ────────────────────────────────────────────── */
.sd-connect { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; border-left: 3px solid var(--fph-light); }
.sd-connect--good { border-left-color: var(--ok-ink); }
.sd-connect--warn { border-left-color: var(--warn); }
.sd-connect--bad { border-left-color: var(--danger); }
.sd-connect-main p { color: var(--fph-mid); }
.sd-connect-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sd-req-list { margin: 0 0 4px; padding-left: 18px; font-size: .88rem; }
.sd-steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.sd-steps li { position: relative; padding: 0 0 14px 34px; counter-increment: s; }
.sd-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--fph-edge); color: var(--fph-muted);
  font-size: .74rem; display: flex; align-items: center; justify-content: center; background: var(--fph-white); }
.sd-steps li:not(:last-child)::after { content: ''; position: absolute; left: 10.5px; top: 24px; bottom: 2px; width: 1px; background: var(--fph-border); }
.sd-steps li.ok::before { content: '✓'; background: var(--ok-ink); border-color: var(--ok-ink); color: var(--fph-white); }
.sd-steps strong { display: block; font-size: .9rem; font-weight: 500; }
.sd-steps span { font-size: .8rem; color: var(--fph-muted); }
.sd-flow { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: f; }
.sd-flow li { counter-increment: f; border-top: 2px solid var(--accent); padding-top: 10px; }
.sd-flow li::before { content: counter(f); font-size: .74rem; color: var(--accent); font-weight: 500; }
.sd-flow strong { display: block; font-size: .9rem; font-weight: 500; margin: 2px 0; }
.sd-flow span { font-size: .8rem; color: var(--fph-muted); line-height: 1.45; display: block; }
.sd-calc { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 32px; margin: 0; }
.sd-calc dt { font-size: .78rem; color: var(--fph-muted); font-weight: 400; }
.sd-calc dd { margin: 0; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.sd-calc-total dd { font-weight: 500; color: var(--accent); }

/* ── Forms ───────────────────────────────────────────────────── */
.sd-form { max-width: 820px; }
.sd-form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 20px; }
.sd-form-actions--sticky { position: sticky; bottom: 0; background: var(--fph-bg); padding: 12px 0; border-top: 1px solid var(--fph-border); z-index: 5; }
.sd-choice { display: flex; gap: 10px; flex-wrap: wrap; }
.sd-choice label { flex: 1 1 180px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--fph-edge); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; background: var(--fph-white); }
.sd-choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.sd-choice input { margin-top: 4px; accent-color: var(--accent); }
.sd-choice span strong { display: block; font-weight: 500; }
.sd-choice small { color: var(--fph-muted); font-size: .8rem; }
.sd-earn { background: var(--accent-light); border-radius: var(--radius); padding: 12px 14px; margin-top: 30px; font-size: .95rem; }
.sd-earn strong { font-size: 1.15rem; font-weight: 500; }
.sd-file-row { display: flex; gap: 14px; align-items: center; }
.sd-filebox { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--fph-bg); border: 1px solid var(--fph-border); border-radius: var(--radius); margin-bottom: 14px; }
.sd-filebox .sd-thumb { width: 52px; height: 52px; }
.sd-row { border: 1px solid var(--fph-border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--fph-bg); }
.sd-row .form-label { font-size: .78rem; margin-bottom: 3px; }
.sd-tags-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--fph-edge); background: var(--fph-white); border-radius: var(--radius); padding: 6px 8px; min-height: 44px; cursor: text; }
.sd-tags-box:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.sd-tag-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-light); color: var(--fph-dark); border-radius: var(--radius); padding: 3px 4px 3px 9px; font-size: .86rem; }
.sd-tag-pill button { border: 0; background: none; color: var(--fph-muted); font-size: 1rem; line-height: 1; padding: 0 4px; border-radius: var(--radius); }
.sd-tag-pill button:hover { color: var(--danger); }
.sd-tags-input { border: 0; outline: 0; flex: 1; min-width: 160px; background: transparent; font-size: .95rem; padding: 4px; }
.sd-strength { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
.sd-vacation { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.sd-cover { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; display: block; }
.sd-cover--ph { background: var(--fph-subtle); display: flex; align-items: center; justify-content: center; color: var(--fph-muted); font-size: .86rem; }
.sd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.sd-gallery figure { margin: 0; }
.sd-gallery img { width: 100%; height: 140px; object-fit: cover; display: block; }
.sd-gallery figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; font-size: .84rem; }
.sd-joblist { list-style: none; padding: 0; margin: 0; }
.sd-joblist li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--fph-border); }
.sd-joblist li:last-child { border-bottom: 0; }
.sd-joblist-r { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1199px) {
  .sd-kpis--page { grid-template-columns: repeat(3, 1fr); }
  .sd-flow { grid-template-columns: repeat(3, 1fr); }
  .sd-minis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
  .sd-wrap { grid-template-columns: 1fr; gap: 16px; }
  .sd-side { position: static; background: var(--fph-white); border: 1px solid var(--fph-border); border-radius: var(--radius); padding: 10px 12px; }
  .sd-me { border-bottom: 0; padding: 0; margin: 0; }
  .sd-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .sd-side-toggle { display: inline-block; border: 1px solid var(--fph-edge); background: var(--fph-bg); border-radius: var(--radius); padding: 6px 12px; font-size: .88rem; }
  .sd-nav { display: none; width: 100%; margin-top: 8px; border-top: 1px solid var(--fph-border); padding-top: 4px; }
  .sd-side.is-open .sd-nav { display: block; }
  .sd-w, .sd-w--md { grid-column: span 3; }
  .sd-w--lg, .sd-w--full { grid-column: 1 / -1; }
  .sd-kpis { grid-template-columns: repeat(2, 1fr); }
  .sd-kpis--page { grid-template-columns: repeat(2, 1fr); }
  .sd-connect { grid-template-columns: 1fr; }
  .sd-inbox { grid-template-columns: 1fr; }
  .sd-inbox-list { border-right: 0; max-height: none; }
  .sd-inbox.has-thread .sd-inbox-list { display: none; }
  .sd-inbox:not(.has-thread) .sd-inbox-thread { display: none; }
  .sd-back { display: inline-block; }
  .sd-inbox-thread { max-height: none; }
  .sd-msgs { max-height: 60vh; }
}
@media (max-width: 640px) {
  .sd { padding-top: 16px; }
  .sd-grid { grid-template-columns: 1fr; gap: 14px; }
  .sd-w, .sd-w--md, .sd-w--lg, .sd-w--full { grid-column: 1 / -1; }
  .sd-split { grid-template-columns: 1fr; }
  .sd-kpis, .sd-kpis--page, .sd-kpis--4 { grid-template-columns: 1fr 1fr; }
  .sd-kpi--hero { grid-column: 1 / -1; }
  .sd-kpi-value { font-size: 1.35rem; }
  .sd-kpi--hero .sd-kpi-value { font-size: 2.1rem; }
  .sd-minis { grid-template-columns: 1fr 1fr; }
  .sd-flow { grid-template-columns: 1fr 1fr; }
  .sd-colchart { height: 180px; }
  .sd-strength { grid-template-columns: 1fr; gap: 10px; }
  .sd-vacation, .sd-joblist li { flex-direction: column; align-items: flex-start; }
  .sd-form-grid { grid-template-columns: 1fr; }
  .sd-head { align-items: flex-start; }
  .sd-msg { max-width: 92%; }
  .sd-customizer-btns { width: 100%; }
  .sd-customizer-btns .btn { flex: 1; }
  .sd-w-sizes { display: none; }
  .sd-file-row { flex-direction: column; align-items: flex-start; }
  .sd-table th:first-child, .sd-table td:first-child { padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) { .sd-w { transition: none; } }
@media (forced-colors: active) { .sd-chart .sd-bar, .sd-dist-fill, .sd-meter span { fill: CanvasText; background: CanvasText; } }

/* Status pills: sentence case (style.css capitalizes every word) */
.sd .fph-status { text-transform: none; }
.sd-strength, .sd-vacation { max-width: 820px; }

/* Mobile/tablet KPI packing: hero spans the row; a lone last tile fills it. */
@media (max-width: 991px) {
  .sd-kpi--hero { grid-column: 1 / -1; }
  .sd-kpi--hero ~ .sd-kpi:last-child:nth-child(even) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .sd-kpi:not(.sd-kpi--hero) .sd-spark { display: none; }
  .sd-scroll .sd-table { min-width: 540px; }
  .sd-w .sd-scroll { margin: 0 -18px; padding: 0 18px; }
}
