.p9c-wrap {
	max-width: 1240px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #292524;
}

/* ── Logged-out splash — mirrors parcl9-workspace's .p9w-guest-gate pattern.
   The CTA's color/background/text-decoration MUST stay !important: the
   WordPress theme's global `a` link color rule has the same specificity as
   a plain class selector, and (being later/equal in the cascade) silently
   wins without it — which is exactly why the old plain-text button was
   invisible (brown text on a brown background). ── */
.p9c-gate {
	padding: 48px 20px;
	background: #faf5ec;
	border: 1px solid #eae6e1;
	border-radius: 10px;
	box-sizing: border-box;
}
.p9c-gate-inner { max-width: 520px; margin: 0 auto; text-align: center; }
.p9c-gate-icon {
	width: 52px; height: 52px; margin: 0 auto 16px;
	background: #fff; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.p9c-gate-eyebrow {
	font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: #9a6f2e; margin: 0 0 8px;
}
.p9c-gate-title { font-size: clamp(20px, 4vw, 26px); font-weight: 700; color: #1a1814; line-height: 1.35; margin: 0 0 14px; }
.p9c-gate-body { font-size: 14px; color: #6b6458; line-height: 1.65; margin: 0 auto 20px; max-width: 420px; }
.p9c-gate-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; }
.p9c-gate-pill {
	display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #6b6458;
	background: #fff; border: 1px solid #eae6e1; border-radius: 20px; padding: 4px 10px;
}
.p9c-gate-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.p9c-gate-cta {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 9px 22px;
	background: #9a6f2e !important;
	color: #fff !important;
	border: 1px solid #9a6f2e !important;
	border-radius: 6px;
	font-size: 13px; font-weight: 600;
	cursor: pointer;
	text-decoration: none !important;
	transition: opacity .12s;
}
.p9c-gate-cta:hover, .p9c-gate-cta:visited, .p9c-gate-cta:focus { opacity: .88; color: #fff !important; text-decoration: none !important; }
.p9c-gate-login { font-size: 13px; color: #6b6458; }
.p9c-gate-login a { color: #9a6f2e !important; text-decoration: underline; }

.p9c-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.p9c-title { font-size: 22px; font-weight: 700; margin: 0; }

.p9c-input {
	font-family: inherit;
	font-size: 14px;
	padding: 8px 10px;
	border: 1px solid #d6d3d1;
	border-radius: 6px;
	background: #fff;
	color: #292524;
	width: 100%;
	box-sizing: border-box;
}
.p9c-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23786b5c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 14px;
	padding-right: 28px;
}

.p9c-btn {
	font-family: inherit;
	font-size: 13.5px;
	padding: 8px 14px;
	border-radius: 6px;
	border: 1px solid #d6d3d1;
	background: #fff;
	color: #292524;
	cursor: pointer;
}
.p9c-btn:hover { background: #f5f3f1; }
.p9c-btn:disabled { cursor: default; opacity: .6; }
.p9c-btn-primary { background: #9a6f2e; border-color: #9a6f2e; color: #fff; }
.p9c-btn-primary:hover { background: #8a6229; }
.p9c-btn-primary:disabled { background: #9a6f2e; border-color: #9a6f2e; opacity: .85; }
.p9c-btn-danger { color: #b91c1c; border-color: #f3c9c9; }
.p9c-btn-danger:hover { background: #fef2f2; }

.p9c-btn-loading { cursor: default; }
.p9c-spinner {
	display: inline-block;
	width: 11px;
	height: 11px;
	margin-right: 7px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	vertical-align: middle;
	animation: p9c-spin .7s linear infinite;
}
/* Used standalone (no adjoining label text) on light-background icon buttons, e.g. the per-entry performance-history delete button — the default white spinner above is tuned for sitting inside the brown Save button and is invisible on white. */
.p9c-spinner--dark {
	margin-right: 0;
	border-color: rgba(0, 0, 0, .15);
	border-top-color: #57534e;
}
@keyframes p9c-spin { to { transform: rotate(360deg); } }

.p9c-icon-btn {
	border: none; background: none; cursor: pointer; font-size: 16px; line-height: 1;
	color: #9c9288; padding: 4px 6px; border-radius: 6px;
}
.p9c-icon-btn:hover { background: #f5f3f1; color: #292524; }

.p9c-coi-banner {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #92400e;
	font-size: 13px;
	padding: 8px 12px;
	border-radius: 6px;
	margin-bottom: 12px;
}

.p9c-empty { color: #9c9288; font-size: 13.5px; padding: 32px 16px; text-align: center; }

/* ── Three-pane layout: Filters | scrollable contact List | Detail/edit panel ── */
.p9c-main {
	display: flex;
	align-items: stretch;
	gap: 0;
	border: 1px solid #eae6e1;
	border-radius: 8px;
	overflow: hidden;
	min-height: 560px;
	max-height: 74vh;
}

/* ── Filters pane ─────────────────────────────────────────────────────────── */
.p9c-filter-pane {
	flex: 0 0 210px;
	max-width: 210px;
	border-right: 1px solid #eae6e1;
	overflow-y: auto;
	background: #faf9f7;
	padding: 14px 12px;
	box-sizing: border-box;
}
.p9c-filter-search { margin-bottom: 16px; }

.p9c-filter-group { margin-bottom: 18px; }
.p9c-filter-group-label {
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
	color: #9c9288; margin-bottom: 6px; padding: 0 4px;
}
.p9c-filter-chip-list { display: flex; flex-direction: column; gap: 1px; }

.p9c-filter-chip {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	font-family: inherit; font-size: 13px; text-align: left;
	padding: 6px 8px; border-radius: 6px; border: none; background: none;
	color: #44403c; cursor: pointer; width: 100%;
}
.p9c-filter-chip:hover { background: #f0ede9; }
.p9c-filter-chip--active { background: #9a6f2e; color: #fff; font-weight: 600; }
.p9c-filter-chip--active:hover { background: #8a6229; }
.p9c-filter-count {
	font-size: 11px; color: #9c9288; background: #eae6e1; border-radius: 10px;
	padding: 1px 7px; min-width: 20px; text-align: center;
}
.p9c-filter-chip--active .p9c-filter-count { background: rgba(255,255,255,.25); color: #fff; }
.p9c-filter-chip--zero { color: #c4bdb2; }
.p9c-filter-chip--zero .p9c-filter-count { color: #c4bdb2; }

/* ── Contact list pane ────────────────────────────────────────────────────── */
.p9c-list-pane {
	flex: 0 0 320px;
	max-width: 320px;
	border-right: 1px solid #eae6e1;
	overflow-y: auto;
	background: #fff;
	display: flex;
	flex-direction: column;
}

.p9c-list-header {
	flex-shrink: 0;
	border-bottom: 1px solid #f0ede9;
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 1;
}
.p9c-list-count { font-size: 12px; color: #9c9288; padding: 10px 14px; }

.p9c-bulk-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #fdf6ec;
	border-top: 1px solid #f0e2c8;
	font-size: 12.5px;
}
/* A plain class selector has the same specificity as the browser's built-in
   [hidden]{display:none} rule, and normal author rules always beat normal
   user-agent rules — so `display: flex` above wins even while `hidden` is
   set unless we add a higher-specificity override here. */
.p9c-bulk-bar[hidden] { display: none; }
.p9c-bulk-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.p9c-bulk-check input { width: 15px; height: 15px; cursor: pointer; }
.p9c-bulk-spacer { flex: 1; }
.p9c-bulk-bar .p9c-btn { padding: 5px 10px; font-size: 12px; }

.p9c-list { flex: 1; }

.p9c-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid #f0ede9;
	cursor: pointer;
	transition: background .1s;
}
.p9c-row:last-child { border-bottom: none; }
.p9c-row:hover { background: #faf9f7; }
.p9c-row--active { background: #fdf6ec; box-shadow: inset 3px 0 0 #9a6f2e; }
.p9c-row--active:hover { background: #fbf1e2; }

.p9c-row-check {
	width: 16px; height: 16px; flex-shrink: 0; cursor: pointer;
	/* Only visible on hover/checked so the list doesn't look cluttered when nobody's bulk-selecting */
	opacity: 0;
}
.p9c-row:hover .p9c-row-check,
.p9c-row-check:checked {
	opacity: 1;
}

.p9c-row-main { flex: 1; min-width: 0; }
.p9c-row-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p9c-row-sub { font-size: 12.5px; color: #78716c; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p9c-row-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; max-width: 40%; }

.p9c-pill {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 20px;
	background: #f3f0ea;
	color: #6b5a3e;
	white-space: nowrap;
}
.p9c-pill-trade { background: #eef2f6; color: #3f5772; }

.p9c-coi-flag {
	font-size: 10.5px;
	font-weight: 600;
	color: #b45309;
	margin-left: 8px;
}

/* ── Detail/edit pane — replaces the old modal, no overlay involved ─────────── */
.p9c-detail-pane {
	flex: 1;
	min-width: 0;
	overflow-y: auto;
	background: #fff;
	display: flex;
	flex-direction: column;
}

.p9c-detail-empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #9c9288;
	font-size: 13.5px;
	padding: 40px 20px;
}
.p9c-detail-empty-icon { font-size: 34px; margin-bottom: 10px; opacity: .6; }
.p9c-detail-empty[hidden] { display: none; }

.p9c-detail-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.p9c-detail-form[hidden] { display: none; }
.p9c-detail-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.p9c-detail-view[hidden] { display: none; }
.p9c-detail-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.p9c-detail-title { font-size: 16px; font-weight: 700; }
.p9c-detail-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.p9c-detail-actions {
	display: flex; align-items: center; gap: 8px; padding: 14px 20px;
	border-top: 1px solid #eee; flex-shrink: 0;
}

/* Read-only view header: [Edit][X] pinned left, contact name pinned right
   (via the shared .p9c-detail-header's justify-content: space-between). */
.p9c-view-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.p9c-view-header-name { font-size: 15px; font-weight: 700; color: #292524; margin-right: 16px; }
.p9c-view-header-actions #p9c-view-close-btn { border: 1.5px solid #d6d3d1; }
.p9c-view-header-actions #p9c-view-close-btn:hover { border-color: #b5b0a9; }

.p9c-view-row { margin-bottom: 16px; }
.p9c-view-row-label { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.p9c-view-row-value { font-size: 14px; color: #292524; line-height: 1.5; }
.p9c-view-row-value a { color: #9a6f2e; }
.p9c-view-row-value .p9c-pill { margin-right: 4px; }

.p9c-label { display: block; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 6px; }
.p9c-label:first-child { margin-top: 0; }
.p9c-label-hint { text-transform: none; font-weight: 400; letter-spacing: 0; color: #9c9288; }

.p9c-form-row { display: flex; gap: 10px; }
.p9c-form-row .p9c-input { margin-bottom: 0; }
/* The rating/project/date row and the notes textarea right below it in the
   "+ Log entry" mini-form otherwise sit flush against each other — every
   other stacked field in this panel gets its gap from a <label> in between,
   but this pair has no label, so it needs its own explicit margin. */
#p9c-performance-add .p9c-form-row { margin-bottom: 8px; }
#p9c-performance-add textarea.p9c-input { margin-bottom: 8px; }

.p9c-tag-group { display: flex; flex-wrap: wrap; gap: 6px; }
.p9c-tag-chip {
	font-family: inherit; font-size: 12px; padding: 5px 11px; border-radius: 20px;
	border: 1.5px solid #d6d3d1; background: #f9fafb; color: #374151; cursor: pointer;
}
.p9c-tag-chip--on { background: #9a6f2e; border-color: #9a6f2e; color: #fff; }

.p9c-section-head {
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
	color: #9a6f2e; margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid #f0ede9;
}

.p9c-coi-current { font-size: 12.5px; margin-bottom: 6px; }
.p9c-coi-current a { color: #9a6f2e; }

.p9c-perf-entry { padding: 8px 0; border-bottom: 1px solid #f4f2ef; font-size: 13px; }
.p9c-perf-entry:last-child { border-bottom: none; }
.p9c-perf-top { display: flex; justify-content: space-between; align-items: center; }
.p9c-perf-delete-btn { font-size: 12px; padding: 2px 5px; opacity: .5; }
.p9c-perf-delete-btn:hover { opacity: 1; color: #b91c1c; }
.p9c-perf-delete-btn:disabled { opacity: 1; cursor: default; }
.p9c-perf-delete-btn:disabled:hover { background: none; }
#p9c-perf-add-btn:disabled { opacity: 1; }
.p9c-perf-stars { color: #d97706; letter-spacing: 1px; }
.p9c-perf-date { font-size: 11.5px; color: #9c9288; }
.p9c-perf-project { font-weight: 600; margin-top: 2px; }
.p9c-perf-notes { color: #57534e; margin-top: 2px; }

@media (max-width: 980px) {
	.p9c-main { flex-direction: column; max-height: none; }
	.p9c-filter-pane, .p9c-list-pane { flex: 0 0 auto; max-width: none; width: 100%; }
	.p9c-filter-pane { max-height: 220px; border-right: none; border-bottom: 1px solid #eae6e1; }
	.p9c-list-pane { max-height: 340px; border-right: none; border-bottom: 1px solid #eae6e1; }
	.p9c-detail-pane { max-height: none; }
}
