/* ==========================================================================
   121 Pilot — design system
   Clarity over decoration. Brand violet for action, calm neutrals for work.
   Light by default, dark when the device prefers it.
   ========================================================================== */

:root {
	--ink: #0F0D16;
	--ink-2: #17151F;
	--bg: #F6F4F0;
	--surface: #FFFFFF;
	--surface-2: #FAF9F7;
	--line: #E6E2DA;
	--line-2: #D6D1C7;
	--text: #16141D;
	--text-2: #4A4656;
	--mute: #6E6979;
	--violet: #5B2EFF;
	--violet-ink: #4520D6;
	--violet-soft: #EEEAFF;
	--violet-hi: #A48CFF;
	--grad: linear-gradient(100deg, #5B2EFF 0%, #8A3FE8 55%, #B65CE0 100%);
	--ok: #0F8A5F; --ok-soft: #E3F5EC;
	--warn: #9A5B00; --warn-soft: #FFF1D6;
	--danger: #C0213A; --danger-soft: #FDE7EA;
	--info: #2458C6; --info-soft: #E6EEFD;
	--muted-soft: #EFEDE9;
	--shadow-1: 0 1px 2px rgba(20, 16, 40, .06), 0 1px 1px rgba(20, 16, 40, .04);
	--shadow-2: 0 10px 30px -10px rgba(20, 16, 40, .25), 0 2px 6px rgba(20, 16, 40, .06);
	--r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
	--f-display: "Archivo", system-ui, sans-serif;
	--f-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--side: 236px;
	--ease: cubic-bezier(.2, .7, .1, 1);
	color-scheme: light;
}

/* Dark theme: chosen per person (Light / Dark / Auto by time of day).
   The attribute is set before first paint by the script in _head.php. */
:root[data-theme="dark"] {
		--bg: #0C0B12;
		--surface: #15131D;
		--surface-2: #1A1824;
		--line: #262333;
		--line-2: #353146;
		--text: #F1EEF8;
		--text-2: #C9C4D6;
		--mute: #938DA3;
		--violet: #7A57FF;
		--violet-ink: #A48CFF;
		--violet-soft: #221C3F;
		--ok: #45D69C; --ok-soft: #112A21;
		--warn: #F2B24C; --warn-soft: #2E2210;
		--danger: #FF7A8C; --danger-soft: #331419;
		--info: #8AB0FF; --info-soft: #152035;
		--muted-soft: #211F2B;
		--shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
		--shadow-2: 0 18px 40px -12px rgba(0, 0, 0, .7);
		color-scheme: dark;
}
:root.p-theme-anim, :root.p-theme-anim * { transition: background-color .35s ease, border-color .35s ease, color .35s ease !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--f-text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--violet-hi); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.p-skip { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); box-shadow: var(--shadow-2); }
.p-skip:focus { top: 12px; }
.p-noscroll { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.p-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.p-mark { width: 40px; height: auto; }
.p-small { font-size: 13px; }
.p-muted { color: var(--mute); }
.p-strong { font-weight: 600; }
.p-danger { color: var(--danger); }
.p-ok { color: var(--ok); }
.p-mt { margin-top: 12px; }

/* ---------- Boot ---------- */
.p-boot { min-height: 100vh; display: grid; place-items: center; }
.p-boot .p-mark { width: 64px; animation: p-breathe 1.4s var(--ease) infinite alternate; }
@keyframes p-breathe { from { opacity: .35; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ---------- Buttons ---------- */
.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.p-btn:hover { border-color: var(--text-2); }
.p-btn:active { transform: translateY(1px); }
.p-btn[disabled] { opacity: .6; cursor: default; }
.p-btn-primary { background: var(--violet); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(91, 46, 255, .8); }
.p-btn-primary:hover { background: var(--violet-ink); border-color: transparent; }
:root[data-theme="dark"] .p-btn-primary:hover { background: #6A45FF; }
.p-btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.p-btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.p-btn-ghost:hover { background: var(--muted-soft); border-color: transparent; }
.p-btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.p-btn-sm .p-i { width: 16px; height: 16px; }
.p-btn-block { width: 100%; min-height: 48px; font-size: 15px; }
.p-btn.is-busy { position: relative; color: transparent !important; }
.p-btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--mute) transparent var(--mute) transparent; animation: p-spin .7s linear infinite; }
.p-btn-primary.is-busy::after { border-color: #fff transparent #fff transparent; }
.p-iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.p-iconbtn:hover { background: var(--muted-soft); color: var(--text); }
.p-iconbtn-sm { width: 30px; height: 30px; }
.p-iconbtn-sm .p-i { width: 15px; height: 15px; }
.p-link { display: inline-flex; align-items: center; gap: 4px; color: var(--violet-ink); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
.p-link:hover { text-decoration: underline; }
.p-link .p-i { width: 15px; height: 15px; }

/* ---------- Badges & tags ---------- */
.p-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.p-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-badge-ok { background: var(--ok-soft); color: var(--ok); }
.p-badge-warn { background: var(--warn-soft); color: var(--warn); }
.p-badge-danger { background: var(--danger-soft); color: var(--danger); }
.p-badge-info { background: var(--info-soft); color: var(--info); }
.p-badge-progress { background: var(--violet-soft); color: var(--violet-ink); }
.p-badge-muted { background: var(--muted-soft); color: var(--mute); }
.p-tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-pill); background: var(--muted-soft); color: var(--text-2); font-size: 11.5px; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.p-tag-ok { background: var(--ok-soft); color: var(--ok); }
.p-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; margin-left: 8px; border-radius: var(--r-pill); background: var(--muted-soft); color: var(--text-2); font: 700 12px/1 var(--f-text); vertical-align: 2px; }

/* ---------- Staff layout ---------- */
.p-layout { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.p-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 18px 12px; background: var(--ink); color: #D9D4E6; }
.p-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; text-decoration: none; color: #fff; font: 800 19px/1 var(--f-display); font-variation-settings: "wdth" 112; letter-spacing: -.01em; }
.p-brand .p-mark { width: 42px; }
.p-nav { display: flex; flex-direction: column; gap: 2px; }
.p-nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #BDB7CC; text-decoration: none; font-weight: 500; }
.p-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.p-nav-link.is-active { background: rgba(122, 87, 255, .22); color: #fff; box-shadow: inset 3px 0 0 #A48CFF; }
.p-side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 10px; }
.p-mainwrap { min-width: 0; display: flex; flex-direction: column; }
.p-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 12px clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.p-brand-mobile { display: none; padding: 0; }
.p-searchbtn { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--mute); cursor: pointer; text-align: left; }
.p-searchbtn:hover { border-color: var(--line-2); }
.p-searchbtn span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-searchbtn kbd { font: 600 11px/1 var(--f-text); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.p-search-mobile { display: none; }
.p-dd { position: relative; }
.p-newbtn { margin-left: auto; }
.p-userbtn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.p-avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden; background: var(--violet-soft); color: var(--violet-ink); font-weight: 700; font-size: 13px; }
.p-avatar img { width: 100%; height: 100%; object-fit: cover; }
.p-avatar-org { border-radius: 10px; background: var(--ink); color: #fff; }
:root[data-theme="dark"] .p-avatar-org { background: var(--violet-soft); color: var(--violet-ink); }
.p-menu { position: absolute; top: calc(100% + 8px); min-width: 230px; z-index: 60; padding: 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.p-menu-right { right: 0; }
.p-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.p-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); text-decoration: none; text-align: left; font-size: 14px; cursor: pointer; }
.p-menu-item:hover, .p-menu-item:focus-visible { background: var(--muted-soft); outline: none; }
.p-main { width: 100%; max-width: 1360px; padding: clamp(18px, 3vw, 32px) clamp(16px, 3vw, 32px) 64px; outline: none; }
.p-tabbar { display: none; }

/* ---------- Page structure ---------- */
.p-pagehead { margin-bottom: 20px; }
.p-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; color: var(--mute); text-decoration: none; font-size: 14px; font-weight: 500; }
.p-back:hover { color: var(--text); }
.p-back .p-i { width: 16px; height: 16px; }
.p-pagehead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.p-pagehead h1 { font: 800 clamp(26px, 3.2vw, 34px)/1.1 var(--f-display); font-variation-settings: "wdth" 108; letter-spacing: -.02em; }
.p-eyebrow { margin-bottom: 6px; color: var(--mute); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.p-sub { margin-top: 6px; color: var(--text-2); }
.p-pagehead-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-section-title { margin: 26px 0 12px; font: 700 16px/1.2 var(--f-text); }

.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.p-card + .p-card, .p-stats + .p-card, .p-card + .p-stats, .p-card + .p-grid-3, .p-stats + .p-grid-3, .p-pipe + .p-two, .p-card + .p-two, .p-stats + .p-two { margin-top: 18px; }
.p-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.p-card-head h2 { font: 700 15px/1.3 var(--f-text); }
.p-card-actions { display: flex; gap: 6px; }
.p-card-body { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.p-card-body > .p-btn { align-self: flex-start; }
.p-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.p-stack-sm { display: flex; flex-direction: column; gap: 10px; }
.p-two { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.p-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.p-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.p-input, .p-select-inline { height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); min-width: 0; }
.p-toolbar .p-input[type=search] { flex: 1; max-width: 360px; }
.p-select-inline { padding-right: 30px; font-weight: 500; }

/* Key/value */
.p-kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; margin: 0; }
.p-kv dt { color: var(--mute); font-size: 13px; }
.p-kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.p-kv a { color: var(--violet-ink); }

/* Stats */
.p-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 18px; }
.p-stat { display: block; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, transform .15s; }
a.p-stat:hover { border-color: var(--violet-hi); transform: translateY(-1px); }
.p-stat-label { color: var(--mute); font-size: 13px; font-weight: 500; }
.p-stat-value { margin-top: 4px; font: 800 28px/1.1 var(--f-display); font-variation-settings: "wdth" 104; letter-spacing: -.01em; }
.p-stat-hint { margin-top: 4px; color: var(--mute); font-size: 12.5px; }
.p-stats-sm .p-stat { padding: 12px 16px; }
.p-stats-sm .p-stat-value { font-size: 22px; }

/* Attention */
.p-card-attn { border-color: color-mix(in srgb, var(--violet) 30%, var(--line)); }
.p-attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.p-attn-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.p-attn-item:first-child { border-top: 0; padding-top: 2px; }
.p-attn-sev { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.is-high .p-attn-sev { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.is-medium .p-attn-sev { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.is-low .p-attn-sev { background: var(--info); box-shadow: 0 0 0 4px var(--info-soft); }
.p-attn-text { flex: 1; min-width: 0; }
.p-attn-title { font-weight: 600; }
.p-attn-detail { color: var(--mute); font-size: 13px; }

/* Lists */
.p-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.p-list-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; margin: 0 -6px; border-radius: 10px; text-decoration: none; }
a.p-list-row:hover { background: var(--surface-2); }
.p-list-main { flex: 1; min-width: 0; }
.p-list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-list-sub { color: var(--mute); font-size: 13px; }
.p-datechip { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 10px; background: var(--violet-soft); color: var(--violet-ink); line-height: 1; }
.p-datechip b { font: 800 18px/1 var(--f-display); }
.p-datechip span { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.p-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.p-bars a { display: grid; grid-template-columns: 120px 1fr 28px; align-items: center; gap: 10px; text-decoration: none; font-size: 14px; }
.p-bars-track { height: 10px; border-radius: 6px; background: var(--muted-soft); overflow: hidden; }
.p-bars-track span { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.p-bars-n { text-align: right; font-weight: 700; }
.p-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.p-feed-row { display: block; padding: 8px 6px; margin: 0 -6px; border-radius: 10px; text-decoration: none; font-size: 14px; }
a.p-feed-row:hover { background: var(--surface-2); }

/* Rows (client list, team) */
.p-rows { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.p-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); text-decoration: none; }
.p-row:first-child { border-top: 0; }
a.p-row:hover { background: var(--surface-2); }
.p-row-main { flex: 1; min-width: 0; }
.p-row-title { font-weight: 600; }
.p-row-sub { color: var(--mute); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-row-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; color: var(--mute); }
.p-row-chev { color: var(--mute); }
.p-row-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--muted-soft); }

/* Segmented control */
.p-seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--muted-soft); }
.p-seg-btn { border: 0; background: none; padding: 7px 14px; border-radius: var(--r-pill); font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.p-seg-btn.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Lead board ---------- */
.p-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.p-col { display: flex; flex-direction: column; min-height: 200px; background: var(--muted-soft); border-radius: var(--r-md); padding: 10px; scroll-snap-align: start; transition: box-shadow .15s, background .15s; }
.p-col.is-over { background: var(--violet-soft); box-shadow: inset 0 0 0 2px var(--violet-hi); }
.p-col-head { display: flex; align-items: center; gap: 4px; padding: 4px 4px 10px; }
.p-col-head h2 { font: 700 13px/1.2 var(--f-text); }
.p-col-head .p-count { background: var(--surface); }
.p-col-sum { margin-left: auto; color: var(--mute); font-size: 12px; font-weight: 600; }
.p-col-body { display: flex; flex-direction: column; gap: 8px; }
.p-col-empty { color: var(--mute); text-align: center; padding: 16px 0; }
.p-leadcard { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; cursor: grab; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, transform .15s; }
.p-leadcard:hover { border-color: var(--violet-hi); box-shadow: var(--shadow-2); }
.p-leadcard.is-drag { opacity: .5; transform: rotate(1deg); }
.p-leadcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.p-leadcard-title { font-weight: 700; line-height: 1.3; }
.p-leadcard-sub { color: var(--text-2); font-size: 13px; }
.p-leadcard-meta { margin-top: 4px; color: var(--mute); font-size: 13px; }
.p-leadcard-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--text-2); font-size: 12.5px; }
.p-leadcard-due { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.p-leadcard-due .p-i { width: 14px; height: 14px; }

.p-pipe { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 2px; }
.p-pipe-step { flex: 1 0 auto; padding: 8px 12px; border-radius: 8px; background: var(--muted-soft); color: var(--mute); font-size: 12.5px; font-weight: 600; text-align: center; white-space: nowrap; }
.p-pipe-step.is-done { background: var(--violet-soft); color: var(--violet-ink); }
.p-pipe-step.is-current { background: var(--violet); color: #fff; }
.p-pipe-step.is-lost { background: var(--danger-soft); color: var(--danger); }
.p-qual { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-score { font-weight: 700; font-size: 13px; color: var(--text-2); }
.p-summary { white-space: pre-line; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.p-reasons { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }

/* ---------- Projects ---------- */
.p-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.p-projcard { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; box-shadow: var(--shadow-1); transition: border-color .15s, transform .15s, box-shadow .15s; }
.p-projcard:hover { border-color: var(--violet-hi); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.p-projcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.p-projcard-title { font: 700 17px/1.25 var(--f-text); }
.p-projcard-stage { margin-top: 6px; font-weight: 600; font-size: 14px; }
.p-projcard-foot { display: flex; justify-content: space-between; color: var(--mute); font-size: 13px; margin-top: 4px; }
.p-projrow { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.p-projrow:hover { border-color: var(--violet-hi); }
.p-projrow-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.p-projrow-title { font-weight: 700; }
.p-projrow-sub { color: var(--mute); font-size: 13px; }
.p-bar { height: 6px; border-radius: 4px; background: var(--muted-soft); overflow: hidden; }
.p-bar span { display: block; height: 100%; background: var(--grad); border-radius: 4px; transition: width .6s var(--ease); }
.p-details summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14px; padding: 6px 0; }
.p-details[open] summary { margin-bottom: 8px; }
.p-details .p-projrow + .p-projrow { margin-top: 8px; }

/* Stage tracker */
.p-card-track .p-card-body { padding-top: 20px; }
.p-track { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: s; overflow-x: auto; }
.p-step { position: relative; flex: 1 0 96px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 0 4px 4px; }
.p-step::before { content: ""; position: absolute; top: 13px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 2px; background: var(--line-2); }
.p-step:first-child::before { display: none; }
.p-step.is-done::before, .p-step.is-current::before { background: var(--violet); }
.p-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); color: #fff; }
.p-dot .p-i { width: 15px; height: 15px; stroke-width: 2.6; }
.is-done .p-dot { background: var(--violet); border-color: var(--violet); }
.is-current .p-dot { border-color: var(--violet); box-shadow: 0 0 0 5px var(--violet-soft); }
.p-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--violet); animation: p-pulse 1.6s ease-in-out infinite; }
@keyframes p-pulse { 50% { transform: scale(.65); opacity: .6; } }
.p-step-label { font-size: 12.5px; font-weight: 600; color: var(--mute); line-height: 1.25; }
.is-done .p-step-label { color: var(--text-2); }
.is-current .p-step-label { color: var(--text); font-weight: 700; }
.p-step[role=button] { cursor: pointer; border-radius: 10px; }
.p-step[role=button]:hover .p-step-label { color: var(--violet-ink); }
.p-track-foot { display: flex; justify-content: space-between; align-items: center; color: var(--mute); font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.p-track-v { flex-direction: column; gap: 0; overflow: visible; }
.p-track-v .p-step { flex: none; flex-direction: row; align-items: center; text-align: left; gap: 14px; padding: 0 0 22px; }
.p-track-v .p-step::before { top: auto; bottom: 100%; left: 13px; right: auto; width: 2px; height: 22px; }
.p-track-v .p-step:last-child { padding-bottom: 0; }
.p-track-v .p-step-label { font-size: 15px; }

/* Actions (requests & to-dos) */
.p-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.p-action { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.p-action:first-child { border-top: 0; padding-top: 0; }
.p-action input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--violet); flex: none; }
.p-action-title { font-weight: 600; }
.p-action-meta { color: var(--mute); font-size: 13px; }
.p-action.is-done .p-action-title { text-decoration: line-through; color: var(--mute); font-weight: 500; }
.p-action.is-overdue .p-action-meta { color: var(--danger); }

/* Notes */
.p-private { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 12.5px; }
.p-private .p-i { width: 15px; height: 15px; }
.p-composer { display: flex; flex-direction: column; gap: 8px; }
.p-composer textarea { width: 100%; resize: vertical; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.p-composer-row { display: flex; gap: 8px; justify-content: flex-end; }
.p-composer-row select { height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 0 8px; }
.p-notes { display: flex; flex-direction: column; gap: 10px; }
.p-note { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.p-note.is-pinned { border-color: var(--violet-hi); background: var(--violet-soft); }
.p-note-meta { display: flex; align-items: center; gap: 8px; color: var(--mute); font-size: 12.5px; }
.p-note-kind { font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.p-note-tools { margin-left: auto; display: flex; opacity: .55; }
.p-note:hover .p-note-tools, .p-note-tools:focus-within { opacity: 1; }
.p-note-body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Contacts */
.p-contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.p-contact { display: flex; gap: 12px; }
.p-contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.p-contact-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.p-contactlinks { display: flex; gap: 6px; flex-wrap: wrap; }

/* Timeline */
.p-timeline { list-style: none; margin: 0; padding: 0; }
.p-timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.p-timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.p-timeline li:last-child::before { display: none; }
.p-tl-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--violet); background: var(--surface); flex: none; }
.p-tl-text { font-size: 14px; }
.p-tl-meta { color: var(--mute); font-size: 12.5px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.p-tl-vis { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--violet-ink); font-weight: 600; }
.p-tl-vis .p-i { width: 13px; height: 13px; }

/* Settings */
.p-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.p-checks li { display: flex; gap: 8px; align-items: center; }
.p-checks .is-pass .p-i { color: var(--ok); }
.p-checks .is-fail { color: var(--danger); font-weight: 600; }
.p-wf { display: flex; flex-direction: column; gap: 12px; }
.p-wf-row .p-small { color: var(--text-2); }

/* ---------- Forms ---------- */
.p-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.p-span2 { grid-column: 1 / -1; }
.p-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.p-field label, .p-field legend, .p-field > span { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0; }
.p-field input, .p-field select, .p-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 15px; }
.p-field textarea { resize: vertical; }
.p-field input:focus, .p-field select:focus, .p-field textarea:focus, .p-input:focus, .p-composer textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.p-req { color: var(--danger); }
.p-help { color: var(--mute); font-size: 12.5px; }
.p-form-error { color: var(--danger); font-size: 14px; font-weight: 600; margin-top: 10px; }
.p-form-error:empty { display: none; }
.p-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.p-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.p-check input { width: 18px; height: 18px; accent-color: var(--violet); }
.p-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.p-chip input { position: absolute; opacity: 0; pointer-events: none; }
.p-chip span { display: inline-block; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.p-chip input:checked + span { background: var(--violet-soft); border-color: var(--violet); color: var(--violet-ink); font-weight: 600; }
.p-chip input:focus-visible + span { outline: 3px solid var(--violet-hi); outline-offset: 2px; }

/* ---------- Overlay / modal / toast ---------- */
.p-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: start center; padding: 8vh 16px 16px; background: rgba(12, 10, 20, .45); backdrop-filter: blur(3px); opacity: 0; transition: opacity .16s; overflow-y: auto; }
.p-overlay.is-on { opacity: 1; }
.p-modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); transform: translateY(8px) scale(.98); transition: transform .2s var(--ease); outline: none; }
.p-overlay.is-on .p-modal { transform: none; }
.p-modal-wide { max-width: 720px; }
.p-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 22px; }
.p-modal-head h2 { font: 700 18px/1.3 var(--f-text); }
.p-modal-body { padding: 12px 22px 22px; }
.p-modal-body > div > p.p-muted { margin-bottom: 14px; }
.p-toast { position: fixed; left: 50%; bottom: 24px; z-index: 400; transform: translate(-50%, 20px); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.p-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.p-toast.is-error { background: var(--danger); }
.p-loading { display: flex; align-items: center; gap: 10px; color: var(--mute); padding: 40px 0; }
.p-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--violet); animation: p-spin .7s linear infinite; }
@keyframes p-spin { to { transform: rotate(360deg); } }
.p-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px; color: var(--text-2); }
.p-empty h3 { font: 700 16px/1.3 var(--f-text); color: var(--text); }
.p-empty p { max-width: 420px; font-size: 14px; }
.p-empty .p-btn { margin-top: 8px; }
.p-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--violet-soft); color: var(--violet-ink); }

