/* =====================================================================
   Xcojo Platform — Connect Design 2026 (Payments · Ads · Partners)
   Same tokens as Xcojo Accounts. One accent (user-controlled) drives
   buttons, switches, focus rings, links, icons and selection.
   ===================================================================== */
@font-face { font-family: "EB Garamond"; src: url("https://dev.xcojo.com/Fonts/EB_Garamond/EBGaramond-VariableFont_wght.ttf") format("truetype-variations"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("https://dev.xcojo.com/Fonts/EB_Garamond/EBGaramond-Italic-VariableFont_wght.ttf") format("truetype-variations"); font-weight: 400 800; font-style: italic; font-display: swap; }

:root {
  --c-bg: #FAF8F3; --c-surface: #FFFFFF; --c-fill: #F3F0E8; --c-text: #1C1A16; --c-muted: #5C574D;
  --c-border: #E6E1D6; --c-border-strong: #D6D0C2;
  --c-success: #15803D; --c-warning: #B45309; --c-error: #C2410C; --c-info: #1D4ED8;
  --xco-accent: #0F766E; --xco-accent-ink: #FFFFFF;
  --accent-text: var(--xco-accent);
  --accent-soft: color-mix(in srgb, var(--xco-accent) 9%, var(--c-surface));
  --e1: 0 0 0 .5px var(--c-border-strong), 0 1px 2px rgba(28,26,22,.05);
  --e2: 0 0 0 .5px var(--c-border-strong), 0 10px 28px -10px rgba(28,26,22,.18);
  --e3: 0 24px 64px -16px rgba(28,26,22,.32), 0 0 0 .5px var(--c-border-strong);
  --r-sm: 10px; --r-md: 12px; --r-lg: 16px;
  --font: "EB Garamond", "Noto Serif Ethiopic", "Gill Sans", "Gill Sans MT", Optima, "Segoe UI", Candara, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --t-instant: 100ms ease-out; --t-quick: 200ms ease-out; --t-standard: 300ms cubic-bezier(.2,0,0,1);
  --topbar: 60px; --sidebar: 240px;
  color-scheme: light;
}
@supports (color: oklch(from red l c h)) { :root { --xco-accent-ink: oklch(from var(--xco-accent) clamp(0, (.68 - l) * 1000, 1) 0 0); } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0E0D0B; --c-surface: #1A1815; --c-fill: #23211D; --c-text: #F2EEE4; --c-muted: #A8A194;
    --c-border: #2E2B25; --c-border-strong: #3B372F;
    --c-success: #4ADE80; --c-warning: #FBBF24; --c-error: #FB7185; --c-info: #60A5FA;
    --accent-text: color-mix(in oklab, var(--xco-accent) 55%, #fff);
    --accent-soft: color-mix(in srgb, var(--xco-accent) 18%, var(--c-surface));
    --e1: 0 0 0 1px var(--c-border); --e2: 0 0 0 1px var(--c-border), 0 12px 32px -8px rgba(0,0,0,.6); --e3: 0 0 0 1px var(--c-border), 0 28px 72px -12px rgba(0,0,0,.75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #0E0D0B; --c-surface: #1A1815; --c-fill: #23211D; --c-text: #F2EEE4; --c-muted: #A8A194;
  --c-border: #2E2B25; --c-border-strong: #3B372F;
  --c-success: #4ADE80; --c-warning: #FBBF24; --c-error: #FB7185; --c-info: #60A5FA;
  --accent-text: color-mix(in oklab, var(--xco-accent) 55%, #fff);
  --accent-soft: color-mix(in srgb, var(--xco-accent) 18%, var(--c-surface));
  --e1: 0 0 0 1px var(--c-border); --e2: 0 0 0 1px var(--c-border), 0 12px 32px -8px rgba(0,0,0,.6); --e3: 0 0 0 1px var(--c-border), 0 28px 72px -12px rgba(0,0,0,.75);
  color-scheme: dark;
}
:root[data-corner-radius="sharp"] { --r-sm: 4px; --r-md: 4px; --r-lg: 6px; }
:root[data-corner-radius="round"] { --r-sm: 18px; --r-md: 20px; --r-lg: 24px; }

/* ---- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body { margin: 0; min-height: 100vh; background: var(--c-bg); color: var(--c-text); font: 17px/1.5 var(--font);
  font-feature-settings: "kern","liga","onum"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.012em; margin: 0 0 .35em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 3.6vw, 2.6rem); line-height: 1.08; letter-spacing: -.02em; }
h2 { font-size: 1.45rem; line-height: 1.2; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 .75em; color: var(--c-muted); max-width: 68ch; text-wrap: pretty; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
code, .pf-mono { font-family: var(--mono); font-size: .82em; }
::selection { background: color-mix(in srgb, var(--xco-accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--xco-accent); outline-offset: 2px; border-radius: 6px; }
.xco-i { width: 20px; height: 20px; flex: none; display: block; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Top bar (vibrancy) --------------------------------------------- */
.pf-topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar);
  display: flex; align-items: center; gap: 12px; padding: 0 clamp(14px, 2.5vw, 28px);
  background: color-mix(in srgb, var(--c-bg) 72%, transparent);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: .5px solid var(--c-border-strong);
}
.pf-lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--c-text); text-decoration: none !important; min-width: 0; }
.pf-wordmark { display: block; height: 26px; width: auto; max-width: 132px; object-fit: contain; }
:root[data-theme="dark"] .pf-wordmark { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pf-wordmark { filter: invert(1) hue-rotate(180deg); } }
.pf-wordmark-fallback { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px; background: var(--c-text); color: var(--c-bg); font-weight: 600; letter-spacing: .01em; }
.pf-lockup-divider { width: 1px; height: 20px; background: var(--c-border-strong); }
.pf-lockup-label { font-size: 1.1rem; font-weight: 500; }
.pf-topbar-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.pf-switcher { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--c-fill); }
.pf-switcher a { padding: 3px 12px; border-radius: 999px; color: var(--c-muted); font-size: .92rem; text-decoration: none; }
.pf-switcher a:hover { color: var(--c-text); }
.pf-switcher a[aria-current] { background: var(--c-surface); color: var(--c-text); box-shadow: var(--e1); }
.pf-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--xco-accent) 22%, var(--c-border)); font-size: .9rem; font-weight: 500; cursor: pointer; }
.pf-avatar-lg { width: 44px; height: 44px; font-size: 1.05rem; cursor: default; }
.pf-icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--c-text); cursor: pointer; }
.pf-icon-btn:hover { background: var(--c-fill); }
.pf-menu { position: absolute; top: calc(var(--topbar) - 6px); right: clamp(14px, 2.5vw, 28px); width: 280px; padding: 6px;
  background: color-mix(in srgb, var(--c-surface) 92%, transparent); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--r-lg); box-shadow: var(--e3); animation: pf-pop var(--t-quick) both; transform-origin: top right; }
