/*
 * TinhPhanTram main stylesheet.
 * Clean, light, table/list-inspired UI for calculators and SEO pages.
 */

:root {
	--tp-bg: #f5f7fa;
	--tp-card: #ffffff;
	--tp-text: #0f172a;
	--tp-muted: #64748b;
	--tp-soft: #94a3b8;
	--tp-border: #dfe5ee;
	--tp-border-soft: #edf2f7;
	--tp-primary: #0b7fc3;
	--tp-primary-dark: #075f92;
	--tp-accent: #ff8a00;
	--tp-success: #059669;
	--tp-danger: #dc2626;
	--tp-radius: 10px;
	--tp-font: Arial, "Helvetica Neue", sans-serif;
}

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--tp-bg);
	color: var(--tp-text);
	font-family: var(--tp-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 0;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg {
	display: block;
	max-width: 100%;
}

button,
input,
select,
textarea {
	font: inherit;
}

a {
	color: var(--tp-primary);
	text-decoration: none;
}

a:hover {
	color: var(--tp-primary-dark);
}

p {
	margin: 0 0 12px;
	color: var(--tp-muted);
}

ul,
ol {
	margin: 0;
	padding-left: 20px;
}

li {
	margin: 4px 0;
}

.tp-container {
	width: min(1180px, calc(100% - 32px));
	margin-inline: auto;
}

.screen-reader-text,
.tp-skip-link {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tp-skip-link:focus {
	z-index: 1000;
	top: 12px;
	left: 12px;
	width: auto;
	height: auto;
	padding: 10px 12px;
	clip: auto;
	background: var(--tp-primary);
	color: #fff;
	border-radius: 8px;
}

/* Header */
.tp-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #fff;
	border-bottom: 1px solid var(--tp-border);
}

.tp-header-inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 18px;
	align-items: center;
	min-height: 64px;
}

.tp-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: var(--tp-text);
}

.tp-logo-mark,
.tp-tool-icon,
.tp-quick-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: var(--tp-primary);
	color: #fff;
	font-weight: 800;
}

.tp-logo-text {
	display: grid;
	gap: 1px;
	min-width: 0;
}

.tp-logo-text strong {
	color: var(--tp-text);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
}

.tp-logo-text small {
	color: var(--tp-muted);
	font-size: 12px;
	line-height: 1.2;
}

.tp-nav {
	justify-self: center;
	min-width: 0;
}

.tp-menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-menu li {
	position: relative;
	margin: 0;
}

.tp-menu a {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 11px;
	border-radius: 8px;
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.tp-menu a:hover,
.tp-menu .current-menu-item > a,
.tp-menu .current_page_item > a {
	background: #eef6fc;
	color: var(--tp-primary);
}

.tp-menu .sub-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: none;
	grid-template-columns: repeat(2, minmax(190px, 1fr));
	gap: 4px;
	width: min(620px, calc(100vw - 32px));
	max-height: min(70vh, 560px);
	overflow-y: auto;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}

.tp-menu li:hover > .sub-menu,
.tp-menu li:focus-within > .sub-menu {
	display: none;
}

.tp-menu .sub-menu a {
	justify-content: flex-start;
	width: 100%;
	min-height: 34px;
	padding: 0 10px;
	font-size: 13px;
}

.tp-header-tools {
	display: flex;
	align-items: center;
	gap: 8px;
}

.tp-header-search {
	display: flex;
	width: 270px;
}

.tp-header-search label {
	flex: 1;
	min-width: 0;
}

.tp-header-search input {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--tp-border);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	background: #fff;
	color: var(--tp-text);
	font-size: 14px;
	outline: none;
}

.tp-header-search input:focus {
	border-color: var(--tp-primary);
	box-shadow: inset 0 0 0 1px var(--tp-primary);
}

.tp-header-search button {
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--tp-border);
	border-radius: 0 8px 8px 0;
	background: #fff;
	color: var(--tp-primary);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.tp-icon-button {
	display: none;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--tp-border);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
}

.tp-menu-toggle span {
	display: block;
	width: 16px;
	height: 2px;
	margin: 2px 0;
	background: var(--tp-text);
	border-radius: 99px;
}

/* Structure */
.tp-site-main {
	min-height: 60vh;
}

.tp-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 20px;
	align-items: start;
	padding: 18px 0 42px;
}

.tp-main-column,
.tp-sidebar {
	display: grid;
	gap: 14px;
	min-width: 0;
}

.tp-card,
.tp-page-card,
.tp-post-card,
.tp-tool-card,
.tp-tool-intro,
.tp-tool-calculator,
.tp-tool-formula,
.tp-tool-examples,
.tp-tool-guidance,
.tp-howto,
.tp-related-tools,
.tp-tool-helpers,
.tp-faq-section,
.tp-formula-section {
	background: var(--tp-card);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	box-shadow: none;
	overflow: hidden;
}

