/* ==========================================================================
   My Compass dashboard
   ========================================================================== */

.compass-dash {
    --cd-green: #2d7d6f;
    --cd-green-soft: #2d7d6f;
	--cd-ink: #1f2d28;
	--cd-muted: #000;
	--cd-line: #e4ebe7;
	--cd-bg-soft: #f4f8f6;
	color: var(--cd-ink);
	font-family: inherit;
}

.compass-dash *,
.compass-dash *::before,
.compass-dash *::after {
	box-sizing: border-box;
}

.compass-dash svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* ---- Intro + stats ------------------------------------------------------- */

.compass-dash__top {
	display: grid;
	grid-template-columns: 1fr;
	gap: 22px 28px;
	align-items: center;
	margin-bottom: 28px;
}

.compass-dash__intro {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.compass-dash__intro-text {
	flex: 1 1 240px;
	min-width: 0;
}

.compass-dash__hello {
	margin: 0 0 4px;
	font-size: 34px;
	line-height: 1.1;
	font-weight: 700;
	color: var(--cd-ink);
}

.compass-dash__welcome {
	margin: 0 0 10px;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--cd-green-soft);
}

.compass-dash__sub {
	margin: 0;
	max-width: 460px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--cd-muted);
}

.compass-dash__intro-art {
	flex: 0 0 auto;
	width: 150px;
	height: 100px;
	color: var(--cd-green-soft);
	opacity: 0.9;
}

.compass-dash__stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}

.compass-dash__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
	padding: 20px 14px 16px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 6px 18px rgba(31, 45, 40, 0.14);
}

.compass-dash__stat-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
    height: 50px;
	margin-bottom: 4px;
	border-radius: 50%;
	background: var(--cd-bg-soft);
	color: var(--cd-green-soft);
}

.compass-dash__stat-icon svg {
	width: 40px;
    height: 40px;
}

.compass-dash__stat-value {
	font-size: 26px;
	font-weight: 700;
	line-height: 1;
	color: #2d7d6f;
}

.compass-dash__stat-label {
	font-size: 13px;
    line-height: 1.3;
	color: var(--cd-muted);
	font-weight: 500;
}

/* ---- Pieces heading ------------------------------------------------------ */

.compass-dash__pieces-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}

.compass-dash__pieces-title-wrap {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1;
	min-width: 0;
}

.compass-dash__pieces-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--cd-ink);
	flex-shrink: 0;
}

.compass-dash__pieces-divider {
	display: block;
	flex: 1;
	max-width: 200px;
	min-width: 80px;
	height: 40px;
}

.compass-dash__pieces-divider svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* ---- Buttons ------------------------------------------------------------- */

.compass-dash__btn,
.compass-piece__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.compass-dash__btn svg,
.compass-piece__btn svg {
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

.compass-dash__btn--primary {
	background: var(--cd-green);
	color: #fff;
	border-color: var(--cd-green);
}

.compass-dash__btn--primary:hover {
	background: #335f53;
	color: #fff;
}

.compass-dash__btn--outline {
	background: #fff;
	color: var(--cd-green);
	border-color: var(--cd-green);
}

.compass-dash__btn--outline:hover {
	background: var(--cd-bg-soft);
}

/* ---- Compass piece card -------------------------------------------------- */

.compass-dash__pieces {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.compass-piece {
	display: grid;
	grid-template-columns: 180px 1fr;
	align-items: stretch;
	gap: 0;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 6px 18px rgba(31, 45, 40, 0.14);
	overflow: hidden;
}

.compass-piece__media {
	width: 180px;
	height: 100%;
	min-height: 130px;
	overflow: hidden;
	background: var(--cd-bg-soft);
}

.compass-piece__right-content {
	padding: 10px 20px;
	display: grid;
	grid-template-columns: 1.4fr 1fr auto;
	align-items: center;
	gap: 20px;
	min-width: 0;
	flex: 1;
}

.compass-piece__img,
.compass-piece__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.compass-piece__info {
	min-width: 0;
}

.compass-piece__tag {
    display: inline-block;
    padding: 1px 10px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #2d7d6f;
    background: #2d7d6f36;
    border-radius: 6px;
}

.compass-piece__title {
	margin: 0 0 8px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--cd-ink);
}

.compass-piece__date {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--cd-muted);
}

.compass-piece__date-icon {
	display: inline-flex;
	width: 15px;
	height: 15px;
	color: var(--cd-green-soft);
}

.compass-piece__excerpt {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--cd-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---- Card metrics + journey line ---------------------------------------- */

.compass-piece__journey {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	min-width: 0;
	position: relative;
	padding: 12px 20px;
}

.compass-piece__journey::before,
.compass-piece__journey::after {
	content: "";
	position: absolute;
	top: 5%;
	height: 90%;
	width: 1px;
	background: var(--cd-line);
	pointer-events: none;
}

.compass-piece__journey::before {
	left: 0;
}

.compass-piece__journey::after {
	right: 0;
}

.compass-piece__metrics {
	display: flex;
	flex-direction: column;
	gap: 0;
	flex-shrink: 0;
	position: relative;
}

.compass-piece__metrics::after {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 90%;
	height: 1px;
	background: var(--cd-line);
	pointer-events: none;
}

.compass-piece__metric {
	display: grid;
	grid-template-columns: 26px auto;
	grid-template-rows: auto auto;
	column-gap: 8px;
	padding: 14px 0;
}

.compass-piece__metric:first-child {
	padding-top: 0;
}

.compass-piece__metric:last-child {
	padding-bottom: 0;
}

.compass-piece__metric-icon {
	grid-row: 1 / span 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: var(--cd-green-soft);
}

.compass-piece__metric-value {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--cd-ink);
}