.pf-menu[hidden] { display: none; }
.pf-menu-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: .5px solid var(--c-border-strong); margin-bottom: 6px; }
.pf-menu-head strong { display: block; }
.pf-menu-head span { display: block; font-size: .85rem; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.pf-menu a, .pf-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--c-text); text-align: left; cursor: pointer; text-decoration: none; }
.pf-menu a:hover, .pf-menu button:hover { background: var(--xco-accent); color: var(--xco-accent-ink); }
.pf-menu .xco-i { width: 18px; height: 18px; }
.pf-menu-danger { color: var(--c-error) !important; }
.pf-menu-danger:hover { background: var(--c-error) !important; color: #fff !important; }

/* ---- Shell ---------------------------------------------------------- */
.pf-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.pf-bare .pf-shell { grid-template-columns: minmax(0, 1fr); }
.pf-sidebar { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow: auto; padding: 20px 12px; border-right: .5px solid var(--c-border-strong); }
.pf-sidebar a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; margin-bottom: 2px; border-radius: var(--r-sm); color: var(--c-text); text-decoration: none; transition: background-color var(--t-instant); }
.pf-sidebar a:hover { background: var(--c-fill); }
.pf-sidebar a.is-active { background: var(--accent-soft); font-weight: 600; }
.pf-nav-icon { width: 28px; height: 28px; border-radius: 7px; display: inline-grid; place-items: center; flex: none; background: var(--xco-accent); color: var(--xco-accent-ink); box-shadow: inset 0 .5px 0 rgba(255,255,255,.3), 0 1px 2px rgba(28,26,22,.12); }
.pf-nav-icon .xco-i { width: 17px; height: 17px; }
.pf-nav-heading { padding: 18px 10px 6px; font-size: .82rem; font-style: italic; color: var(--c-muted); }
.pf-nav-count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--c-fill); color: var(--c-muted); font-size: .8rem; text-align: center; font-variant-numeric: tabular-nums; }
.pf-main { min-width: 0; width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 48px) 24px; }
.pf-bare .pf-main { max-width: 1040px; }