.tp-card {
	padding: 0;
}

/* Hero */
.tp-hero {
	padding: 28px 0 10px;
	background: var(--tp-bg);
}

.tp-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
	gap: 26px;
	align-items: center;
}

.tp-hero h1 {
	margin: 0 0 8px;
	color: var(--tp-text);
	font-size: clamp(30px, 4vw, 42px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0;
}

.tp-hero-kicker {
	margin: 0 0 8px;
	color: var(--tp-primary);
	font-size: 19px;
	font-weight: 700;
}

.tp-hero-description {
	max-width: 700px;
	margin: 0;
	color: var(--tp-muted);
	font-size: 16px;
}

.tp-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.tp-badges span {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 11px;
	border: 1px solid var(--tp-border);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-text);
	font-size: 13px;
	font-weight: 700;
}

.tp-hero-art img {
	width: 100%;
	height: auto;
	max-height: 220px;
	object-fit: contain;
}

/* Shared section headers */
.tp-section-heading,
.tp-card-heading,
.tp-quick-tools > h2,
.tp-trust-card > h2,
.tp-tips > h2,
.tp-formula-section > .tp-section-heading,
.tp-faq-section > .tp-section-heading,
.tp-related-tools > h2,
.tp-tool-examples > h2,
.tp-tool-helpers > h2,
.tp-howto > h2,
.tp-tool-formula > h2 {
	margin: 0;
	padding: 14px 16px;
	border-bottom: 1px solid var(--tp-border);
	background: #fff;
	color: var(--tp-text);
	text-align: left;
}

.tp-section-heading h2,
.tp-card-heading h2,
.tp-quick-tools > h2,
.tp-trust-card > h2,
.tp-tips > h2,
.tp-related-tools > h2,
.tp-tool-examples > h2,
.tp-tool-helpers > h2,
.tp-howto > h2,
.tp-tool-formula > h2 {
	margin: 0;
	color: inherit;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
}

.tp-section-heading p {
	margin: 4px 0 0;
	color: var(--tp-muted);
	font-size: 14px;
}

/* Calculators */
.tp-main-calculator,
.tp-tool-calculator {
	padding: 18px;
}

.tp-calculator {
	margin: 0;
}

.tp-calculator-heading {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0 0 16px;
	padding: 0 0 14px;
	border-bottom: 1px solid var(--tp-border-soft);
}

.tp-calculator-heading h2 {
	margin: 0;
	color: var(--tp-text);
	font-size: 21px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
}

.tp-calculator-heading p {
	margin: 3px 0 0;
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.45;
}

.tp-tool-icon svg,
.tp-quick-icon svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tp-fields,
.tp-fields--1,
.tp-fields--2,
.tp-fields--3 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 12px;
	margin: 0;
}

.tp-field {
	display: grid;
	gap: 7px;
	min-width: 0;
	margin: 0;
}

.tp-field-label {
	color: var(--tp-text);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
}

.tp-input-wrap {
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
}

.tp-input-wrap input,
.tp-input-wrap select,
.tp-contact-form input,
.tp-contact-form textarea,
.tp-contact-form select {
	width: 100%;
	min-width: 0;
	height: 44px;
	padding: 0 12px;
	border: 1px solid #d8e0ea;
	border-radius: 8px;
	background: #fff;
	color: var(--tp-text);
	font-size: 15px;
	font-weight: 600;
	outline: none;
	box-shadow: none;
}

.tp-input-wrap input::placeholder,
.tp-contact-form input::placeholder,
.tp-contact-form textarea::placeholder {
	color: #94a3b8;
	font-weight: 500;
	opacity: 1;
}

.tp-input-wrap input {
	padding-right: 44px;
}

.tp-input-wrap input[type="date"] {
	padding-right: 12px;
}

.tp-input-wrap select {
	appearance: auto;
	padding-right: 10px;
}

.tp-input-wrap input:focus,
.tp-input-wrap select:focus,
.tp-contact-form input:focus,
.tp-contact-form textarea:focus {
	border-color: var(--tp-primary);
	box-shadow: 0 0 0 3px rgba(11, 127, 195, .12);
}

.tp-input-suffix {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--tp-text);
	font-size: 13px;
	font-weight: 700;
	pointer-events: none;
}

.tp-result {
	display: grid;
	gap: 4px;
	margin: 14px 0 0;
	padding: 12px 14px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #f8fafc;
	text-align: left;
}

.tp-result-label {
	color: var(--tp-muted);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .02em;
}

.tp-result-value {
	display: block;
	color: var(--tp-primary);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.18;
	word-break: break-word;
}