/* Search */
.p-search-input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px; font-size: 17px; background: var(--surface-2); }
.p-search-input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.p-search-results { margin-top: 14px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.p-search-group { display: flex; flex-direction: column; gap: 2px; }
.p-search-hit { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t b" "s b"; gap: 0 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; }
.p-search-hit:hover, .p-search-hit.is-active { background: var(--violet-soft); }
.p-search-title { grid-area: t; font-weight: 600; }
.p-search-sub { grid-area: s; color: var(--mute); font-size: 13px; }
.p-search-hit .p-badge { grid-area: b; align-self: center; }

/* ---------- Sign-in ---------- */
.p-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 80% -10%, rgba(122, 87, 255, .35), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(182, 92, 224, .25), transparent 60%), var(--ink); color: var(--text); }
.p-auth-card { width: 100%; max-width: 420px; padding: 32px 28px; border-radius: 22px; background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.p-auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; text-decoration: none; font: 800 18px/1 var(--f-display); font-variation-settings: "wdth" 112; }
.p-auth-card h1 { font: 800 28px/1.1 var(--f-display); font-variation-settings: "wdth" 108; letter-spacing: -.02em; }
.p-auth-card > .p-muted { margin: 8px 0 20px; }
.p-auth .p-form { display: flex; flex-direction: column; gap: 14px; }
.p-auth-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.p-auth-row a, .p-auth-foot a { color: var(--violet-ink); font-weight: 600; }
.p-auth-foot { margin-top: 22px; color: var(--mute); font-size: 13.5px; text-align: center; }
.p-alert { padding: 12px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.p-alert-error { background: var(--danger-soft); color: var(--danger); }

/* ==========================================================================
   Client portal
   ========================================================================== */
.p-client { background: var(--bg); }
.c-layout { min-height: 100vh; display: flex; flex-direction: column; }
.c-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); background: var(--ink); color: #fff; }
.c-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 16px/1 var(--f-display); font-variation-settings: "wdth" 110; }
.c-brand .p-mark { width: 38px; }
.c-top-right { display: flex; align-items: center; gap: 8px; }
.c-user { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.c-user .p-avatar { width: 32px; height: 32px; }
.c-top .p-btn-ghost { color: #D9D4E6; }
.c-top .p-btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.c-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 56px; outline: none; flex: 1; }
.c-hero { padding: clamp(28px, 5vw, 48px) 0 22px; }
.c-hero h1 { font: 800 clamp(30px, 5vw, 46px)/1.05 var(--f-display); font-variation-settings: "wdth" 110; letter-spacing: -.025em; }
.c-eyebrow { color: var(--violet-ink); font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 8px; }
.c-lede { margin-top: 10px; font-size: 17px; color: var(--text-2); }
.c-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; color: var(--mute); font-size: 14px; }
.c-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 26px); box-shadow: var(--shadow-1); min-width: 0; }
.c-card h2 { display: flex; align-items: center; gap: 8px; font: 700 17px/1.3 var(--f-text); margin-bottom: 14px; }
.c-card + .c-card, .c-card + .c-section, .c-projects + .c-cols, .c-card + .c-cols, .c-cols + .c-card, .c-hero + .c-cols { margin-top: 20px; }
.c-attn { border: 0; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.c-attn h2 { color: var(--violet-ink); }
.c-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.c-action { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.c-action-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--violet-soft); color: var(--violet-ink); flex: none; }
.c-action-text { flex: 1; min-width: 0; }
.c-action-title { font-weight: 700; font-size: 16px; }
.c-action-detail { color: var(--text-2); font-size: 14px; margin-top: 2px; white-space: pre-line; }
.c-action-due { color: var(--mute); font-size: 13px; margin-top: 2px; }
.c-action.is-overdue .c-action-due { color: var(--danger); font-weight: 600; }
.c-action-btn .p-btn { min-height: 44px; }
.c-section { margin: 28px 0 12px; font: 700 20px/1.2 var(--f-text); }
.c-projects { display: grid; gap: 16px; }
.c-project { display: flex; flex-direction: column; gap: 10px; padding: clamp(18px, 3vw, 26px); border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, transform .15s; }
.c-project:hover { border-color: var(--violet-hi); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.c-project-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.c-project-top .c-eyebrow { margin: 0; }
.c-project h3 { font: 800 22px/1.2 var(--f-display); font-variation-settings: "wdth" 106; letter-spacing: -.01em; }
.c-status { color: var(--text-2); font-weight: 500; margin-bottom: 10px; }
.c-project-foot { display: flex; justify-content: space-between; gap: 10px; color: var(--mute); font-size: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.c-project-open { display: inline-flex; align-items: center; gap: 4px; align-self: flex-end; color: var(--violet-ink); font-weight: 700; font-size: 14px; }
.c-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.c-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.c-contact p { color: var(--text-2); }
.c-contact-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.c-pastlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.c-pastlist a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.c-pastlist a:hover { border-color: var(--violet-hi); }
.c-again { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--violet-soft); }
.c-strong { font-weight: 700; }
.c-progress-num { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; color: var(--mute); }
.c-progress-num b { font: 800 34px/1 var(--f-display); color: var(--text); }
.c-pre { white-space: pre-wrap; color: var(--text-2); }
.c-donelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.c-donelist li { display: flex; gap: 8px; align-items: center; }
.c-donelist .p-i { color: var(--ok); }
.c-foot { padding: 24px 16px 32px; text-align: center; color: var(--mute); font-size: 13px; }
.c-foot a { color: inherit; }
.c-main > .p-back { margin-top: 20px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	.p-grid-3 { grid-template-columns: 1fr 1fr; }
	.p-grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
	.p-layout { grid-template-columns: 1fr; }
	.p-side { display: none; }
	.p-brand-mobile { display: flex; }
	.p-brand-mobile .p-mark { width: 36px; }
	.p-searchbtn { display: none; }
	.p-search-mobile { display: inline-grid; margin-left: auto; }
	.p-newbtn { margin-left: 0; }
	.p-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
	.p-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px -12px rgba(0, 0, 0, .25); }
	.p-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; color: var(--mute); text-decoration: none; font-size: 11.5px; font-weight: 600; }
	.p-tab .p-i { width: 22px; height: 22px; }
	.p-tab.is-active { color: var(--violet-ink); background: var(--violet-soft); }
	.p-two, .c-cols { grid-template-columns: 1fr; }
	.p-toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
	.p-board { grid-auto-columns: minmax(80vw, 1fr); }
}
@media (max-width: 640px) {
	body { font-size: 15px; }
	.p-grid-3 { grid-template-columns: 1fr; }
	.p-form-grid { grid-template-columns: 1fr; }
	.p-pagehead-row { align-items: flex-start; }
	.p-pagehead-actions { width: 100%; }
	.p-pagehead-actions .p-btn-primary { flex: 1; }
	.p-newbtn span { display: none; }
	.p-newbtn { width: 40px; padding: 0; }
	.p-stats { grid-template-columns: 1fr 1fr; }
	.p-stat-value { font-size: 24px; }
	.p-attn-item { flex-wrap: wrap; }
	.p-attn-item .p-btn { margin-left: 24px; }
	.p-row { padding: 12px 14px; }
	.p-row-meta .p-small { display: none; }
	.p-kv { grid-template-columns: 1fr; gap: 2px; }
	.p-kv dd { margin-bottom: 8px; }
	.p-bars a { grid-template-columns: 96px 1fr 24px; }
	.p-overlay { padding: 0; place-items: end stretch; }
	.p-modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; }
	.p-form-actions .p-btn { flex: 1; min-height: 48px; }
	.p-card-head { padding: 14px 16px 0; }
	.p-card-body { padding: 12px 16px 16px; }
	.c-action { flex-wrap: wrap; }
	.c-action-btn { width: 100%; }
	.c-action-btn .p-btn { width: 100%; min-height: 48px; }
	.c-hide-sm, .c-user-name { display: none; }
	.c-project .p-track { margin: 0 -6px; }
	.c-contact-btns .p-btn { flex: 1; }
	.c-again .p-btn { width: 100%; }
}
.p-stack > .p-card + .p-card, .p-stack > .p-stack + .p-card, .c-stack > .c-card + .c-card { margin-top: 0; }
.p-dangerzone { display: flex; justify-content: flex-end; }
.p-dangerzone .p-btn { color: var(--danger); }
.c-preview { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 10px 16px; background: #FFE9A8; color: #3A2A00; font-size: 14px; }
.c-preview .p-i { width: 18px; height: 18px; }
.c-preview + .c-layout .c-top { top: 52px; }

/* ==========================================================================
   Agreements & signing
   ========================================================================== */
.p-docframe { max-height: 72vh; overflow-y: auto; padding: 4px 6px 4px 0; }
.p-doc { font: 15px/1.65 Georgia, "Times New Roman", serif; color: var(--text); }
.p-doc h1 { font: 800 24px/1.2 var(--f-display); font-variation-settings: "wdth" 104; margin: 0 0 14px; }
.p-doc h2 { font: 700 18px/1.3 var(--f-text); margin: 28px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.p-doc h3 { font: 700 15px/1.4 var(--f-text); margin: 18px 0 6px; }
.p-doc p { margin: 0 0 10px; }
.p-doc ol, .p-doc ul { padding-left: 22px; margin: 0 0 10px; }
.p-doc table.pd { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 16px; }
.p-doc table.pd th { width: 32%; text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); font: 700 13px/1.4 var(--f-text); color: var(--text-2); }
.p-doc table.pd td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.p-doc .ack { margin-top: 20px; }
.c-secure { display: inline-flex; align-items: center; gap: 6px; color: #C9C4D6; font-size: 13px; font-weight: 600; }
.c-secure .p-i { width: 16px; height: 16px; }
.s-doc { padding: clamp(20px, 4vw, 44px); }
.s-sigrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.s-sig { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.s-sig-for { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.s-sig-mark { font: 26px/1.2 "Homemade Apple", "Brush Script MT", cursive; color: var(--violet-ink); border-bottom: 1px solid var(--text); padding-bottom: 4px; margin-bottom: 6px; overflow-wrap: anywhere; }
.s-sig-meta { font-size: 13px; color: var(--text-2); }
.s-fp { margin-top: 16px; font-size: 11.5px; color: var(--mute); word-break: break-all; }
.s-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.s-panel { border: 2px solid var(--violet); display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 90px; }
.s-panel h2 { margin: 0; }
.s-check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--text-2); cursor: pointer; }
.s-check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--violet); }
.s-sigbox { border: 1px dashed var(--line-2); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.s-sigbox-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.s-mode { display: flex; flex-direction: column; gap: 6px; }
.s-mode .p-link { align-self: flex-end; }
.s-typed { min-height: 90px; display: flex; align-items: center; padding: 8px 12px; font: 34px/1.2 "Homemade Apple", "Brush Script MT", cursive; color: #1b1464; background: #fff; border-radius: 10px; overflow-wrap: anywhere; }
.s-pad { width: 100%; height: 170px; background: #fff; border-radius: 10px; touch-action: none; cursor: crosshair; display: block; }
.s-fine { font-size: 12.5px; color: var(--mute); }
.s-decline { align-self: center; color: var(--mute); font-weight: 500; }
.s-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.s-done h2 { justify-content: center; margin: 0; }
.s-done-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.s-done-icon .p-i { width: 28px; height: 28px; stroke-width: 2.6; }
.s-verify { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.s-codearea { display: flex; flex-direction: column; gap: 10px; }
.s-code { height: 60px; text-align: center; font: 700 28px/1 var(--f-text); letter-spacing: .4em; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.s-code:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.s-float { display: none; }
.c-agreements .c-pastlist .p-btn { pointer-events: none; }
.p-signpage .c-main { max-width: 900px; }
@media (max-width: 640px) {
	.s-sigrow { grid-template-columns: 1fr; }
	.s-float { display: inline-flex; position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: var(--shadow-2); }
	.s-typed { font-size: 28px; }
}

/* Theme picker */
.p-menu-label { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.p-menu-item[aria-checked="true"] { color: var(--violet-ink); font-weight: 700; }
.p-menu-item .p-menu-check { margin-left: auto; }
.c-theme { color: #D9D4E6; }
.c-theme:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.p-theme-seg { display: flex; gap: 4px; padding: 4px 6px 8px; }
.p-theme-seg button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.p-theme-seg button[aria-checked="true"] { border-color: var(--violet); color: var(--violet-ink); background: var(--violet-soft); }
.p-theme-seg .p-i { width: 18px; height: 18px; }
.p-theme-note { padding: 0 12px 8px; font-size: 12px; color: var(--mute); }

/* Sign in with Google */
.p-google { gap: 12px; background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 600; }
.p-google:hover { background: #f8f9fa; border-color: #c6c9ce; }
.p-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--mute); font-size: 13px; }
.p-or::before, .p-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