.pf-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.pf-page-head h1 { margin: 0 0 6px; }
.pf-page-head .pf-lead { margin: 0; }
.pf-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-eyebrow { font-size: .88rem; font-style: italic; color: var(--c-muted); margin-bottom: 4px; }
.pf-lead { font-size: 1.12rem; color: var(--c-muted); }

/* ---- Cards, groups, rows ------------------------------------------- */
.pf-card { background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--e1); padding: 22px 24px; margin-bottom: 20px; }
.pf-card > h2:first-child, .pf-card-head h2 { font-size: 1.25rem; margin-bottom: 4px; }
.pf-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.pf-card-head p { margin: 0; }
.pf-section-title { font-size: .95rem; font-weight: 600; color: var(--c-muted); margin: 28px 4px 10px; }
.pf-group { background: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--e1); overflow: hidden; margin-bottom: 20px; }
.pf-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 16px; }
.pf-row + .pf-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--c-border-strong); }
.pf-row-stack { flex-direction: column; align-items: flex-start; }
.pf-row-label { font-weight: 600; }
.pf-row-desc { font-size: .9rem; color: var(--c-muted); }
.pf-row a.pf-row-link { color: inherit; text-decoration: none; display: contents; }
.pf-grid { display: grid; gap: 16px; }
.pf-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pf-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Stats */
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.pf-stat { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--e1); }
.pf-stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.pf-stat-label { font-size: .9rem; color: var(--c-muted); }
.pf-stat-value { font-size: 1.55rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums lining-nums; }
.pf-stat-sub { font-size: .85rem; color: var(--c-muted); }

/* Balance hero (Payments) */
.pf-balance { position: relative; overflow: hidden; padding: 28px; border-radius: calc(var(--r-lg) + 4px); color: #F2EEE4; margin-bottom: 24px;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--xco-accent) 70%, transparent), transparent 60%), linear-gradient(160deg, #1F2B29, #121816);
  box-shadow: 0 18px 44px -20px rgba(14,13,11,.55); }
.pf-balance-label { font-size: .95rem; opacity: .8; }
.pf-balance-amount { font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; margin: 4px 0 2px; }
.pf-balance-others { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pf-balance-others span { padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: .88rem; font-variant-numeric: tabular-nums; }
.pf-balance-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.pf-balance .pf-btn-secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.18); }
.pf-balance .pf-btn-secondary:hover { background: rgba(255,255,255,.2); }
.pf-balance .pf-btn-primary { background: #F2EEE4; color: #1C1A16; }

/* Tables */
.pf-table-wrap { overflow-x: auto; background: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--e1); margin-bottom: 20px; }
.pf-table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.pf-table th { text-align: left; font-weight: 600; font-size: .85rem; color: var(--c-muted); padding: 12px 16px; border-bottom: .5px solid var(--c-border-strong); white-space: nowrap; }
.pf-table td { padding: 12px 16px; border-bottom: .5px solid var(--c-border); vertical-align: middle; }
.pf-table tr:last-child td { border-bottom: 0; }
.pf-table tbody tr:hover { background: color-mix(in srgb, var(--c-fill) 60%, transparent); }
.pf-num { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.pf-pos { color: var(--c-success); }
.pf-neg { color: var(--c-text); }
.pf-sub { display: block; font-size: .85rem; color: var(--c-muted); }

/* Buttons */
.pf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px;
  border: 1px solid transparent; border-radius: var(--r-sm); font-size: 1rem; font-weight: 500; line-height: 1.2; white-space: nowrap;
  text-decoration: none !important; cursor: pointer; transition: background-color var(--t-instant), border-color var(--t-instant), transform var(--t-instant); }