.tp-calculator--main .tp-result-value,
.tp-calculator--full .tp-result-value {
	font-size: 34px;
}

.tp-result-value.is-empty {
	color: var(--tp-soft);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
}

.tp-result-value.is-error,
.tp-error:not(:empty) {
	color: var(--tp-danger);
}

.tp-result-note {
	min-height: 0;
	color: var(--tp-muted);
	font-size: 13px;
	line-height: 1.45;
}

.tp-error {
	margin-top: 8px;
	color: var(--tp-danger);
	font-size: 13px;
	font-weight: 700;
}

.tp-calculator-actions,
.tp-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
	margin: 12px 0 0;
}

.tp-button,
.tp-action-button,
.tp-link-button,
.tp-contact-form button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 15px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.tp-button,
.tp-action-button--primary,
.tp-contact-form button {
	border: 1px solid var(--tp-primary);
	background: var(--tp-primary);
	color: #fff;
}

.tp-button--secondary,
.tp-action-button--ghost,
.tp-link-button {
	border: 1px solid var(--tp-border);
	background: #fff;
	color: var(--tp-text);
}

.tp-button:hover,
.tp-action-button--primary:hover,
.tp-contact-form button:hover {
	background: var(--tp-primary-dark);
	border-color: var(--tp-primary-dark);
	color: #fff;
}

.tp-formula-box {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: 14px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.tp-formula-box > div,
.tp-formula-box > p {
	margin: 0;
	padding: 12px 14px;
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.5;
}

.tp-formula-box > div {
	border-bottom: 1px solid var(--tp-border-soft);
}

.tp-formula-box > div:first-child {
	border-right: 1px solid var(--tp-border-soft);
}

.tp-formula-box > p {
	grid-column: 1 / -1;
}

.tp-formula-box strong {
	color: var(--tp-text);
}

/* Popular tools as compact rows */
.tp-popular-tools {
	display: grid;
	gap: 12px;
}

.tp-tools-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.tp-tool-card {
	padding: 0;
}

.tp-tool-card-header {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 14px 16px 12px;
	border-bottom: 1px solid var(--tp-border-soft);
}

.tp-tool-card-header > div {
	min-width: 0;
}

.tp-tool-card h3 {
	margin: 0;
	color: var(--tp-text);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
}

.tp-tool-card p {
	margin: 3px 0 0;
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.45;
}

.tp-tool-card .tp-calculator--card {
	padding: 14px 16px 16px;
}

.tp-calculator--card .tp-fields,
.tp-calculator--card .tp-fields--1,
.tp-calculator--card .tp-fields--2,
.tp-calculator--card .tp-fields--3 {
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.tp-calculator--card .tp-result {
	margin-top: 12px;
}

/* Sidebar */
.tp-sidebar .tp-card {
	padding: 0;
}

.tp-quick-tools nav {
	display: grid;
}

.tp-quick-tools a {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
	min-height: 48px;
	padding: 0 14px;
	border-bottom: 1px solid var(--tp-border-soft);
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 700;
}

.tp-quick-tools a:last-child {
	border-bottom: 0;
}

.tp-quick-icon {
	width: 28px;
	height: 28px;
	border-radius: 7px;
	background: #e8f3fc;
	color: var(--tp-primary);
}

.tp-quick-icon svg {
	width: 16px;
	height: 16px;
}

.tp-quick-tools a b {
	color: #8aa0ba;
	font-size: 18px;
	font-weight: 700;
}

.tp-history-panel .tp-card-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.tp-history-panel .tp-card-heading h2 {
	max-width: 170px;
	color: var(--tp-primary);
}

.tp-history-list {
	display: grid;
}

.tp-history-list p,
.tp-history-item {
	margin: 0;
	padding: 12px 14px;
	border-bottom: 1px solid var(--tp-border-soft);
	color: var(--tp-muted);
	font-size: 14px;
}

.tp-history-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
}

.tp-history-item strong {
	min-width: 0;
	color: var(--tp-text);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
}

.tp-history-item time {
	color: var(--tp-soft);
	font-size: 12px;
	white-space: nowrap;
}

.tp-history-item:last-child,
.tp-history-list p:last-child {
	border-bottom: 0;
}

.tp-trust-card ul,
.tp-tips ul {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-trust-card li,
.tp-tips li {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
	min-height: 42px;
	margin: 0;
	padding: 9px 14px;
	border-bottom: 1px solid var(--tp-border-soft);
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 700;
}

.tp-trust-card li:last-child,
.tp-tips li:last-child {
	border-bottom: 0;
}

.tp-trust-card li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 7px;
	background: #e8f3fc;
	color: var(--tp-primary);
	font-weight: 700;
}

.tp-tips li::before {
	content: "";
	width: 5px;
	height: 5px;
	margin-top: 9px;
	border-radius: 999px;
	background: var(--tp-accent);
}

.tp-tips li {
	color: var(--tp-muted);
	font-weight: 400;
	line-height: 1.45;
}

/* Tool detail pages */
.tp-breadcrumbs {
	margin: 0 0 10px;
	color: var(--tp-muted);
	font-size: 13px;
}

.tp-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-breadcrumbs li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	color: var(--tp-muted);
	line-height: 1.4;
}

