/**
 * Published Documents — compact tabs + footer-style links + view-only modal.
 * Keep selectors strong enough to beat Agrarium button / list chrome.
 */

.footer-ziran .zf-docs {
	margin-top: 1.35rem;
	padding-top: 1.1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-ziran .zf-docs__title {
	margin: 0 0 0.55rem;
	font-size: 0.92rem;
}

/* Text tabs — never theme buttons */
.footer-ziran .zf-docs__tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	margin: 0 0 0.7rem;
	padding: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.body-container .footer-ziran a.zf-docs__tab,
.footer-ziran a.zf-docs__tab {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0.4rem 0.7rem 0.5rem;
	min-width: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	border-bottom: 2px solid transparent !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: rgba(255, 255, 255, 0.55) !important;
	font: inherit;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	line-height: 1.2;
	text-decoration: none !important;
	text-align: center;
	cursor: pointer;
	overflow: visible;
	z-index: 1;
	transition: color 0.15s ease, border-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.body-container .footer-ziran a.zf-docs__tab::before,
.body-container .footer-ziran a.zf-docs__tab::after,
.footer-ziran a.zf-docs__tab::before,
.footer-ziran a.zf-docs__tab::after {
	content: none !important;
	display: none !important;
}

.body-container .footer-ziran a.zf-docs__tab:hover,
.body-container .footer-ziran a.zf-docs__tab:focus-visible,
.footer-ziran a.zf-docs__tab:hover,
.footer-ziran a.zf-docs__tab:focus-visible {
	color: rgba(255, 255, 255, 0.92) !important;
	background: transparent !important;
	outline: none;
	box-shadow: none !important;
}

.body-container .footer-ziran a.zf-docs__tab.is-active,
.footer-ziran a.zf-docs__tab.is-active {
	color: #eece38 !important;
	border-bottom-color: #eece38 !important;
	background: transparent !important;
}

.footer-ziran .zf-docs__panels {
	min-height: 0;
}

.footer-ziran .zf-docs__panel[hidden] {
	display: none !important;
}

.footer-ziran .zf-docs__list {
	list-style: none !important;
	margin: 0;
	padding: 0 !important;
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.1rem 1.25rem;
	max-height: 8.5rem;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

@media (min-width: 560px) {
	.footer-ziran .zf-docs__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1100px) {
	.footer-ziran .zf-docs__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		max-height: 7.5rem;
	}
}

.footer-ziran .zf-docs__list::-webkit-scrollbar {
	width: 3px;
}

.footer-ziran .zf-docs__list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 999px;
}

.footer-ziran .zf-docs__list li {
	position: static;
	margin: 0;
	padding: 0 !important;
	min-width: 0;
	list-style: none !important;
}

.footer-ziran .zf-docs__list li::before,
.footer-ziran .zf-docs__list li::after {
	content: none !important;
	display: none !important;
}

/* Match Quick Links — plain text anchors */
.body-container .footer-ziran a.zf-docs__link,
.footer-ziran a.zf-docs__link {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	padding: 0.18rem 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: rgba(255, 255, 255, 0.7) !important;
	font-size: 0.82rem;
	font-weight: 500;
	line-height: 1.35;
	text-decoration: none !important;
	text-align: left;
	cursor: pointer;
	transition: color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
	overflow: hidden;
	min-width: 0 !important;
}

.body-container .footer-ziran a.zf-docs__link::before,
.body-container .footer-ziran a.zf-docs__link::after,
.footer-ziran a.zf-docs__link::before,
.footer-ziran a.zf-docs__link::after {
	content: none !important;
	display: none !important;
}

.body-container .footer-ziran a.zf-docs__link:hover,
.body-container .footer-ziran a.zf-docs__link:focus-visible,
.footer-ziran a.zf-docs__link:hover,
.footer-ziran a.zf-docs__link:focus-visible {
	color: var(--zh-orange, #e87722) !important;
	outline: none;
	background: transparent !important;
	box-shadow: none !important;
}

/* ========== View-only modal ========== */
.ziran-doc-viewer {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
}

.ziran-doc-viewer[hidden] {
	display: none !important;
}

.ziran-doc-viewer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 18, 32, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.ziran-doc-viewer__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(980px, 100%);
	height: min(90dvh, 900px);
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.ziran-doc-viewer__topbar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 0.85rem;
	background: #0b1220;
	color: #fff;
}

.ziran-doc-viewer__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	padding-right: 0.5rem;
	text-wrap: balance;
}

.body-container .ziran-doc-viewer__close,
.ziran-doc-viewer__close {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 2.5rem !important;
	height: 2.5rem !important;
	min-width: 44px !important;
	min-height: 44px !important;
	padding: 0 !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	border-radius: 8px !important;
	background: rgba(255, 255, 255, 0.08) !important;
	background-color: rgba(255, 255, 255, 0.08) !important;
	color: #fff !important;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
	overflow: visible;
}

.body-container .ziran-doc-viewer__close::before,
.body-container .ziran-doc-viewer__close::after,
.ziran-doc-viewer__close::before,
.ziran-doc-viewer__close::after {
	content: none !important;
	display: none !important;
}

.body-container .ziran-doc-viewer__close:hover,
.body-container .ziran-doc-viewer__close:focus-visible,
.ziran-doc-viewer__close:hover,
.ziran-doc-viewer__close:focus-visible {
	background: #eece38 !important;
	background-color: #eece38 !important;
	border-color: #eece38 !important;
	color: #111 !important;
	outline: none;
	box-shadow: none !important;
}

.ziran-doc-viewer__frame-wrap {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	background: #e5e7eb;
	overflow: hidden;
}

.ziran-doc-viewer__frame-wrap::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 140px;
	height: 48px;
	z-index: 2;
	pointer-events: auto;
	background: transparent;
}

.ziran-doc-viewer__frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}

.ziran-doc-viewer__hint {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.55rem 0.9rem;
	font-size: 0.75rem;
	color: #64748b;
	background: #f8fafc;
	border-top: 1px solid #e5e7eb;
	text-align: center;
}

html.ziran-doc-viewer-open,
html.ziran-doc-viewer-open body {
	overflow: hidden;
}

@media (max-width: 559px) {
	.footer-ziran .zf-docs__tab {
		padding: 0.5rem 0.55rem 0.55rem;
		font-size: 0.68rem;
	}

	.footer-ziran .zf-docs__list {
		max-height: 9rem;
	}

	.body-container .footer-ziran a.zf-docs__link,
	.footer-ziran a.zf-docs__link {
		padding: 0.35rem 0;
		font-size: 0.84rem;
	}
}

@media (max-width: 640px) {
	.ziran-doc-viewer {
		padding: 0;
		align-items: flex-end;
	}

	.ziran-doc-viewer__dialog {
		width: 100%;
		height: min(94dvh, 900px);
		border-radius: 14px 14px 0 0;
	}

	.ziran-doc-viewer__title {
		font-size: 0.88rem;
	}
}