.pf-btn:active { transform: translateY(1px); }
.pf-btn .xco-i { width: 18px; height: 18px; }
.pf-btn-primary { background: var(--xco-accent); color: var(--xco-accent-ink); box-shadow: inset 0 .5px 0 rgba(255,255,255,.25), 0 1px 2px rgba(28,26,22,.12); }
.pf-btn-primary:hover { background: color-mix(in srgb, var(--xco-accent) 88%, #000); }
.pf-btn-secondary { background: var(--c-surface); border-color: var(--c-border-strong); color: var(--c-text); }
.pf-btn-secondary:hover { background: var(--c-fill); }
.pf-btn-tinted { background: var(--accent-soft); color: var(--accent-text); }
.pf-btn-tinted:hover { background: color-mix(in srgb, var(--xco-accent) 16%, var(--c-surface)); }
.pf-btn-danger { background: transparent; border-color: color-mix(in srgb, var(--c-error) 40%, var(--c-border)); color: var(--c-error); }
.pf-btn-danger:hover { background: color-mix(in srgb, var(--c-error) 8%, transparent); }
.pf-btn-sm { min-height: 34px; padding: 5px 12px; font-size: .93rem; }
.pf-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.pf-btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.pf-inline { display: inline; margin: 0; }

/* Forms */
.pf-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.pf-field { margin-bottom: 16px; min-width: 0; }
.pf-field-full, .pf-form > .pf-full { grid-column: 1 / -1; }
.pf-field label, .pf-label { display: block; margin-bottom: 6px; font-size: .92rem; font-weight: 500; color: var(--c-text); }
.pf-field input, .pf-field select, .pf-field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); transition: border-color var(--t-quick), box-shadow var(--t-quick); }
.pf-field textarea { min-height: 96px; resize: vertical; }
.pf-field input:focus, .pf-field select:focus, .pf-field textarea:focus { outline: none; border-color: var(--xco-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--xco-accent) 18%, transparent); }
.pf-hint { margin-top: 6px; font-size: .86rem; color: var(--c-muted); }
.pf-form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.pf-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--c-fill); cursor: pointer; user-select: none; }
.pf-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--xco-accent); }
.pf-check:has(input:checked) { background: var(--accent-soft); color: var(--accent-text); }
.pf-amount { position: relative; }
.pf-amount input { font-size: 1.6rem; font-variant-numeric: tabular-nums; padding-right: 72px; min-height: 60px; }
.pf-amount span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }

/* Switch (checkbox) */
input.pf-switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 999px; background: var(--c-border-strong); position: relative; cursor: pointer; transition: background-color var(--t-quick); }
input.pf-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform var(--t-quick); }
input.pf-switch:checked { background: var(--xco-accent); }
input.pf-switch:checked::after { transform: translateX(20px); }

/* Segmented control */
.pf-segment { display: inline-flex; gap: 2px; padding: 3px; background: var(--c-fill); border-radius: var(--r-sm); }
.pf-segment label { position: relative; }
.pf-segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pf-segment span { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; border-radius: calc(var(--r-sm) - 3px); color: var(--c-muted); font-size: .95rem; }
.pf-segment input:checked + span { background: var(--c-surface); color: var(--c-text); font-weight: 600; box-shadow: var(--e1); }
.pf-segment input:focus-visible + span { outline: 2px solid var(--xco-accent); outline-offset: 1px; }