.compass-piece__metric-label {
	font-size: 12px;
	color: var(--cd-muted);
}

.compass-piece__journey-line {
	flex: 1;
	min-width: 70px;
	max-width: 180px;
	color: var(--cd-green-soft);
	opacity: 0.7;
}

.compass-piece__journey-line svg {
	height: auto;
}

@media (max-width: 991px) {
	.compass-piece__journey-line {
		display: none;
	}

	.compass-piece__journey {
		width: 100%;
		padding: 12px 0;
	}

	.compass-piece__journey::before,
	.compass-piece__journey::after {
		display: none;
	}

	.compass-piece__metrics {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
		width: 100%;
		gap: 16px;
	}

	.compass-piece__metrics::after {
		display: none;
	}

	.compass-piece__metric {
		flex: 1 1 0;
		min-width: 0;
		padding: 0;
	}
}

/* ---- Card actions -------------------------------------------------------- */

.compass-piece__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 170px;
}

.compass-piece__btn {
    width: 100%;
    justify-content: space-between;
    background: #fff !important;
    color: #2d7d6f !important;
    border-color: #2d7d6f;
}

.compass-piece__btn:hover {
	border-color: var(--cd-green-soft);
	color: var(--cd-green);
}

.compass-piece__btn--read {
	color: var(--cd-ink);
}

.compass-piece__btn--read svg {
	color: var(--cd-green-soft);
}

.compass-piece__btn--link {
    justify-content: flex-start;
    gap: 8px;
    border-color: transparent !important;
    color: var(--cd-muted) !important;
    padding-left: 4px;
    box-shadow: none;
}

.compass-piece__btn--link:hover {
	border-color: transparent;
	color: var(--cd-green);
}

/* ---- Empty state --------------------------------------------------------- */

.compass-dash__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 40px 20px;
	text-align: center;
	background: #fff;
	border: 1px dashed var(--cd-line);
	border-radius: 14px;
	color: var(--cd-muted);
}

.compass-dash__empty p {
	margin: 0;
	font-size: 15px;
}

/* ---- Chapter bar + footnote --------------------------------------------- */

.compass-dash__chapter-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 22px;
	padding: 16px 18px;
	background: var(--cd-bg-soft);
	border: 1px solid var(--cd-line);
	border-radius: 12px;
}

.compass-dash__chapter-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	color: var(--cd-green);
}

.compass-dash__chapter-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-right: auto;
}

.compass-dash__chapter-text strong {
	font-size: 14px;
	color: var(--cd-ink);
}

.compass-dash__chapter-text span {
	font-size: 13px;
	color: var(--cd-muted);
}

.compass-dash__footnote {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 22px 0 50px;
	font-size: 13px;
	color: var(--cd-muted);
}

.compass-dash__footnote-heart {
	display: inline-flex;
	width: 16px;
	height: 16px;
	color: var(--cd-green-soft);
}

/* ---- Responsive ---------------------------------------------------------- */

@media (min-width: 1080px) {
	.compass-dash__top {
		grid-template-columns: minmax(300px, 1fr) minmax(440px, 1.05fr);
	}
}

@media (max-width: 1079px) {
	.compass-dash__intro {
		justify-content: space-between;
	}
}

@media (max-width: 880px) {
	.compass-dash__stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.compass-dash__pieces-head {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	.compass-dash__pieces-title-wrap {
		flex: none;
		width: 100%;
	}

	.compass-dash__pieces-divider {
		display: none;
	}

	.compass-dash__pieces-head > .compass-dash__btn {
		width: 100%;
		align-self: stretch;
		padding: 12px 16px;
		font-size: 14px;
		white-space: normal;
		text-align: center;
	}

	.compass-piece {
		grid-template-columns: 150px 1fr;
	}

	.compass-piece__media {
		width: 150px;
		min-height: 110px;
	}

	.compass-piece__right-content {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.compass-piece__actions {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.compass-piece__actions .compass-piece__btn {
		width: auto;
		flex: 1 1 auto;
	}
}

@media (max-width: 560px) {
	.compass-dash__hello {
		font-size: 27px;
	}

	.compass-dash__pieces-title {
		font-size: 20px;
		line-height: 1.25;
	}

	.compass-dash__intro-art {
		display: none;
	}

	.compass-dash__stats {
		grid-template-columns: 1fr 1fr;
	}

	.compass-piece {
		grid-template-columns: 1fr;
	}

	.compass-piece__media {
		width: 100%;
		min-height: 180px;
	}

	.compass-piece__right-content {
		grid-template-columns: 1fr;
	}

	.compass-dash__chapter-bar {
		flex-wrap: wrap;
	}
}

/* Toast notifications (shared across My Compass modals) */

.compass-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	z-index: 1000001;
	max-width: min(420px, calc(100vw - 32px));
	padding: 14px 20px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
	color: #fff;
	text-align: center;
	background: #3e7768;
	border-radius: 10px;
	box-shadow: 0 10px 32px rgba(20, 30, 26, 0.22);
	opacity: 0;
	transform: translate(-50%, 12px);
	transition: opacity 0.28s ease, transform 0.28s ease;
	pointer-events: none;
}

.compass-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.compass-toast--success {
	background: #3e7768;
}

.compass-toast--error {
	background: #b42318;
}

.compass-toast--info {
	background: #1f2d28;
}
