/* NP Nilsson Beräkningshjälpen v2 */
.npnc {
	--npnc-blue: var(--wp--preset--color--primary, #004EA0);
	--npnc-ink: #1a1a1a;
	--npnc-line: #e4e6ea;
	--npnc-soft: #f4f5f7;
	display: flex;
	flex-direction: column;
	gap: clamp(1.5rem, 3vw, 2.5rem);
	max-width: 1000px;
}

.npnc * { box-sizing: border-box; }

.npnc-card {
	background: #fff;
	border: 1px solid var(--npnc-line);
	border-radius: 16px;
	box-shadow: 0 2px 18px rgba(20, 30, 50, 0.05);
	overflow: hidden;
}
.npnc-card__title {
	margin: 0;
	padding: 1.1rem clamp(1.1rem, 3vw, 1.75rem);
	font-size: 1.05rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--npnc-ink);
	border-bottom: 1px solid var(--npnc-line);
}

/* Flikar */
.npnc-tablist {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0.9rem clamp(1.1rem, 3vw, 1.75rem);
	background: var(--npnc-soft);
	border-bottom: 1px solid var(--npnc-line);
}
.npnc-tab {
	border: 0;
	background: #fff;
	color: var(--npnc-ink);
	padding: 0.55rem 1.1rem;
	border-radius: 999px;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
	border: 1px solid var(--npnc-line);
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.npnc-tab:hover { border-color: var(--npnc-blue); color: var(--npnc-blue); }
.npnc-tab.is-active {
	background: var(--npnc-blue);
	border-color: var(--npnc-blue);
	color: #fff;
}

.npnc-panel { display: none; padding: clamp(1.25rem, 3vw, 2rem); }
.npnc-panel.is-active { display: block; }

/* Räknar-layout: bild/hjälp + fält */
.npnc-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(1.25rem, 3vw, 2.5rem);
	align-items: start;
	margin: 0;
}
.npnc-media img {
	width: 100%;
	max-width: 320px;
	height: auto;
	display: block;
	margin-bottom: 1rem;
}
.npnc-help { margin: 0; color: #555; font-size: 0.95rem; line-height: 1.55; }

.npnc-fields { display: flex; flex-direction: column; gap: 0.9rem; }
.npnc-field { display: flex; flex-direction: column; gap: 0.3rem; }
.npnc-field span { font-size: 0.85rem; font-weight: 600; color: #555; }
.npnc-field input {
	border: 1px solid #ccd1d9;
	border-radius: 10px;
	padding: 0.65rem 0.8rem;
	font: inherit;
	font-size: 1rem;
	width: 100%;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.npnc-field input:focus {
	outline: none;
	border-color: var(--npnc-blue);
	box-shadow: 0 0 0 3px rgba(0, 78, 160, 0.12);
}

.npnc-btn {
	align-self: flex-start;
	margin-top: 0.25rem;
	border: 0;
	background: var(--npnc-blue);
	color: #fff;
	font: inherit;
	font-weight: 600;
	padding: 0.7rem 1.6rem;
	border-radius: 999px;
	cursor: pointer;
	transition: filter 0.15s, transform 0.05s;
}
.npnc-btn:hover { filter: brightness(1.08); }
.npnc-btn:active { transform: translateY(1px); }

.npnc-result {
	display: none;
	margin-top: 0.4rem;
	padding: 0.85rem 1.1rem;
	background: rgba(0, 78, 160, 0.07);
	border-left: 3px solid var(--npnc-blue);
	border-radius: 8px;
	font-weight: 600;
	color: var(--npnc-ink);
}
.npnc-result.is-shown { display: block; }
.npnc-result.is-error { background: rgba(180, 40, 40, 0.07); border-left-color: #b42828; color: #8a1f1f; font-weight: 500; }

/* Materialtabeller */
.npnc-table { overflow-x: auto; }
.npnc-table table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.npnc-table td, .npnc-table th { border: 1px solid var(--npnc-line); padding: 0.5rem 0.7rem; text-align: left; vertical-align: middle; }
.npnc-table tr:nth-child(even) td { background: var(--npnc-soft); }
.npnc-table font { font-size: inherit !important; }

@media (max-width: 680px) {
	.npnc-form { grid-template-columns: 1fr; }
	.npnc-media img { max-width: 240px; }
}
