.cd-seo-portal {
	--cd-navy: #1e385a;
	--cd-sky: #00aeef;
	--cd-white: #ffffff;
	--cd-muted: #5c6b7a;
	max-width: 1100px;
	margin: 0 auto;
	padding: 2rem 1.25rem 3rem;
	font-family: "DM Sans", system-ui, sans-serif;
	color: var(--cd-navy);
	background: #f4f7fb;
	border-radius: 12px;
	box-sizing: border-box;
}

.cd-seo-portal *,
.cd-seo-portal *::before,
.cd-seo-portal *::after {
	box-sizing: border-box;
}

.cd-seo-portal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid var(--cd-sky);
}

.cd-seo-portal__brand {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.cd-seo-portal__brand-logo {
	max-height: 54px;
	width: auto;
	display: block;
}

.cd-seo-portal__mark {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.75rem;
	font-weight: 600;
	color: var(--cd-navy);
}

.cd-seo-portal__tag {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--cd-sky);
	font-weight: 600;
}

.cd-seo-portal__h2 {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.75rem;
	margin: 0 0 1rem;
	color: var(--cd-navy);
}

.cd-seo-portal__h3 {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.35rem;
	margin: 1.5rem 0 0.75rem;
}

.cd-seo-portal__h4 {
	font-size: 1rem;
	margin: 1.5rem 0 0.5rem;
	color: var(--cd-navy);
	font-weight: 600;
}
.cd-seo-portal__print-title {
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #d9e2ec;
	text-align: center;
}

.cd-seo-portal__section {
	margin-bottom: 2.5rem;
	padding: 1.5rem;
	background: var(--cd-white);
	border-radius: 10px;
	box-shadow: 0 4px 24px rgba(30, 56, 90, 0.06);
}

.cd-seo-portal__muted {
	color: var(--cd-muted);
	font-size: 0.95rem;
}
.cd-seo-portal__note {
	margin: 0.35rem 0 0.9rem;
	padding: 0.35rem 0.55rem;
	text-align: right;
	font-size: 0.82rem;
	color: var(--cd-muted);
	font-style: italic;
	background: #f7f9fc;
	border-left: 3px solid #d7e1ef;
}

.cd-seo-portal__jump-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 0 0 0.9rem;
}

.cd-seo-portal__jump-link {
	display: inline-block;
	padding: 0.24rem 0.62rem;
	border-radius: 999px;
	background: #00aeef;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.3;
}

.cd-seo-portal__jump-link:hover,
.cd-seo-portal__jump-link:focus {
	background: #009ed8;
	color: #fff;
	text-decoration: none;
}

.cd-seo-portal__anchor-target {
	scroll-margin-top: 16px;
}

.cd-seo-portal__strong {
	font-weight: 600;
	margin-top: 1rem;
}

.cd-seo-portal__logout {
	text-align: right;
	margin: 0 0 1rem;
}
.cd-seo-portal__logout a {
	color: var(--cd-sky);
	font-weight: 600;
	text-decoration: none;
}
.cd-seo-portal__logout a:hover {
	text-decoration: underline;
}

.cd-seo-portal__cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}

.cd-seo-portal__dashboard-summary {
	margin: 0 0 1rem;
	padding: 0.75rem 0.9rem;
	background: #edf5ff;
	border: 1px solid #d6e7fb;
	border-left: 4px solid var(--cd-sky);
	border-radius: 8px;
	font-size: 0.95rem;
	color: var(--cd-navy);
}