/* Swatches */
.pf-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pf-swatch { position: relative; width: 32px; height: 32px; }
.pf-swatch input[type=radio] { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.pf-swatch span { position: absolute; inset: 0; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.pf-swatch input:checked + span { box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 4px var(--sw); }
.pf-swatch input:checked + span::after { content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.pf-swatch input:focus-visible + span { outline: 2px solid var(--c-text); outline-offset: 4px; }
.pf-swatch-custom input[type=color] { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: conic-gradient(#BE123C, #B45309, #15803D, #0F766E, #1D4ED8, #6D28D9, #BE123C); cursor: pointer; }
.pf-swatch-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.pf-swatch-custom input[type=color]::-webkit-color-swatch { border: 2px solid var(--c-surface); border-radius: 50%; }

/* Badges */
.pf-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 500; white-space: nowrap; background: var(--c-fill); color: var(--c-muted); }
.pf-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pf-badge-good { color: var(--c-success); background: color-mix(in srgb, var(--c-success) 10%, var(--c-surface)); }
.pf-badge-warn { color: var(--c-warning); background: color-mix(in srgb, var(--c-warning) 10%, var(--c-surface)); }
.pf-badge-bad  { color: var(--c-error);   background: color-mix(in srgb, var(--c-error) 10%, var(--c-surface)); }
.pf-tag { display: inline-flex; padding: 1px 8px; border-radius: 6px; background: var(--c-fill); font-size: .85rem; color: var(--c-muted); margin: 0 4px 4px 0; }

/* Empty, notices, toast */
.pf-empty { text-align: center; padding: 44px 24px; background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--e1); margin-bottom: 20px; }
.pf-empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.pf-empty h3 { font-size: 1.25rem; font-weight: 500; }
.pf-empty p { margin: 0 auto 16px; }
.pf-note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--c-fill); color: var(--c-muted); font-size: .95rem; margin-bottom: 20px; }
.pf-note .xco-i { color: var(--accent-text); margin-top: 2px; }
.pf-note strong { color: var(--c-text); }
.pf-note-warn { background: color-mix(in srgb, var(--c-warning) 9%, var(--c-surface)); }
.pf-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 80; transform: translateX(-50%);
  max-width: min(92vw, 520px); padding: 12px 20px; border-radius: var(--r-md); background: var(--c-text); color: var(--c-bg); box-shadow: var(--e3); animation: pf-toast 4.2s var(--t-standard) both; }
.pf-toast-error { background: var(--c-error); color: #fff; }
@keyframes pf-toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 6%, 90% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 8px); visibility: hidden; } }

/* Progress / meter */
.pf-meter { height: 6px; border-radius: 999px; background: var(--c-fill); overflow: hidden; }
.pf-meter span { display: block; height: 100%; border-radius: inherit; background: var(--xco-accent); }

/* Ad preview (Ads) */
.pf-adpreview { padding: 16px 18px; border-radius: var(--r-md); background: var(--c-bg); box-shadow: inset 0 0 0 .5px var(--c-border-strong); }
.pf-adpreview .ad-head { font-size: .88rem; color: var(--c-muted); display: flex; gap: 6px; align-items: center; }
.pf-adpreview .ad-sponsored { font-size: 1.2rem; font-weight: 600; color: var(--c-text); }
.pf-adpreview .ad-title { font-size: 1.2rem; color: var(--accent-text); }
.pf-adpreview p { margin: 2px 0 0; }

/* Landing hero (signed out) */
.pf-hero { text-align: center; padding: 64px 0 40px; }
.pf-hero-sm { padding: 80px 0; }
.pf-hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); max-width: 16ch; margin: 0 auto 14px; }
.pf-hero .pf-lead { max-width: 52ch; margin: 0 auto 24px; font-size: 1.2rem; }
.pf-hero .pf-btn-row { justify-content: center; }
.pf-hero-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; background: var(--xco-accent); color: var(--xco-accent-ink); box-shadow: inset 0 .5px 0 rgba(255,255,255,.3), 0 10px 24px -10px color-mix(in srgb, var(--xco-accent) 60%, transparent); }
.pf-hero-icon .xco-i { width: 32px; height: 32px; }
.pf-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 12px 0 40px; }
.pf-feature { padding: 22px; background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--e1); }
.pf-feature .pf-stat-icon { margin-bottom: 12px; }
.pf-feature h3 { font-size: 1.1rem; }
.pf-feature p { margin: 0; font-size: .97rem; }

