/*
 * テーマ側のbutton・svg・table指定からランキングUIを保護します。
 * ショートコード内だけに適用されます。
 */
.wbpr-wrap,
.wbpr-wrap *,
.wbpr-wrap *::before,
.wbpr-wrap *::after {
	box-sizing: border-box;
}

.wbpr-wrap .wbpr-tab-shell,
.wbpr-wrap .wbpr-tab-list,
.wbpr-wrap .wbpr-search-wrap,
.wbpr-wrap .wbpr-ranking {
	width: 100%;
	max-width: 100%;
}

.wbpr-wrap button.wbpr-tab-button {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	min-height: 74px !important;
	margin: 0 !important;
	padding: 0.85rem 0.95rem !important;
	border-width: 1px !important;
	border-style: solid !important;
	border-radius: 14px !important;
	font-family: inherit !important;
	font-size: 1rem !important;
	font-style: normal !important;
	line-height: 1.35 !important;
	letter-spacing: normal !important;
	text-indent: 0 !important;
	text-transform: none !important;
	white-space: normal !important;
}

.wbpr-wrap .wbpr-tab-button .wbpr-tab-icon {
	display: grid !important;
	flex: 0 0 42px !important;
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	max-width: 42px !important;
	min-height: 42px !important;
	max-height: 42px !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
}

.wbpr-wrap .wbpr-tab-button .wbpr-tab-icon > svg,
.wbpr-wrap .wbpr-search-icon > svg {
	display: block !important;
	width: 22px !important;
	height: 22px !important;
	min-width: 22px !important;
	max-width: 22px !important;
	min-height: 22px !important;
	max-height: 22px !important;
	margin: 0 !important;
	padding: 0 !important;
}

.wbpr-wrap .wbpr-tab-copy {
	flex: 1 1 auto;
	width: auto;
}

.wbpr-wrap table.wbpr-table {
	margin: 0 !important;
}

.wbpr-wrap {
	--wbpr-border: #dbe3ef;
	--wbpr-muted: #667085;
	--wbpr-text: #172033;
	--wbpr-bg: #f7f9fc;
	--wbpr-accent: #2563eb;
	--wbpr-accent-dark: #1747b8;
	--wbpr-accent-soft: #eff6ff;
	--wbpr-shadow: 0 14px 38px rgba(24, 45, 82, 0.09);
	color: var(--wbpr-text);
	margin: 1.5rem 0;
}

.wbpr-tab-shell {
	position: relative;
	padding: 0.65rem;
	margin-bottom: 1rem;
	border: 1px solid #dce6f5;
	border-radius: 18px;
	background: linear-gradient(135deg, #f8fbff 0%, #edf4ff 100%);
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.wbpr-tab-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.65rem;
}

.wbpr-tab-button {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
	min-height: 74px;
	padding: 0.85rem 0.95rem;
	border: 1px solid transparent;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.74);
	color: #344054;
	font: inherit;
	text-align: left;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.wbpr-tab-button:hover {
	transform: translateY(-2px);
	border-color: #bfd2f4;
	background: #fff;
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.11);
}

.wbpr-tab-button.is-active {
	border-color: #8cb3f3;
	background: #fff;
	color: var(--wbpr-accent-dark);
	box-shadow: 0 10px 25px rgba(37, 99, 235, 0.16), inset 0 -3px 0 var(--wbpr-accent);
}

.wbpr-tab-icon {
	display: grid;
	place-items: center;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: var(--wbpr-accent-soft);
	color: var(--wbpr-accent);
	transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.wbpr-tab-button.is-active .wbpr-tab-icon {
	background: linear-gradient(135deg, #2563eb, #1747b8);
	color: #fff;
	transform: scale(1.04);
}

.wbpr-tab-icon svg,
.wbpr-search-icon svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wbpr-tab-copy,
.wbpr-tab-label,
.wbpr-tab-hint {
	display: block;
	min-width: 0;
}

.wbpr-tab-label {
	font-size: 0.98rem;
	font-weight: 750;
	line-height: 1.35;
}

.wbpr-tab-hint {
	margin-top: 0.2rem;
	color: var(--wbpr-muted);
	font-size: 0.78rem;
	font-weight: 500;
}

.wbpr-tab-button:focus-visible,
.wbpr-search:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.28);
	outline-offset: 2px;
}

.wbpr-search-wrap {
	position: relative;
	margin: 0 0 1rem;
}

.wbpr-search-icon {
	position: absolute;
	left: 0.95rem;
	top: 50%;
	display: grid;
	place-items: center;
	color: #7b879b;
	transform: translateY(-50%);
	pointer-events: none;
}

.wbpr-search-icon svg {
	width: 19px;
	height: 19px;
}