.tp-breadcrumbs li + li::before {
	content: "/";
	color: var(--tp-soft);
}

.tp-breadcrumbs a {
	color: var(--tp-primary);
}

.tp-breadcrumbs span {
	color: var(--tp-muted);
}

.tp-tool-page,
.tp-quick-tool-page {
	display: grid;
	gap: 12px;
}

.tp-tool-intro {
	padding: 20px;
}

.tp-tool-intro h1,
.tp-page-header h1,
.tp-archive-header h1,
.tp-not-found h1 {
	margin: 0 0 8px;
	color: var(--tp-text);
	font-size: clamp(28px, 3vw, 36px);
	font-family: var(--tp-font);
	font-weight: 600;
	line-height: 1.24;
	letter-spacing: 0;
}

.tp-tool-intro p {
	max-width: 780px;
	margin: 0;
	color: var(--tp-muted);
	font-size: 15px;
	line-height: 1.55;
}

.tp-tool-formula p,
.tp-tool-helpers > p {
	margin: 0;
	padding: 13px 16px;
	border-bottom: 1px solid var(--tp-border-soft);
	color: var(--tp-muted);
}

.tp-howto ol {
	margin: 0;
	padding: 14px 16px 14px 40px;
	border-bottom: 1px solid var(--tp-border-soft);
	color: var(--tp-muted);
}

.tp-tool-formula p:last-child,
.tp-howto ol:last-child,
.tp-tool-helpers > p:last-child {
	border-bottom: 0;
}

.tp-responsive-table {
	padding: 16px;
	overflow-x: auto;
}

.tp-responsive-table table,
.tp-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	border: 1px solid var(--tp-border-soft);
	background: #fff;
}

.tp-responsive-table th,
.tp-responsive-table td,
.tp-content th,
.tp-content td {
	padding: 11px 12px;
	border: 1px solid var(--tp-border-soft);
	color: var(--tp-text);
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
	vertical-align: top;
}

.tp-responsive-table th,
.tp-content th {
	background: #f8fafc;
	font-weight: 700;
}

.tp-tool-guidance {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding: 0;
}

.tp-tool-guidance > div {
	padding: 16px;
	border-right: 1px solid var(--tp-border-soft);
}

.tp-tool-guidance > div:last-child {
	border-right: 0;
}

.tp-tool-guidance h2 {
	margin: 0 0 8px;
	color: var(--tp-text);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.tp-tool-guidance ul,
.tp-howto ol {
	color: var(--tp-muted);
}

.tp-helper-links {
	display: grid;
	padding: 0 16px 14px;
}

.tp-helper-link {
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 13px 0;
	border-bottom: 1px solid var(--tp-border-soft);
	color: var(--tp-text);
}

.tp-helper-link:last-child {
	border-bottom: 0;
}

.tp-helper-link-body strong {
	display: block;
	color: var(--tp-text);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.tp-helper-link-body small {
	display: block;
	margin-top: 2px;
	color: var(--tp-muted);
	font-size: 13px;
	line-height: 1.4;
}

.tp-helper-link-action {
	color: var(--tp-primary);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.tp-related-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	padding: 14px 16px;
}

.tp-related-grid a {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr);
	gap: 10px;
	align-items: center;
	min-height: 52px;
	padding: 10px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-text);
}

.tp-related-grid a:hover {
	border-color: rgba(11, 127, 195, .35);
	background: #f8fafc;
}

.tp-related-grid strong,
.tp-related-grid small {
	grid-column: 2;
}

.tp-related-grid strong {
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
}

.tp-related-grid small {
	display: none;
}