/* Sheet (dialog) */
.pf-sheet { width: min(520px, calc(100vw - 32px)); max-height: 90vh; padding: 0; border: 0; border-radius: calc(var(--r-lg) + 4px); background: var(--c-bg); color: var(--c-text); box-shadow: var(--e3); }
.pf-sheet::backdrop { background: rgba(14,13,11,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pf-sheet[open] { animation: pf-pop var(--t-standard) both; }
.pf-sheet-body { padding: 18px 20px 20px; }
.pf-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pf-sheet-head h2 { margin: 0; }
.pf-sheet .pf-group { background: var(--c-surface); }
.pf-sheet-actions { display: flex; justify-content: flex-end; }

/* Footer */
.pf-footer { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 28px 0 8px; margin-top: 32px; border-top: .5px solid var(--c-border-strong); color: var(--c-muted); font-size: .88rem; }
.pf-footer a { color: var(--c-muted); }
.pf-footer a:hover { color: var(--c-text); }

/* Tab bar (phones) */
.pf-tabbar { display: none; }
.pf-only-mobile { display: none; }

@keyframes pf-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pf-sheet { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .pf-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-grid-3, .pf-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-switcher { display: none; }
}
@media (max-width: 760px) {
  :root { --topbar: 54px; }
  .pf-shell { grid-template-columns: minmax(0, 1fr); }
  .pf-sidebar { position: fixed; top: var(--topbar); left: 0; bottom: 0; z-index: 40; width: 280px; height: auto; background: var(--c-bg); box-shadow: var(--e3); transform: translateX(-105%); transition: transform var(--t-standard); }
  .pf-sidebar.is-open { transform: none; }
  .pf-only-mobile { display: inline-grid; }
  .pf-main { padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
  .pf-bare .pf-main { padding-bottom: 32px; }
  .pf-page-head { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .pf-grid-2, .pf-grid-3, .pf-grid-4, .pf-features, .pf-form { grid-template-columns: minmax(0, 1fr); }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pf-stat { padding: 14px; flex-direction: column; gap: 8px; }
  .pf-stat-value { font-size: 1.3rem; }
  .pf-card { padding: 18px; }
  .pf-lockup-label { font-size: 1rem; }
  .pf-wordmark { height: 22px; }
  .pf-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--c-bg) 78%, transparent); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: .5px solid var(--c-border-strong); }
  .pf-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; padding-top: 4px; color: var(--c-muted); font-size: .72rem; text-decoration: none; }
  .pf-tabbar a .xco-i { width: 24px; height: 24px; }
  .pf-tabbar a[aria-current] { color: var(--accent-text); }
  .pf-sheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .pf-sheet[open] { animation: pf-sheet var(--t-standard) both; }
  .pf-sheet-body::before { content: ""; display: block; width: 36px; height: 5px; margin: -8px auto 12px; border-radius: 999px; background: var(--c-border-strong); }
  .pf-table th:nth-child(n+4), .pf-table td:nth-child(n+4):not(.pf-num):not(.pf-keep) { display: none; }
  .pf-hero { padding: 40px 0 24px; }
  .pf-menu { right: 8px; left: 8px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 150ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print { .pf-topbar, .pf-sidebar, .pf-tabbar, .pf-footer { display: none !important; } .pf-shell { display: block; } }

/* Apps grid (all Xcojo products) */
.pf-apps { position: absolute; top: calc(var(--topbar) - 6px); right: clamp(14px, 2.5vw, 28px); width: 340px; max-height: 70vh; overflow: auto; padding: 10px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: color-mix(in srgb, var(--c-surface) 92%, transparent); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--r-lg); box-shadow: var(--e3); animation: pf-pop var(--t-quick) both; transform-origin: top right; z-index: 60; }
.pf-apps[hidden] { display: none; }
.pf-apps a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 10px; color: var(--c-text); font-size: .85rem; text-align: center; text-decoration: none; }
.pf-apps a:hover, .pf-apps a[aria-current] { background: var(--c-fill); }
.pf-apps .pf-nav-icon { width: 40px; height: 40px; border-radius: 11px; }
.pf-apps .pf-nav-icon .xco-i { width: 22px; height: 22px; }
@media (max-width: 760px) { .pf-apps { left: 8px; right: 8px; width: auto; } }