.wbpr-search {
	width: 100%;
	min-height: 48px;
	padding: 0.72rem 1rem 0.72rem 3rem;
	border: 1px solid var(--wbpr-border);
	border-radius: 12px;
	background: #fff;
	color: var(--wbpr-text);
	font: inherit;
	box-shadow: 0 4px 14px rgba(16, 24, 40, 0.05);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wbpr-search:focus {
	border-color: #8bb1ee;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.09);
}

.wbpr-tab-panel[hidden] {
	display: none !important;
}

.wbpr-tab-panel.is-active {
	animation: wbpr-fade-in 0.22s ease;
}

@keyframes wbpr-fade-in {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

.wbpr-ranking {
	overflow: hidden;
	border: 1px solid var(--wbpr-border);
	border-radius: 16px;
	background: #fff;
	box-shadow: var(--wbpr-shadow);
}

.wbpr-header {
	padding: 1.25rem 1.35rem;
	border-bottom: 1px solid var(--wbpr-border);
	background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

.wbpr-heading-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.wbpr-title {
	margin: 0;
	font-size: clamp(1.25rem, 2.2vw, 1.7rem);
	line-height: 1.4;
}

.wbpr-count {
	flex: 0 0 auto;
	margin-top: 0.15rem;
	padding: 0.32rem 0.68rem;
	border: 1px solid #cdddf7;
	border-radius: 999px;
	background: var(--wbpr-accent-soft);
	color: var(--wbpr-accent-dark);
	font-size: 0.78rem;
	font-weight: 700;
	white-space: nowrap;
}

.wbpr-description,
.wbpr-notes,
.wbpr-country-en {
	color: var(--wbpr-muted);
}

.wbpr-description {
	margin: 0.55rem 0 0;
	line-height: 1.75;
}

.wbpr-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.wbpr-table {
	width: 100%;
	min-width: 680px;
	border-collapse: separate;
	border-spacing: 0;
	font-variant-numeric: tabular-nums;
}

.wbpr-table th,
.wbpr-table td {
	padding: 0.82rem 0.9rem;
	border: 0;
	border-bottom: 1px solid #e8edf4;
	vertical-align: middle;
}

.wbpr-table th {
	background: #f5f8fc;
	color: #344054;
	text-align: left;
	font-size: 0.87rem;
	font-weight: 750;
	letter-spacing: 0.01em;
}

.wbpr-table tbody tr {
	background: #fff;
	transition: background 0.16s ease, transform 0.16s ease;
}

.wbpr-table tbody tr:nth-child(even) {
	background: #fbfcfe;
}

.wbpr-table tbody tr:hover {
	background: #f3f7ff;
}

.wbpr-table tbody tr:last-child td {
	border-bottom: 0;
}

.wbpr-rank-col {
	width: 74px;
	white-space: nowrap;
	text-align: center !important;
}

.wbpr-year-col {
	width: 112px;
	white-space: nowrap;
	text-align: center !important;
}

.wbpr-value-col {
	white-space: nowrap;
	text-align: right !important;
}

.wbpr-country-col {
	min-width: 180px;
}

.wbpr-country-name,
.wbpr-country-en {
	display: block;
}

.wbpr-country-name {
	font-weight: 650;
}

.wbpr-country-en {
	margin-top: 0.18rem;
	font-size: 0.78em;
}

.wbpr-rank-badge {
	display: inline-grid;
	place-items: center;
	min-width: 34px;
	height: 30px;
	padding: 0 0.45rem;
	border-radius: 9px;
	background: #eef2f7;
	color: #475467;
	font-size: 0.88rem;
	font-weight: 750;
}

.wbpr-rank-1 {
	background: linear-gradient(135deg, #fff2b8, #f7c948);
	color: #6f4d00;
}

.wbpr-rank-2 {
	background: linear-gradient(135deg, #f1f4f8, #c7d0dc);
	color: #3e4c59;
}

.wbpr-rank-3 {
	background: linear-gradient(135deg, #f6d2bb, #d99568);
	color: #683514;
}

.wbpr-notes {
	padding: 0.95rem 1.35rem 1.1rem;
	border-top: 1px solid var(--wbpr-border);
	background: #fbfcfe;
	font-size: 0.86em;
	line-height: 1.7;
}

.wbpr-notes p {
	margin: 0.25rem 0;
}

.wbpr-notes a {
	color: var(--wbpr-accent-dark);
	font-weight: 650;
}

.wbpr-empty,
.wbpr-no-results,
.wbpr-error {
	margin: 1rem;
	padding: 0.95rem 1rem;
	border: 1px solid #cdddf7;
	border-left: 4px solid var(--wbpr-accent);
	border-radius: 10px;
	background: var(--wbpr-accent-soft);
}

@media (max-width: 760px) {
	.wbpr-tab-list {
		display: flex;
		overflow-x: auto;
		padding-bottom: 0.2rem;
		scroll-snap-type: x proximity;
	}

	.wbpr-tab-button {
		flex: 0 0 230px;
		scroll-snap-align: start;
	}

	.wbpr-heading-row {
		align-items: flex-start;
		flex-direction: column;
		gap: 0.55rem;
	}

	.wbpr-header {
		padding: 1rem;
	}

	.wbpr-notes {
		padding-right: 1rem;
		padding-left: 1rem;
	}
}

@media (max-width: 480px) {
	.wbpr-tab-shell {
		margin-right: -0.25rem;
		margin-left: -0.25rem;
		padding: 0.5rem;
		border-radius: 14px;
	}

	.wbpr-tab-button {
		flex-basis: 210px;
		min-height: 68px;
		padding: 0.72rem 0.8rem;
	}

	.wbpr-tab-icon {
		flex-basis: 38px;
		width: 38px;
		height: 38px;
	}

	.wbpr-search {
		font-size: 16px;
	}
}

@media (max-width: 760px) {
	.wbpr-wrap button.wbpr-tab-button {
		flex: 0 0 230px !important;
		width: 230px !important;
	}
}

@media (max-width: 480px) {
	.wbpr-wrap button.wbpr-tab-button {
		flex-basis: 210px !important;
		width: 210px !important;
		min-height: 68px !important;
		padding: 0.72rem 0.8rem !important;
	}

	.wbpr-wrap .wbpr-tab-button .wbpr-tab-icon {
		flex-basis: 38px !important;
		width: 38px !important;
		height: 38px !important;
		min-width: 38px !important;
		max-width: 38px !important;
		min-height: 38px !important;
		max-height: 38px !important;
	}
}