/* Formula, FAQ and content pages */
.tp-formula-list {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tp-formula-list li {
	display: grid;
	grid-template-columns: minmax(160px, .9fr) minmax(0, 1.2fr);
	gap: 14px;
	align-items: start;
	margin: 0;
	padding: 12px 16px;
	border-bottom: 1px solid var(--tp-border-soft);
}

.tp-formula-list li:last-child {
	border-bottom: 0;
}

.tp-formula-list strong {
	color: var(--tp-text);
	font-size: 14px;
}

.tp-formula-list span {
	color: var(--tp-muted);
	font-size: 14px;
}

.tp-text-link {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	margin: 0 16px 14px;
	color: var(--tp-primary);
	font-size: 14px;
	font-weight: 700;
}

.tp-accordion {
	display: grid;
}

.tp-accordion-item {
	border-bottom: 1px solid var(--tp-border-soft);
}

.tp-accordion-item:last-child {
	border-bottom: 0;
}

.tp-accordion-item h3 {
	margin: 0;
}

.tp-accordion-button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 46px;
	padding: 0 16px;
	border: 0;
	background: #fff;
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

.tp-accordion-button span {
	color: var(--tp-soft);
}

.tp-accordion-panel {
	padding: 0 16px 14px;
}

.tp-accordion-panel p {
	margin: 0;
	font-size: 14px;
}

.tp-page-card,
.tp-post-card,
.tp-archive-header,
.tp-not-found {
	padding: 20px;
}

.tp-full-width {
	padding: 16px 0 44px;
}

.tp-content h2,
.tp-content h3 {
	color: var(--tp-text);
	font-family: var(--tp-font);
	font-weight: 600;
	letter-spacing: 0;
}

.tp-content h2 {
	margin: 20px 0 8px;
	font-size: 21px;
	line-height: 1.38;
}

.tp-content h3 {
	margin: 16px 0 8px;
	font-size: 18px;
	line-height: 1.42;
}

.tp-content p {
	margin: 0 0 12px;
	color: var(--tp-muted);
	font-weight: 400;
	line-height: 1.68;
}

.tp-post-card .tp-content {
	max-width: 760px;
	font-size: 16.5px;
	line-height: 1.72;
}

.tp-post-card .tp-content > *:first-child {
	margin-top: 0;
}

.tp-post-card .tp-content p {
	margin-bottom: 15px;
	color: #475569;
}

.tp-content h1,
.tp-content h4,
.tp-content h5,
.tp-content h6,
.tp-post-card h1,
.tp-post-card h2,
.tp-post-card h3,
.tp-post-card h4,
.tp-page-card h1,
.tp-page-card h2,
.tp-page-card h3,
.tp-page-card h4 {
	font-family: var(--tp-font);
	font-weight: 600;
	letter-spacing: 0;
}

.tp-content strong,
.tp-content b {
	font-weight: 600;
}

.tp-content ul,
.tp-content ol {
	display: grid;
	gap: 5px;
	margin: 8px 0 0;
	color: var(--tp-muted);
}

.tp-content li {
	line-height: 1.65;
}

.tp-content a {
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tp-content blockquote {
	margin: 18px 0;
	padding: 12px 16px;
	border-left: 4px solid var(--tp-primary);
	background: #f8fafc;
	color: #475569;
}

.tp-content blockquote p:last-child {
	margin-bottom: 0;
}

.tp-content img {
	height: auto;
	border-radius: 8px;
}

/* Formula guide page */
.tp-formula-hero {
	display: grid;
	gap: 14px;
	margin: 0 0 16px;
	padding: 16px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #f8fafc;
}

.tp-formula-hero p {
	margin: 0;
	color: #475569;
	line-height: 1.7;
}

.tp-formula-summary {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.tp-formula-summary span {
	display: grid;
	gap: 2px;
	min-height: 60px;
	padding: 10px 12px;
	border: 1px solid var(--tp-border);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-muted);
	font-size: 13px;
}

.tp-formula-summary strong {
	color: var(--tp-primary);
	font-size: 20px;
	line-height: 1.15;
}

.tp-formula-block {
	margin-top: 16px;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	background: #fff;
	overflow: hidden;
}

.tp-formula-block > header {
	padding: 14px 16px;
	border-bottom: 1px solid var(--tp-border);
	background: #fff;
}

.tp-formula-block h2 {
	margin: 0;
	color: var(--tp-text);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.35;
}

.tp-formula-block header p {
	margin: 4px 0 0;
	color: var(--tp-muted);
	font-size: 14px;
}

.tp-formula-table {
	overflow-x: auto;
	padding: 14px 16px;
}

.tp-formula-table table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	border: 1px solid var(--tp-border-soft);
}

.tp-formula-table th,
.tp-formula-table td {
	padding: 12px;
	border: 1px solid var(--tp-border-soft);
	color: #475569;
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
	vertical-align: top;
}

.tp-formula-table th {
	background: #f8fafc;
	color: var(--tp-text);
	font-weight: 600;
}

.tp-formula-table code,
.tp-formula-cards code {
	display: inline-block;
	padding: 3px 6px;
	border-radius: 6px;
	background: #eef6fc;
	color: var(--tp-primary-dark);
	font-family: Consolas, Monaco, monospace;
	font-size: 13px;
	white-space: normal;
}

.tp-formula-cards,
.tp-formula-examples {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	padding: 14px 16px;
}

.tp-formula-cards article,
.tp-formula-examples > div {
	display: grid;
	gap: 8px;
	padding: 14px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #fff;
}

.tp-formula-cards h3,
.tp-formula-examples h3 {
	margin: 0;
	color: var(--tp-text);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
}

.tp-formula-cards p,
.tp-formula-examples p {
	margin: 0;
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.6;
}

.tp-formula-split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tp-formula-split > div {
	padding: 16px;
	border-right: 1px solid var(--tp-border-soft);
}

.tp-formula-split > div:last-child {
	border-right: 0;
}

.tp-formula-split h2 {
	margin-bottom: 8px;
	font-size: 18px;
}

.tp-formula-split ol,
.tp-formula-split ul {
	display: grid;
	gap: 6px;
	margin: 0;
	color: var(--tp-muted);
}

.tp-formula-tool-links {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	padding: 14px 16px;
}

.tp-formula-tool-links a {
	display: flex;
	align-items: center;
	min-height: 42px;
	padding: 0 12px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.tp-formula-tool-links a:hover {
	border-color: rgba(11, 127, 195, .35);
	background: #f8fafc;
	color: var(--tp-primary);
}

.tp-formula-faqs {
	display: grid;
}

.tp-formula-faqs details {
	border-bottom: 1px solid var(--tp-border-soft);
}

.tp-formula-faqs details:last-child {
	border-bottom: 0;
}

.tp-formula-faqs summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 50px;
	padding: 13px 16px;
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.tp-formula-faqs summary::-webkit-details-marker {
	display: none;
}

.tp-formula-faqs summary::after {
	content: "+";
	color: var(--tp-primary);
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
}

.tp-formula-faqs details[open] summary::after {
	content: "−";
}

.tp-formula-faqs p {
	margin: 0;
	padding: 0 16px 14px;
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.65;
}

.tp-contact-form {
	display: grid;
	gap: 12px;
	max-width: 620px;
	margin-top: 12px;
}

.tp-contact-form label {
	display: grid;
	gap: 7px;
	color: var(--tp-text);
	font-size: 13px;
	font-weight: 700;
}

.tp-contact-form textarea {
	height: auto;
	min-height: 120px;
	padding-block: 10px;
	resize: vertical;
}

/* Tools index page */
.tp-tools-hub-intro {
	display: grid;
	gap: 14px;
	margin: 0 0 16px;
	padding: 16px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #f8fafc;
}

.tp-tools-hub-intro p {
	margin: 0;
	color: var(--tp-muted);
}

.tp-tools-hub-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.tp-tools-hub-stats span {
	display: grid;
	gap: 2px;
	min-height: 62px;
	padding: 10px 12px;
	border: 1px solid var(--tp-border);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-muted);
	font-size: 13px;
}

.tp-tools-hub-stats strong {
	color: var(--tp-primary);
	font-size: 18px;
	line-height: 1.2;
}

.tp-tools-hub-section {
	margin-top: 16px;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	background: #fff;
	overflow: hidden;
}

.tp-tools-hub-section header {
	padding: 14px 16px;
	border-bottom: 1px solid var(--tp-border);
	background: #fff;
}

.tp-tools-hub-section h2 {
	margin: 0;
	color: var(--tp-text);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}

.tp-tools-hub-section header p {
	margin: 4px 0 0;
	color: var(--tp-muted);
	font-size: 14px;
}

.tp-tools-hub-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	padding: 14px 16px;
}