@media (max-width: 900px) {
	.cd-seo-portal__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.cd-seo-portal__card {
	background: #f8fafc;
	border: 1px solid #e3e8ef;
	border-radius: 10px;
	padding: 1rem;
}
.cd-seo-portal__card--up {
	border-color: rgba(0, 138, 32, 0.35);
	background: #f0faf2;
}
.cd-seo-portal__card--down {
	border-color: rgba(179, 45, 46, 0.35);
	background: #fdf2f2;
}
.cd-seo-portal__card-label {
	font-size: 0.8rem;
	color: var(--cd-muted);
	margin-bottom: 0.35rem;
}
.cd-seo-portal__card-value {
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.35;
}
.cd-seo-portal__card-prev {
	margin-top: 0.4rem;
	font-size: 0.82rem;
	color: var(--cd-muted);
}
.cd-seo-portal__trend {
	font-weight: 700;
	margin-left: 0.25rem;
}
.cd-seo-portal__trend--up {
	color: #008a20;
}
.cd-seo-portal__trend--down {
	color: #b32d2e;
}
.cd-seo-portal__trend--flat {
	color: #646970;
}
.cd-seo-portal__pct--pos {
	color: #008a20;
	font-size: 0.95rem;
}
.cd-seo-portal__pct--neg {
	color: #b32d2e;
	font-size: 0.95rem;
}

.cd-seo-portal__btn {
	display: inline-block;
	margin: 0 0 1rem;
	padding: 0.55rem 1.25rem;
	background: var(--cd-navy);
	color: #fff !important;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	text-decoration: none;
}
.cd-seo-portal__btn:hover {
	background: var(--cd-sky);
}

.cd-seo-portal__dashboard-actions {
	margin-top: 0.35rem;
	display: flex;
	gap: 0.65rem;
	flex-wrap: wrap;
}

.cd-seo-portal__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}
.cd-seo-portal__table th,
.cd-seo-portal__table td {
	border: 1px solid #e3e8ef;
	padding: 0.5rem 0.65rem;
	text-align: left;
	vertical-align: top;
}
.cd-seo-portal__table th {
	background: #eef4fb;
	font-weight: 600;
}
.cd-seo-portal__table--compact th {
	width: 40%;
}
.cd-seo-portal__table--ga-summary th:first-child,
.cd-seo-portal__table--ga-compare th:first-child,
.cd-seo-portal__table--ga-summary td:first-child,
.cd-seo-portal__table--ga-compare td:first-child {
	width: 42%;
}
.cd-seo-portal__table--ga-summary th:not(:first-child),
.cd-seo-portal__table--ga-compare th:not(:first-child),
.cd-seo-portal__table--ga-summary td:not(:first-child),
.cd-seo-portal__table--ga-compare td:not(:first-child) {
	width: 14.5%;
	white-space: nowrap;
}
.cd-seo-portal__table--ga-compare td:first-child {
	word-break: break-word;
}
.cd-seo-portal__table--keywords th:nth-child(1),
.cd-seo-portal__table--keywords td:nth-child(1) {
	width: 28%;
}
.cd-seo-portal__table--keywords th:nth-child(2),
.cd-seo-portal__table--keywords td:nth-child(2),
.cd-seo-portal__table--keywords th:nth-child(3),
.cd-seo-portal__table--keywords td:nth-child(3),
.cd-seo-portal__table--keywords th:nth-child(4),
.cd-seo-portal__table--keywords td:nth-child(4) {
	width: 12%;
	white-space: nowrap;
}
.cd-seo-portal__table--keywords th:nth-child(5),
.cd-seo-portal__table--keywords td:nth-child(5) {
	width: 36%;
	word-break: break-word;
}
.cd-seo-portal__table--rankings th:nth-child(1),
.cd-seo-portal__table--rankings td:nth-child(1) {
	width: 12%;
	white-space: nowrap;
}
.cd-seo-portal__table--rankings th:nth-child(2),
.cd-seo-portal__table--rankings td:nth-child(2) {
	width: 34%;
}
.cd-seo-portal__table--rankings th:nth-child(3),
.cd-seo-portal__table--rankings td:nth-child(3) {
	width: 34%;
	word-break: break-word;
}
.cd-seo-portal__table--rankings th:nth-child(4),
.cd-seo-portal__table--rankings td:nth-child(4) {
	width: 20%;
	white-space: nowrap;
}
.cd-seo-portal__scroll {
	overflow-x: auto;
	max-height: 420px;
	overflow-y: auto;
}

.cd-seo-mv-up {
	color: #008a20;
	font-weight: 600;
}
.cd-seo-mv-down {
	color: #b32d2e;
	font-weight: 600;
}
.cd-seo-mv-flat {
	color: var(--cd-muted);
}

.cd-seo-portal__history {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}
.cd-seo-portal__history a {
	color: var(--cd-sky);
	font-weight: 600;
	text-decoration: none;
}
.cd-seo-portal__history a:hover {
	text-decoration: underline;
}
.cd-seo-portal__hist-toggle {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	color: var(--cd-sky);
	font-weight: 600;
	cursor: pointer;
	font: inherit;
}
.cd-seo-portal__hist-toggle:hover {
	text-decoration: underline;
}
.cd-seo-portal__hist-block.is-hidden {
	display: none;
}

