/**
 * The client portal's own skin. It shares the token sheet with the
 * staff console so a firm's colours carry across, but nothing else:
 * this loads on a public page, so it stays small, self-contained, and
 * scoped under .vos-cp to keep a theme's styles and ours apart.
 */

.vos-cp {
	--cp-gap: 16px;
	max-width: 860px;
	margin: 0 auto;
	color: var(--vos-ink, #16211E);
	font-size: 15px;
	line-height: 1.55;
}

.vos-cp * { box-sizing: border-box; }

@keyframes vos-cp-rise {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

@keyframes vos-cp-pop {
	from { opacity: 0; transform: translateY(6px) scale(.98); }
	to { opacity: 1; transform: none; }
}

.vos-cp-in { display: flex; flex-direction: column; gap: var(--cp-gap); }

.vos-cp-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	animation: vos-cp-rise 380ms ease-out both;
}

.vos-cp-title { margin: 0; font-size: 22px; line-height: 1.2; }
.vos-cp-lead { margin: 2px 0 0; color: var(--vos-muted, #6E7C77); }
.vos-cp-fine { margin: 8px 0 0; font-size: 12px; color: var(--vos-muted, #6E7C77); }

.vos-cp-badge {
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--vos-accent-soft, #E2F1EC);
	color: var(--vos-accent-ink, #0F6E5C);
	font-size: 13px;
	font-weight: 600;
}

.vos-cp-badge.is-clear {
	background: var(--vos-surface-muted, #F1EFEA);
	color: var(--vos-muted, #6E7C77);
	font-weight: 500;
}

/* Cards ---------------------------------------------------------- */

.vos-cp-pending {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (min-width: 620px) {
	.vos-cp-pending { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.vos-cp-card {
	border: 1px solid var(--vos-border, #E3E0D9);
	border-radius: 12px;
	background: var(--vos-card, #fff);
	padding: 14px 16px;
	animation: vos-cp-rise 420ms ease-out both;
}

.vos-cp-card-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--vos-muted, #6E7C77);
}

.vos-cp-count {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--vos-accent-ink, #0F6E5C);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.vos-cp-item {
	margin: 0;
	padding: 6px 0;
	border-bottom: 1px solid var(--vos-border, #E3E0D9);
	font-size: 14px;
}

.vos-cp-item:last-child { border-bottom: 0; }
.vos-cp-item.is-late { color: var(--vos-crit, #C4553D); font-weight: 600; }
.vos-cp-empty { margin: 0; color: var(--vos-muted, #6E7C77); font-size: 14px; }

/* The message board: a bulletin of topics, not one running chat ----
   Threads are pinned cards. Opening one unfolds its posts in place, so
   the reply happens where the conversation is rather than on another
   screen. */

.vos-cp-board { animation-delay: 180ms; }

.vos-cp-board-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.vos-cp-new {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	margin-bottom: 12px;
	border: 1px solid var(--vos-accent-ink, #0F6E5C);
	border-radius: 10px;
	background: var(--vos-accent-soft, #E2F1EC);
	animation: vos-cp-pop 200ms ease-out both;
}

.vos-cp-new .vos-cp-button { align-self: flex-start; }

.vos-cp-thread-card {
	border: 1px solid var(--vos-border, #E3E0D9);
	border-radius: 10px;
	background: var(--vos-surface, #fff);
	margin-bottom: 8px;
	overflow: hidden;
	animation: vos-cp-pop 240ms ease-out both;
	transition: border-color 140ms ease, box-shadow 140ms ease;
}

.vos-cp-thread-card:hover { border-color: var(--vos-accent-ink, #0F6E5C); }

.vos-cp-thread-card.is-open {
	border-color: var(--vos-accent-ink, #0F6E5C);
	box-shadow: 0 2px 10px rgba(15, 110, 92, 0.10);
}

.vos-cp-thread-head {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 10px;
	width: 100%;
	padding: 12px 14px;
	border: 0;
	background: transparent;
	font: inherit;
	text-align: left;
	color: inherit;
	cursor: pointer;
}

.vos-cp-thread-subject {
	font-weight: 600;
	color: var(--vos-ink, #16211E);
	overflow-wrap: anywhere;
}

.vos-cp-thread-meta {
	grid-column: 1 / -1;
	font-size: 12px;
	color: var(--vos-muted, #6E7C77);
}

.vos-cp-tagline {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--vos-muted, #6E7C77);
}

/* The fold. A closed thread is not rendered at all, so this animates
   the arrival rather than a height nobody can know in advance. */
.vos-cp-thread-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0 14px 14px;
	animation: vos-cp-unfold 220ms ease-out both;
}

@keyframes vos-cp-unfold {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

.vos-cp-post {
	padding: 10px 12px;
	border-radius: 10px;
	border-left: 3px solid transparent;
	background: var(--vos-surface-muted, #F1EFEA);
	animation: vos-cp-pop 220ms ease-out both;
}

/* Whose post it is reads from the rail, not from which side it sits on
   -- a bulletin reads down the page in one column. */
.vos-cp-post.is-in { border-left-color: var(--vos-accent-ink, #0F6E5C); }
.vos-cp-post.is-out {
	border-left-color: var(--vos-border, #E3E0D9);
	background: var(--vos-surface, #fff);
	border: 1px solid var(--vos-border, #E3E0D9);
	border-left: 3px solid var(--vos-muted, #6E7C77);
}

.vos-cp-post-meta {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0 0 4px;
	font-size: 11px;
	color: var(--vos-muted, #6E7C77);
}

.vos-cp-post-who { font-weight: 600; color: var(--vos-ink-soft, #33413D); }

.vos-cp-post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.vos-cp-compose { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }

.vos-cp-input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--vos-border, #E3E0D9);
	border-radius: 10px;
	background: var(--vos-card, #fff);
	color: var(--vos-ink, #16211E);
	font: inherit;
	transition: border-color 140ms ease, box-shadow 140ms ease;
}

.vos-cp-input:focus {
	outline: none;
	border-color: var(--vos-accent-ink, #0F6E5C);
	box-shadow: 0 0 0 3px var(--vos-accent-soft, #E2F1EC);
}

.vos-cp-textarea { resize: vertical; min-height: 62px; }

.vos-cp-button {
	display: inline-block;
	padding: 10px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--vos-accent-ink, #0F6E5C);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: transform 140ms ease, filter 140ms ease;
}

.vos-cp-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.vos-cp-button:disabled { opacity: 0.55; cursor: default; }

/* Gates and errors ------------------------------------------------ */

.vos-cp-gate {
	border: 1px solid var(--vos-border, #E3E0D9);
	border-radius: 12px;
	background: var(--vos-card, #fff);
	padding: 26px;
	animation: vos-cp-rise 380ms ease-out both;
}

.vos-cp-form { display: flex; flex-direction: column; gap: 6px; max-width: 340px; margin-top: 12px; }
.vos-cp-label { font-size: 13px; font-weight: 600; }

.vos-cp-error {
	margin: 8px 0 0;
	padding: 9px 12px;
	border-radius: 10px;
	background: var(--vos-crit-soft, #FBEDE9);
	color: var(--vos-crit, #C4553D);
	font-size: 14px;
}

.vos-cp-boot { color: var(--vos-muted, #6E7C77); padding: 20px 0; }

@media (prefers-reduced-motion: reduce) {
	.vos-cp-head, .vos-cp-card, .vos-cp-gate,
	.vos-cp-thread-card, .vos-cp-thread-body, .vos-cp-post, .vos-cp-new { animation: none; }
	.vos-cp-tab:hover, .vos-cp-button:hover:not(:disabled) { transform: none; }
}

/* A secondary control: present, but never competing with Send. */
.vos-cp-button.is-ghost {
	background: transparent;
	color: var(--vos-accent-ink, #0F6E5C);
	border: 1px solid var(--vos-accent-ink, #0F6E5C);
}

.vos-cp-button.is-ghost:hover { background: var(--vos-accent-soft, #E2F1EC); }