.tp-tools-hub-item {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
	min-height: 82px;
	padding: 12px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-text);
	text-decoration: none;
}

.tp-content a.tp-tools-hub-item {
	font-weight: 400;
	text-decoration: none;
}

.tp-tools-hub-item:hover,
.tp-tools-hub-item:focus-visible,
.tp-content a.tp-tools-hub-item:hover,
.tp-content a.tp-tools-hub-item:focus-visible {
	border-color: rgba(11, 127, 195, .35);
	background: #f8fafc;
	color: var(--tp-text);
	text-decoration: none;
	outline: none;
}

.tp-tools-hub-item span {
	display: grid;
	gap: 2px;
	min-width: 0;
	text-decoration: none;
}

.tp-tools-hub-item strong {
	color: var(--tp-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.tp-tools-hub-item small {
	color: var(--tp-muted);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Trust band */
.tp-trust-band {
	padding: 18px 0 28px;
	background: var(--tp-bg);
}

.tp-trust-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.tp-trust-item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
}

.tp-trust-item span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: #e8f3fc;
	color: var(--tp-primary);
	font-weight: 700;
}

.tp-trust-item strong {
	color: var(--tp-text);
	font-size: 14px;
}

.tp-trust-item p {
	margin: 2px 0 0;
	font-size: 13px;
	line-height: 1.35;
}

/* Posts */
.tp-post-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.tp-post-list {
	display: grid;
	gap: 12px;
}

.tp-post-excerpt {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 16px;
	align-items: stretch;
	padding: 14px;
}

.tp-post-excerpt-thumb {
	display: block;
	min-height: 150px;
	border-radius: 8px;
	overflow: hidden;
	background: #eef3f8;
}

.tp-post-excerpt-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tp-post-excerpt > div {
	min-width: 0;
}

.tp-post-card h2,
.tp-post-card h3,
.tp-post-excerpt h2 {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.38;
}

.tp-post-excerpt h2 a {
	color: var(--tp-text);
}

.tp-post-meta {
	margin: 0 0 8px;
	color: var(--tp-soft);
	font-size: 13px;
}

.tp-excerpt,
.tp-excerpt p {
	margin: 0;
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.5;
}

.tp-read-more {
	display: inline-flex;
	margin-top: 8px;
	font-size: 14px;
	font-weight: 700;
}

.tp-related-posts {
	padding: 0;
}

.tp-related-posts > h2 {
	margin: 0;
	padding: 14px 16px;
	border-bottom: 1px solid var(--tp-border);
	color: var(--tp-text);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.35;
}

.tp-related-post-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	padding: 14px 16px;
}