/* ---- Shared product kit (link tabs, code, popovers, media, chat, feed) ---- */
.pf-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--c-fill); border-radius: var(--r-sm); margin-bottom: 16px; }
.pf-tabs a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; border-radius: calc(var(--r-sm) - 3px); color: var(--c-muted); text-decoration: none; font-size: .95rem; }
.pf-tabs a.is-active { background: var(--c-surface); color: var(--c-text); font-weight: 600; box-shadow: var(--e1); }
pre.pf-code { margin: 0; padding: 14px 16px; overflow: auto; border-radius: var(--r-sm); background: var(--c-fill); font: .86rem/1.55 'JetBrains Mono', ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; }
.pf-pop { position: relative; }
.pf-pop > summary { list-style: none; cursor: pointer; }
.pf-pop > summary::-webkit-details-marker { display: none; }
.pf-pop > .pf-card { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 280px; box-shadow: var(--e2, 0 12px 32px rgba(0,0,0,.14)); }
.pf-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.pf-tile { display: flex; flex-direction: column; background: var(--c-surface); border-radius: var(--r-md, 14px); overflow: hidden; box-shadow: var(--e1); color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.pf-tile:hover { transform: translateY(-2px); box-shadow: var(--e2, 0 12px 32px rgba(0,0,0,.12)); }
.pf-tile-media { aspect-ratio: 16/10; background: var(--c-fill) center/cover no-repeat; display: grid; place-items: center; color: var(--c-muted); }
.pf-tile-media .xco-i { width: 36px; height: 36px; }
.pf-tile-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.pf-tile-body strong { font-size: 1.05rem; line-height: 1.25; }
.pf-tile-body span { color: var(--c-muted); font-size: .9rem; }
.pf-price { font-weight: 600; color: var(--c-text) !important; }
.pf-post { background: var(--c-surface); border-radius: var(--r-md, 14px); box-shadow: var(--e1); padding: 16px; margin-bottom: 12px; }
.pf-post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pf-post-head a { color: inherit; font-weight: 600; text-decoration: none; }
.pf-post-head span { color: var(--c-muted); font-size: .88rem; }
.pf-post-body { white-space: pre-wrap; word-wrap: break-word; font-size: 1.05rem; line-height: 1.55; }
.pf-post-img { margin-top: 10px; border-radius: var(--r-sm); max-height: 520px; width: 100%; object-fit: cover; background: var(--c-fill); }
.pf-post-actions { display: flex; gap: 6px; margin-top: 10px; }
.pf-post-actions button, .pf-post-actions a { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--c-muted); font: inherit; font-size: .92rem; padding: 6px 10px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.pf-post-actions button:hover, .pf-post-actions a:hover, .pf-post-actions .is-on { background: var(--accent-soft); color: var(--xco-accent); }
.pf-post-actions .xco-i { width: 18px; height: 18px; }
.pf-chat { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; padding: 8px 2px; }
.pf-bubble { max-width: min(78%, 560px); padding: 9px 14px; border-radius: 18px; background: var(--c-fill); white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.pf-bubble.is-me { align-self: flex-end; background: var(--xco-accent); color: var(--xco-accent-ink); }
.pf-bubble small { display: block; opacity: .7; font-size: .75rem; margin-top: 2px; }
.pf-composer { display: flex; gap: 8px; align-items: flex-end; }
.pf-composer textarea, .pf-composer input[type=text] { flex: 1; min-height: 44px; max-height: 200px; padding: 10px 14px; border-radius: 22px; border: 0; box-shadow: 0 0 0 1px var(--c-border-strong); background: var(--c-surface); color: var(--c-text); font: inherit; resize: none; }
.pf-progress { height: 8px; border-radius: 999px; background: var(--c-fill); overflow: hidden; }
.pf-progress > span { display: block; height: 100%; background: var(--xco-accent); border-radius: inherit; }
.pf-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.pf-kv dt { color: var(--c-muted); }
.pf-kv dd { margin: 0; }
.pf-prose { font-size: 1.12rem; line-height: 1.7; max-width: 70ch; }
.pf-prose img { max-width: 100%; border-radius: var(--r-sm); }

/* Product app icon in the lockup; switch; RTL */
.pf-lockup-icon { width: 22px; height: 22px; border-radius: 6px; margin-right: 6px; flex: none; }
.pf-switch { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--c-fill); position: relative; cursor: pointer; flex: none; transition: background .2s; box-shadow: inset 0 0 0 1px var(--c-border-strong); }
.pf-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.pf-switch:checked { background: var(--xco-accent); box-shadow: none; }
.pf-switch:checked::after { transform: translateX(18px); }
[dir=rtl] .pf-switch:checked::after { transform: translateX(-18px); }
[dir=rtl] .pf-switch::after { left: auto; right: 3px; }
[dir=rtl] .pf-sidebar { border-right: 0; border-left: .5px solid var(--c-border-strong); }
html[data-reduce-motion] *, html[data-reduce-motion] *::before, html[data-reduce-motion] *::after { transition: none !important; animation: none !important; }
.pf-nav-icon .xco-i { width: 18px; height: 18px; }
.pf-plus-badge{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:6px;background:linear-gradient(135deg,#f59e0b,#ec4899);color:#fff;font-size:.68rem;font-weight:800;letter-spacing:.04em;vertical-align:middle}.pf-pro-badge{background:linear-gradient(135deg,#0f766e,#4f46e5)}

/* ---------- Every screen: phones, tablets, desktops and TVs ---------- */
@media (pointer: coarse) { .pf-btn, .pf-nav a, .pf-tabbar a, .pf-row { min-height: 44px; } input, select, textarea { font-size: 16px; } }
@media (min-width: 761px) and (max-width: 1100px) { .pf-main { padding-left: 20px; padding-right: 20px; } }
@media (min-width: 1600px) { html { font-size: 17px; } .pf-main { max-width: 1440px; } }
@media (min-width: 2200px) { html { font-size: 20px; } .pf-main { max-width: 1800px; } }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--xco-accent, #0F766E); outline-offset: 3px; }
/* TV (10-foot) mode: large type, big focus rings, remote-friendly */
html.pf-tv { font-size: 22px; }
html.pf-tv .pf-main { max-width: none; padding: 32px 56px; }
html.pf-tv a:focus, html.pf-tv button:focus, html.pf-tv [tabindex]:focus { outline: 5px solid var(--xco-accent, #0F766E); outline-offset: 5px; border-radius: 12px; transform: scale(1.03); transition: transform .12s; }
html.pf-tv .pf-tabbar { display: none; }

/* ---- Platform 2026-11: avatar photo, footer locality, sponsored slots, profile questions ---- */
.pf-avatar { position: relative; overflow: hidden; }
.pf-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.pf-footer { flex-direction: column; gap: 10px; }
.pf-footer-row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.pf-footer-local { font-size: .84rem; }
.pf-footer-local .xco-i { width: 14px; height: 14px; vertical-align: -2px; }
.pf-offered a { margin-left: 8px; color: var(--accent-text, var(--xco-accent)); }
.pf-ad { margin: 14px 0; }
.pf-ad-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: .5px solid var(--c-border-strong); border-radius: var(--radius, 12px); background: var(--c-surface, var(--c-bg)); color: var(--c-text); text-decoration: none; }
.pf-ad-card:hover { background: var(--c-fill); }
.pf-ad-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.pf-ad-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-ad-label { font-size: .74rem; color: var(--c-muted); letter-spacing: .02em; }
.pf-ad-url { font-size: .8rem; color: var(--accent-text, var(--xco-accent)); }
.pf-ad-why { font-size: .78rem; color: var(--c-muted); margin: 4px 2px 0; }
.pf-ad-why summary { cursor: pointer; }
.pf-ask { margin: 0 0 18px; padding: 14px 16px; border-radius: var(--radius, 14px); border: .5px solid color-mix(in srgb, var(--xco-accent) 35%, var(--c-border-strong)); background: color-mix(in srgb, var(--xco-accent) 7%, var(--c-bg)); animation: pf-ask-in .35s cubic-bezier(.2,0,0,1) both; }
@keyframes pf-ask-in { from { opacity: 0; transform: translateY(-6px); } }
.pf-ask-head { display: flex; gap: 12px; align-items: flex-start; }
.pf-ask-head > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pf-ask-head span:not(.pf-ask-icon) { color: var(--c-muted); font-size: .88rem; }
.pf-ask-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--xco-accent); color: #fff; flex: none; }
.pf-ask-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding-left: 44px; }
.pf-ask-body select, .pf-ask-body input { min-width: 200px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.pf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pf-chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: .5px solid var(--c-border-strong); cursor: pointer; font-size: .88rem; }
.pf-chip input:checked + span { background: var(--xco-accent); border-color: var(--xco-accent); color: #fff; }
.pf-chip input:focus-visible + span { outline: 2px solid var(--xco-accent); outline-offset: 2px; }
@media (max-width: 760px) { .pf-ask-body { padding-left: 0; } .pf-ask-body select, .pf-ask-body input { min-width: 0; width: 100%; } }