.cd-seo-portal__hist-block {
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #e3e8ef;
}

.cd-seo-portal__thread {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1rem;
}
.cd-seo-portal__bubble {
	max-width: 90%;
	padding: 0.75rem 1rem;
	border-radius: 10px;
}
.cd-seo-portal__bubble--client {
	align-self: flex-start;
	background: #eef4fb;
	border: 1px solid #dbe7f5;
}
.cd-seo-portal__bubble--admin {
	align-self: flex-end;
	background: #e8fbff;
	border: 1px solid #b8eef9;
}
.cd-seo-portal__bubble-meta {
	font-size: 0.75rem;
	color: var(--cd-muted);
	margin-bottom: 0.35rem;
}
.cd-seo-portal__bubble-body {
	font-size: 0.95rem;
}

.cd-seo-portal__msg-form textarea {
	width: 100%;
	border-radius: 8px;
	border: 1px solid #cfd8e3;
	padding: 0.65rem;
	font-family: inherit;
	margin-bottom: 0.5rem;
}

.cd-seo-portal__login-card {
	max-width: 420px;
	margin: 0 auto;
	padding: 1.5rem;
	background: var(--cd-white);
	border-radius: 10px;
	box-shadow: 0 4px 24px rgba(30, 56, 90, 0.08);
}
.cd-seo-portal__login-card #cd-seo-loginform label {
	display: block;
	margin-top: 0.75rem;
	font-weight: 600;
	font-size: 0.9rem;
}
.cd-seo-portal__login-card #cd-seo-loginform input[type="text"],
.cd-seo-portal__login-card #cd-seo-loginform input[type="password"] {
	width: 100%;
	padding: 0.5rem 0.65rem;
	border-radius: 6px;
	border: 1px solid #cfd8e3;
	margin-top: 0.25rem;
}
.cd-seo-portal__login-card #wp-submit {
	margin-top: 1rem;
	background: var(--cd-navy);
	border: none;
	color: #fff;
	padding: 0.5rem 1.25rem;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
}
.cd-seo-portal__login-card #wp-submit:hover {
	background: var(--cd-sky);
}

.cd-seo-portal__client-logo img {
	max-height: 64px;
	width: auto;
	display: block;
	margin: 0 auto 0.5rem;
}

.cd-seo-portal__client-logo {
	text-align: center;
}

.cd-seo-portal__notice {
	padding: 1rem;
	background: #fff8e6;
	border: 1px solid #f5d67a;
	border-radius: 8px;
}

@media print {
	@page {
		size: auto;
		margin: 8mm;
	}
	html,
	body {
		margin: 0 !important;
		padding: 0 !important;
	}
	.cd-seo-portal__print-region {
		display: none !important;
	}
	.cd-seo-print-active {
		display: block !important;
		width: 100% !important;
		background: #fff !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: visible !important;
	}
	.cd-seo-print-active .cd-seo-portal__printable {
		display: block !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}
	.cd-seo-print-active .cd-seo-portal {
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
		border-radius: 0 !important;
		box-shadow: none !important;
	}
	.cd-seo-print-active .cd-seo-portal__section {
		padding: 0 !important;
		margin: 0 0 8mm !important;
		background: transparent !important;
		box-shadow: none !important;
		border-radius: 0 !important;
	}
	.cd-seo-print-active .cd-seo-portal__scroll,
	.cd-seo-portal__scroll {
		max-height: none !important;
		overflow: visible !important;
	}
	.cd-seo-portal__print,
	.cd-seo-portal__history,
	.cd-seo-portal__header,
	.cd-seo-portal__logout,
	.cd-seo-portal__tag {
		display: none !important;
	}
	/* Remove WordPress admin chrome from printed preview pages. */
	#wpadminbar,
	#adminmenuback,
	#adminmenuwrap,
	#screen-meta,
	#screen-meta-links,
	.notice,
	.update-nag {
		display: none !important;
	}
	html.wp-toolbar {
		padding-top: 0 !important;
	}
	body.wp-admin #wpcontent,
	body.wp-admin #wpbody-content {
		margin: 0 !important;
		padding: 0 !important;
	}
	body.wp-admin .wrap.cd-seo-report-preview-page {
		margin: 0 !important;
		padding: 0 !important;
	}
}