.tp-related-post-list a {
	display: grid;
	gap: 5px;
	min-height: 76px;
	padding: 12px;
	border: 1px solid var(--tp-border-soft);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-text);
}

.tp-related-post-list a:hover {
	border-color: rgba(11, 127, 195, .35);
	background: #f8fafc;
}

.tp-related-post-list strong {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.tp-related-post-list span {
	color: var(--tp-muted);
	font-size: 13px;
}

.navigation.pagination {
	margin-top: 4px;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.nav-links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--tp-border);
	border-radius: 8px;
	background: #fff;
	color: var(--tp-text);
	font-size: 14px;
	font-weight: 700;
}

.nav-links .page-numbers.current,
.nav-links .page-numbers:hover {
	border-color: var(--tp-primary);
	background: var(--tp-primary);
	color: #fff;
}

.tp-empty-state {
	padding: 16px;
}

.tp-empty-state p {
	margin: 0;
}

/* Footer */
.tp-site-footer {
	background: #fff;
	border-top: 1px solid var(--tp-border);
}

.tp-footer-top {
	display: grid;
	grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(160px, .8fr));
	gap: 28px;
	padding: 28px 0;
}

.tp-footer-about p {
	margin: 12px 0 0;
	max-width: 420px;
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.55;
}

.tp-footer-links {
	display: grid;
	align-content: start;
	gap: 7px;
}

.tp-footer-links h2 {
	margin: 0 0 8px;
	color: var(--tp-text);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.tp-footer-links a {
	color: var(--tp-muted);
	font-size: 14px;
	line-height: 1.35;
}

.tp-footer-bottom {
	border-top: 1px solid var(--tp-border-soft);
	background: #fff;
}

.tp-footer-bottom-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
}

.tp-footer-bottom p {
	margin: 0;
	color: var(--tp-muted);
	font-size: 13px;
}

.tp-footer-bottom nav {
	display: flex;
	gap: 12px;
}

.tp-footer-bottom a {
	color: var(--tp-muted);
	font-size: 13px;
}

/* Responsive */
@media (max-width: 1080px) {
	.tp-header-inner {
		grid-template-columns: auto 1fr;
	}

	.tp-nav {
		position: fixed;
		inset: 65px 12px auto;
		display: none;
		justify-self: stretch;
		max-height: calc(100vh - 84px);
		overflow-y: auto;
		padding: 10px;
		background: #fff;
		border: 1px solid var(--tp-border);
		border-radius: var(--tp-radius);
		box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
	}

	.tp-nav.is-open {
		display: block;
	}

	.tp-menu {
		display: grid;
		justify-content: stretch;
	}

	.tp-menu a {
		justify-content: flex-start;
		width: 100%;
	}

	.tp-menu .sub-menu {
		position: static;
		display: none;
		grid-template-columns: 1fr;
		min-width: 0;
		width: auto;
		max-height: 45vh;
		overflow-y: auto;
		margin: 2px 0 4px 12px;
		padding: 4px;
		border: 0;
		box-shadow: none;
		transform: none;
	}

	.tp-header-tools {
		justify-self: end;
	}

	.tp-icon-button {
		display: inline-flex;
	}

	.tp-layout {
		grid-template-columns: 1fr;
	}

	.tp-hero-grid {
		grid-template-columns: 1fr;
	}

	.tp-hero-art {
		display: none;
	}

	.tp-trust-grid,
	.tp-footer-top {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	body {
		font-size: 15px;
	}

	.tp-container {
		width: min(100% - 24px, 1180px);
	}

	.tp-header-inner {
		min-height: 60px;
		gap: 10px;
	}

	.tp-logo-text small {
		display: none;
	}

	.tp-header-search {
		display: none;
	}

	.tp-hero {
		padding: 18px 0 6px;
	}

	.tp-hero h1 {
		font-size: 28px;
	}

	.tp-hero-kicker {
		font-size: 17px;
	}

	.tp-layout {
		gap: 12px;
		padding: 12px 0 30px;
	}

	.tp-main-column,
	.tp-sidebar {
		gap: 12px;
	}

	.tp-section-heading,
	.tp-card-heading,
	.tp-quick-tools > h2,
	.tp-trust-card > h2,
	.tp-tips > h2,
	.tp-formula-section > .tp-section-heading,
	.tp-faq-section > .tp-section-heading,
	.tp-related-tools > h2,
	.tp-tool-examples > h2,
	.tp-tool-helpers > h2,
	.tp-howto > h2,
	.tp-tool-formula > h2 {
		padding: 13px 14px;
	}

	.tp-section-heading h2,
	.tp-card-heading h2,
	.tp-quick-tools > h2,
	.tp-trust-card > h2,
	.tp-tips > h2,
	.tp-related-tools > h2,
	.tp-tool-examples > h2,
	.tp-tool-helpers > h2,
	.tp-howto > h2,
	.tp-tool-formula > h2 {
		font-size: 18px;
	}

	.tp-main-calculator,
	.tp-tool-calculator,
	.tp-tool-intro,
	.tp-page-card,
	.tp-post-card,
	.tp-archive-header,
	.tp-not-found {
		padding: 16px;
	}

	.tp-tool-intro h1,
	.tp-page-header h1,
	.tp-archive-header h1,
	.tp-not-found h1 {
		font-size: 28px;
	}

	.tp-fields,
	.tp-fields--1,
	.tp-fields--2,
	.tp-fields--3,
	.tp-calculator--card .tp-fields,
	.tp-calculator--card .tp-fields--1,
	.tp-calculator--card .tp-fields--2,
	.tp-calculator--card .tp-fields--3 {
		grid-template-columns: 1fr;
	}

	.tp-calculator--main .tp-result-value,
	.tp-calculator--full .tp-result-value {
		font-size: 30px;
	}

	.tp-calculator-actions,
	.tp-card-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tp-button,
	.tp-action-button {
		width: 100%;
	}

	.tp-formula-box,
	.tp-tool-guidance,
	.tp-formula-summary,
	.tp-formula-cards,
	.tp-formula-examples,
	.tp-formula-split,
	.tp-formula-tool-links,
	.tp-related-grid,
	.tp-related-post-list,
	.tp-formula-list li,
	.tp-tools-hub-stats,
	.tp-tools-hub-list,
	.tp-trust-grid,
	.tp-post-grid,
	.tp-footer-top {
		grid-template-columns: 1fr;
	}

	.tp-tools-hub-item {
		grid-template-columns: 34px minmax(0, 1fr);
		align-items: start;
	}

	.tp-post-excerpt {
		grid-template-columns: 1fr;
	}

	.tp-post-excerpt-thumb {
		min-height: 190px;
	}

	.tp-formula-box > div:first-child,
	.tp-tool-guidance > div,
	.tp-formula-split > div {
		border-right: 0;
	}

	.tp-tool-guidance > div,
	.tp-formula-split > div {
		border-bottom: 1px solid var(--tp-border-soft);
	}

	.tp-tool-guidance > div:last-child,
	.tp-formula-split > div:last-child {
		border-bottom: 0;
	}

	.tp-formula-hero,
	.tp-formula-block {
		border-radius: 8px;
	}

	.tp-formula-hero,
	.tp-formula-block > header,
	.tp-formula-table,
	.tp-formula-cards,
	.tp-formula-examples,
	.tp-formula-split > div,
	.tp-formula-tool-links {
		padding: 14px;
	}

	.tp-formula-block h2 {
		font-size: 18px;
	}

	.tp-formula-table table {
		min-width: 680px;
	}

	.tp-helper-link {
		grid-template-columns: 34px minmax(0, 1fr);
		align-items: start;
	}

	.tp-helper-link-action {
		grid-column: 2;
	}

	.tp-related-grid a {
		grid-template-columns: 34px minmax(0, 1fr);
		align-items: start;
	}

	.tp-footer-bottom-inner {
		display: grid;
		justify-items: start;
	}
}

@media (max-width: 420px) {
	.tp-calculator-actions,
	.tp-card-actions {
		grid-template-columns: 1fr;
	}
}
