/* Theme variables */
:root {
	--bg-app: #f6f7fb;
	--bg-card: #ffffff;
	--bg-plate: #eef1f7;
	--bg-input: rgba(15, 23, 42, 0.05);
	--bg-input-hover: rgba(15, 23, 42, 0.08);
	--text-primary: #0f172a;
	--text-secondary: #6b7280;
	--accent: #3b82f6;
	--accent-hover: #2563eb;
	--border-light: rgba(15, 23, 42, 0.08);
	--shadow-card: none;
	--shadow-flyout: none;
	--accent-soft: rgba(59, 130, 246, 0.14);
	--glass-surface: rgba(255, 255, 255, 0.82);
	--glow-accent: 0 18px 48px rgba(59, 130, 246, 0.32);
	--radius-card: 22px;
	--radius-input: 14px;
	--transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.dark-mode {
	--bg-app: #0b1020;
	--bg-card: #111827;
	--bg-plate: #0f1624;
	--bg-input: rgba(255, 255, 255, 0.06);
	--bg-input-hover: rgba(255, 255, 255, 0.1);
	--text-primary: #e5e7eb;
	--text-secondary: #9ca3af;
	--accent: #60a5fa;
	--accent-hover: #93c5fd;
	--border-light: rgba(255,255,255,0.08);
	--shadow-card: none;
	--accent-soft: rgba(96, 165, 250, 0.18);
	--glass-surface: rgba(17, 23, 39, 0.72);
	--glow-accent: 0 18px 48px rgba(96, 165, 250, 0.35);
}

/* Base */
body {
	background-color: var(--bg-app);
	color: var(--text-primary);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	line-height: 1.6;
	font-size: clamp(15px, 1vw + 0.5rem, 16px);
	transition: background-color var(--transition), color var(--transition);
}

body::before {
	content: none;
}

body.dark-mode::before {
	content: none;
}

.app-container {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding-inline: clamp(1rem, 4vw, 3rem);
}

img, picture, video, canvas {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Typography */
h1, h2, h3, h4, h5 {
	letter-spacing: -0.015em;
}

.title-text {
	font-size: clamp(2rem, 3vw, 2.6rem);
	letter-spacing: -0.03em;
	font-weight: 800;
	line-height: 1.1;
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
}


.subtitle-text {
	font-size: clamp(0.98rem, 1.4vw, 1.1rem);
	font-weight: 400;
	max-width: 38rem;
}

.detail-text {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	color: var(--text-secondary);
	text-transform: uppercase;
}

.hint-link {
	font-size: 0.9rem;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.text-primary {
	color: var(--accent) !important;
}

.text-secondary {
	color: var(--text-secondary) !important;
}

.header-bar {
	gap: 1.25rem;
	flex-wrap: wrap;
}

.header-actions {
	gap: 0.5rem;
}

/* Cards */
.app-card {
	background: var(--bg-card);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	border: 1px solid var(--border-light);
	padding: clamp(1.2rem, 2vw + 0.5rem, 1.6rem);
	transition: transform 0.35s ease, box-shadow 0.35s ease, background-color var(--transition), border-color 0.3s ease;
	position: relative;
	overflow: hidden;
}

.app-card:hover {
	box-shadow: var(--shadow-flyout);
	border-color: rgba(59, 130, 246, 0.22);
}

/* Buttons */
.btn-primary {
	background: var(--accent);
	border: 1px solid transparent;
	box-shadow: none;
	color: #fff;
	border-radius: 14px;
	padding-inline: 1.1rem;
	font-weight: 700;
}

.btn-primary:hover {
	filter: brightness(1.03);
	box-shadow: none;
}

.btn-outline-secondary,
.btn-outline-info,
.btn-secondary {
	border-color: var(--border-light);
	background-color: rgba(255,255,255,0.38);
	color: var(--text-primary);
	transition: all 0.2s ease;
	backdrop-filter: blur(10px);
	border-radius: 14px;
	box-shadow: none;
}

.btn-outline-secondary:hover,
.btn-outline-info:hover,
.btn-secondary:hover {
	border-color: var(--accent);
	color: var(--text-primary);
	background-color: var(--accent-soft);
}

.btn-outline-info {
	color: var(--accent);
	border-color: rgba(0, 113, 227, 0.35);
	background-color: rgba(0, 113, 227, 0.05);
}

.btn-outline-info:hover {
	color: var(--accent-hover);
	border-color: rgba(0, 113, 227, 0.55);
	background-color: var(--accent-soft);
}

.btn-outline-danger {
	border-color: rgba(255, 59, 48, 0.35);
	color: #d7263d;
	background: rgba(255, 59, 48, 0.06);
}

.btn-outline-danger:hover {
	border-color: rgba(255, 59, 48, 0.55);
	background: rgba(255, 59, 48, 0.12);
	color: #c1162d;
}

/* Export menu */
.export-btn {
	background: rgba(255,255,255,0.9);
	border: 1px solid var(--border-light);
	box-shadow: none;
	color: var(--text-primary);
	backdrop-filter: blur(10px);
}

.dark-mode .export-btn {
	background: linear-gradient(135deg, rgba(40,40,42,0.9), rgba(32,32,34,0.9));
	box-shadow: 0 10px 34px rgba(0,0,0,0.45);
}

.export-btn:hover {
	color: var(--text-primary);
	box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}

.dropdown-menu {
	background: var(--bg-card);
	color: var(--text-primary);
	border: 1px solid var(--border-light);
	box-shadow: none;
	backdrop-filter: blur(8px);
	padding: 0.35rem;
}

.dark-mode .dropdown-menu {
	background: linear-gradient(145deg, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.88));
	border-color: var(--border-light);
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

.dropdown-item {
	border-radius: 12px;
	margin: 2px 4px;
	color: var(--text-primary);
	background-color: transparent;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.dropdown-item:hover {
	background-color: var(--accent-soft);
	color: var(--text-primary);
	transform: translateY(-1px);
}

.dark-mode .dropdown-item,
.dark-mode .dropdown-item i {
	color: var(--text-primary);
}

.dark-mode .dropdown-item:hover,
.dark-mode .dropdown-item:focus {
	background-color: var(--accent-soft);
	color: var(--text-primary);
}

.dark-mode .dropdown-item.disabled,
.dark-mode .dropdown-item:disabled {
	color: var(--text-secondary);
	opacity: 0.75;
}

.dropdown-menu .dropdown-divider {
	border-color: var(--border-light);
}

/* Inputs */
.app-input {
	width: 100%;
	background-color: var(--bg-input);
	border: 1.5px solid transparent;
	border-radius: var(--radius-input);
	padding: 0.875rem 1.1rem;
	font-size: 1rem;
	min-height: 3rem;
	color: var(--text-primary);
	transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
	outline: none;
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.app-input::placeholder {
	color: var(--text-secondary);
	opacity: 0.7;
}

.app-input:hover {
	background-color: var(--bg-input-hover);
}

.app-input:focus {
	background-color: var(--bg-card);
	border-color: var(--accent);
	box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.16);
	transform: translateY(-1px);
}

.dark-mode .app-input:focus {
	box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
}

.output-wrapper .app-input {
	padding-right: 3.1rem;
}

.copy-button {
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
}

/* Segmented control */
.segmented-control {
	display: flex;
	background-color: var(--bg-input);
	border-radius: calc(var(--radius-input) + 2px);
	padding: 4px;
	position: relative;
}

.segment-btn {
	flex: 1;
	background: transparent;
	border: none;
	border-radius: var(--radius-input);
	padding: 10px 0;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--text-secondary);
	cursor: pointer;
	position: relative;
	z-index: 2;
	transition: color 0.3s ease;
}

.segment-btn.active {
	background-color: var(--bg-card);
	color: var(--text-primary);
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Upload area */
.upload-zone {
	background: rgba(255, 255, 255, 0.75);
	border: 1.5px dashed var(--border-light);
	border-radius: var(--radius-input);
	position: relative;
	transition: all 0.2s ease;
	overflow: hidden;
	padding: 0.75rem 1.1rem;
	min-height: 3.25rem;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
}

.upload-zone:hover {
	background-color: var(--bg-input-hover);
	border-color: var(--accent);
	box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12);
}

.upload-zone input {
	opacity: 0;
	inset: 0;
	cursor: pointer;
}

.upload-zone-label,
.upload-zone-icon {
	pointer-events: none;
}

.upload-zone-label {
	flex: 1 1 auto;
}

.upload-label-text {
	font-size: 1rem;
}

.pill-action {
	font-size: 0.9rem;
	transition: background-color 0.2s ease;
	min-height: 2.6rem;
}

.grid-toggle {
	min-height: 2.5rem;
	padding-inline: 1rem;
}

.grid-toggle .grid-toggle-label {
	white-space: nowrap;
}

/* Icon buttons */
.icon-button {
	background: var(--bg-input);
	color: var(--text-primary);
	border: none;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.icon-button:hover {
	background: var(--bg-input-hover);
	transform: scale(1.05);
}

.icon-button:active {
	transform: scale(0.95);
}

.copy-button {
	transform: translateY(-50%);
}

.copy-button:hover {
	transform: translateY(-50%) scale(1.05);
}

.copy-button:active {
	transform: translateY(-50%) scale(0.95);
}

.glass-btn {
	background: rgba(118, 118, 128, 0.12);
	backdrop-filter: blur(10px);
	width: 2.75rem;
	height: 2.75rem;
	font-size: 1.1rem;
}

.mobile-nav-card {
	margin-top: 0.5rem;
}

.mobile-nav-links {
	display: grid;
	gap: 0.5rem;
}

.mobile-nav-links a {
	color: var(--text-primary);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	padding: 0.25rem 0;
	display: flex;
	align-items: center;
	min-height: 44px;
}

.mobile-nav-links a i {
	width: 1.25rem;
	text-align: center;
}

.dark-mode .badge.bg-light {
	background-color: rgba(255,255,255,0.1) !important;
	color: #fff !important;
	border-color: rgba(255,255,255,0.1) !important;
}

/* Alerts */
.rounded-alert {
	border-radius: var(--radius-input);
	border: none;
	font-size: 0.9rem;
	font-weight: 500;
}

.mobile-alert {
	display: none;
}

/* Glyph grid */
#glyph-output {
	--glyph-columns: 16;
	display: grid;
	grid-template-columns: repeat(var(--glyph-columns), minmax(34px, 1fr));
	gap: 6px;
	padding: clamp(0.5rem, 2vw, 0.75rem);
	overflow-x: auto;
	width: 100%;
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	border-radius: 18px;
}

#glyph-output div {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--bg-plate);
	border-radius: 4px;
	transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	cursor: pointer;
	position: relative;
	font-size: clamp(1rem, 2vw, 1.125rem);
	background-repeat: no-repeat;
	image-rendering: pixelated;
	border: 1px solid var(--border-light);
	box-shadow: none;
}

#glyph-output div:hover {
	transform: scale(1.15);
	z-index: 10;
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
	background-color: var(--bg-input-hover) !important;
	border-color: rgba(59, 130, 246, 0.4);
}

#glyph-output div.transparent {
	background-color: var(--bg-input);
	border-radius: 2px;
	border: 1px dashed var(--border-light);
}

/* Preserve pixel-art corners when a cell contains an image. */
#glyph-output div[style*="background-image"] {
    border-radius: 0 !important;
}
#glyph-output div[style*="background-image"]:hover {
    border-radius: 4px !important;
}

/* Toast */
.action-toast {
	position: absolute;
	background-color: rgba(0, 0, 0, 0.78);
	backdrop-filter: blur(6px);
	color: #fff;
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 0.75rem;
	font-weight: 600;
	pointer-events: none;
	white-space: nowrap;
	z-index: 9999;
	box-shadow: none;
	transform: translate(-50%, -8px) scale(0.95);
	opacity: 0;
	transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    line-height: 1.4;
}

.action-toast.visible {
	opacity: 1;
	transform: translate(-50%, 0) scale(1);
}

.action-toast.success {
	background-color: var(--accent);
	color: white;
	transform: translate(-50%, 0) scale(1.05);
}

/* Footer links */
.footer-links a {
	color: var(--text-secondary);
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s;
	font-size: 0.95rem;
}

.footer-links a:hover {
	color: var(--accent);
}

/* Zoom window */
.zoom-window {
	border-radius: 12px;
	background: var(--bg-card);
	padding: 12px;
	box-shadow: var(--shadow-flyout);
	border: 1px solid var(--border-light);
}

.zoom-window canvas {
	display: block;
	image-rendering: pixelated;
	border-radius: 0;
}

.zoom-window .zoom-info {
	margin-top: 10px;
	font-size: 13px;
	font-weight: 500;
	text-align: center;
	color: var(--text-primary);
}

.atlas-info {
	line-height: 1.2;
	padding: 0.35rem 0.75rem;
	background: var(--bg-input);
	border-radius: 999px;
	border: 1px solid var(--border-light);
}

/* Glyph detail */
.detail-preview {
	background: var(--bg-card);
	width: 100%;
	height: auto;
	min-height: 360px;
	max-height: 440px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	border: 1px solid var(--border-light);
	margin: 0 auto;
	position: relative;
}

.detail-preview.transparent-state::before {
	content: "";
	position: absolute;
	inset: 14px;
	border-radius: 12px;
	background-size: 16px 16px;
	background-image:
		linear-gradient(45deg, rgba(0,0,0,0.08) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.08) 75%, rgba(0,0,0,0.08)),
		linear-gradient(45deg, rgba(0,0,0,0.08) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.08) 75%, rgba(0,0,0,0.08));
	background-position: 0 0, 8px 8px;
	opacity: 0.6;
	pointer-events: none;
	z-index: 0;
}

.detail-preview-col {
	display: flex;
	align-items: stretch;
	align-self: stretch;
	height: auto;
}

.glyph-preview-img {
	width: 100%;
	height: 100%;
	max-width: 320px;
	max-height: 360px;
	image-rendering: pixelated;
	background: transparent;
	border-radius: 0;
	border: none;
	object-fit: contain;
	position: relative;
	z-index: 1;
}


.glyph-preview-char {
	font-size: clamp(3.5rem, 7vw, 4.5rem);
	font-weight: 700;
	color: var(--text-primary);
	padding: 20px 0;
}

.replace-preview {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	align-items: start;
}

.replace-card {
	background: var(--bg-input);
	border: 1px solid var(--border-light);
	border-radius: 14px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.replace-label {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.replace-preview .glyph-preview-img {
	width: clamp(120px, 45%, 160px);
	height: clamp(120px, 45%, 160px);
	border-radius: 0;
}

.preview-download-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--border-light);
	background: rgba(255,255,255,0.8);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--text-primary);
	box-shadow: none;
	transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	z-index: 2;
}

.preview-download-btn:hover {
	transform: scale(1.05);
	background: rgba(255,255,255,0.8);
}

.preview-download-btn:active {
	transform: scale(0.95);
}

.vanilla-picker .form-control {
	min-width: 220px;
}

.vanilla-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 12px;
	max-height: 480px;
	overflow-y: auto;
}

.vanilla-tile {
	background: var(--bg-input);
	border: 1px solid var(--border-light);
	border-radius: 10px;
	padding: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	transition: transform 0.1s ease, border-color 0.1s ease;
}

.vanilla-tile:hover {
	transform: translateY(-2px);
	border-color: var(--accent);
}

.vanilla-tile img {
	width: 48px;
	height: 48px;
	image-rendering: pixelated;
}

.vanilla-tile .vanilla-name {
	font-size: 11px;
	text-align: center;
	color: var(--text-secondary);
	line-height: 1.2;
	word-break: break-word;
}

/* Glyph detail dialog */
.modal-content {
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	box-shadow: none;
	backdrop-filter: blur(6px);
	color: var(--text-primary);
}

.modal-header,
.modal-footer {
	border-color: var(--border-light);
	color: var(--text-primary);
}

.modal-title {
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--text-primary);
}

.modal .form-control,
.modal .form-select {
	border-radius: var(--radius-input);
	background: var(--bg-input);
	border: 1px solid var(--border-light);
	color: var(--text-primary);
}

.modal .form-control:focus,
.modal .form-select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px var(--accent-soft);
	background: var(--bg-card);
}

/* Vanilla picker page-size dropdown */
#vanillaPageSize.form-select {
	min-height: 38px;
	padding: 6px 12px;
	border-radius: 12px;
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	color: var(--text-primary);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#vanillaPageSize.form-select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
	background: var(--bg-card);
}

.dark-mode #vanillaPageSize.form-select {
	background: var(--bg-input);
	color: var(--text-primary);
	border-color: var(--border-light);
}

.vanilla-page-size .dropdown-toggle {
	min-height: 38px;
	padding: 6px 12px;
	border-radius: 12px;
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	color: var(--text-primary);
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.vanilla-page-size .dropdown-toggle:focus,
.vanilla-page-size .dropdown-toggle.show {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
	background: var(--bg-card);
	color: var(--text-primary);
}

.vanilla-page-size .dropdown-menu {
	padding: 6px 0;
	border-radius: 12px;
	min-width: 140px;
}

.vanilla-page-size .dropdown-item {
	padding: 8px 14px;
	border-radius: 8px;
}

.vanilla-page-size .dropdown-item:active,
.vanilla-page-size .dropdown-item:focus {
	background-color: var(--accent-soft);
	color: var(--text-primary);
}

.dark-mode .vanilla-page-size .dropdown-menu {
	background: var(--bg-card);
}

.list-group-item {
	background: transparent;
	border-color: var(--border-light);
}

.modal .btn-close {
	filter: invert(0);
}

.dark-mode .modal .btn-close {
	filter: invert(1);
}

.detail-modal {
	border-radius: 20px;
	overflow: hidden;
}

.detail-header {
	padding: 1.1rem 1.4rem;
	border: none;
	background: linear-gradient(120deg, rgba(59, 130, 246, 0.12), transparent);
}

.detail-body {
	padding: 1.4rem;
}

.detail-footer {
	border: none;
	background: var(--bg-card);
	padding: 1.1rem 1.4rem;
	flex-direction: column;
	align-items: stretch;
	gap: 0.6rem;
	justify-content: flex-start;
}

.detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	width: 100%;
}

.detail-actions .btn {
	flex: 1 1 150px;
	min-width: 0;
	height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	border-radius: 16px;
}

.detail-footer .btn {
	background: rgba(255,255,255,0.65);
	color: var(--text-primary);
	border: 1px solid var(--border-light);
	box-shadow: none;
	border-radius: 16px;
}

.detail-footer .btn:hover {
	filter: none;
	box-shadow: none;
}

.detail-meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(260px, 1fr));
	gap: 0.75rem;
	border: none;
	padding-left: 0;
}

.detail-meta .list-group-item {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	background: var(--bg-card);
	border: 1px solid var(--border-light);
	border-radius: 14px;
	padding: 0.85rem 1rem;
	color: var(--text-primary);
}

.detail-meta .list-group-item .text-secondary {
	text-transform: uppercase;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	color: var(--text-secondary);
}

.detail-meta .fw-bold {
	font-size: 1rem;
	color: var(--text-primary);
}

.detail-field {
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.detail-field:hover {
	border-color: rgba(59, 130, 246, 0.4);
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
	transform: none;
}

.detail-value {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	justify-content: flex-end;
	white-space: nowrap;
}

.detail-copy-icon {
	color: var(--text-secondary);
	opacity: 0.7;
	transition: color 0.2s ease, opacity 0.2s ease;
	font-size: 0.95rem;
}

.detail-field:hover .detail-copy-icon {
	opacity: 1;
	color: var(--accent);
}

#drawerRedirectPrompt.drawer-redirect-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 1rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

#drawerRedirectPrompt.drawer-redirect-overlay.visible,
.drawer-redirect-overlay.visible {
	opacity: 1;
	pointer-events: auto;
}

.drawer-redirect-card {
	background: var(--bg-card);
	color: var(--text-primary);
	border-radius: 16px;
	border: 1px solid var(--border-light);
	padding: 1.25rem 1.5rem;
	box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
	max-width: 420px;
	width: 100%;
	animation: drawerPromptPop 0.2s ease;
}

.drawer-redirect-card .btn {
	min-height: 44px;
}

#drawerRedirectPrompt .text-secondary {
	color: var(--text-secondary) !important;
}

@keyframes drawerPromptPop {
	from { transform: translateY(8px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}
#glyphDetailModal .modal-dialog {
	max-width: 1100px;
	width: calc(100% - 2rem);
}

.dark-mode .app-card {
	background: var(--bg-card);
}

.dark-mode .upload-zone {
	background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(17, 24, 39, 0.75));
	border-color: var(--border-light);
}

.dark-mode .upload-zone:hover {
	border-color: rgba(96, 165, 250, 0.5);
	box-shadow: 0 6px 20px rgba(96, 165, 250, 0.18);
}

.dark-mode #glyph-output {
	background: linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.75));
	border-color: var(--border-light);
}

.dark-mode #glyph-output div {
	background-color: #0f1624;
	border-color: var(--border-light);
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.dark-mode .detail-preview {
	background: var(--bg-card);
}

.dark-mode .detail-header {
	background: var(--bg-card);
}

.dark-mode .detail-meta .list-group-item {
	background: var(--bg-card);
	border-color: var(--border-light);
}

/* Responsive layout */
@media (max-width: 1023px) {
	.app-container {
		padding-inline: clamp(1rem, 5vw, 2rem);
	}

	.header-bar {
		align-items: flex-start;
	}

	.title-text {
		font-size: clamp(1.7rem, 3vw, 2.2rem);
	}

	.subtitle-text {
		font-size: clamp(0.95rem, 1.4vw, 1.05rem);
	}

	.app-card {
		padding: clamp(1.05rem, 3vw, 1.35rem);
	}

	#glyph-output {
		--glyph-columns: 12;
	}

	.detail-actions {
		gap: 0.5rem;
	}
}

@media (max-width: 767px) {
	.app-container {
		padding-inline: 1rem;
	}

	.header-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.header-actions {
		width: 100%;
		justify-content: flex-end;
	}

	.mobile-nav-card {
		margin-top: 0.25rem;
	}

	.app-card {
		padding: 1rem 1.1rem;
	}

	.pill-action {
		flex: 1 1 48%;
		width: 100%;
		text-align: center;
	}

	.upload-zone {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		row-gap: 0.5rem;
	}

	.icon-button {
		width: 2.75rem;
		height: 2.75rem;
	}

	.btn,
	.pill-action,
	.icon-button,
	.dropdown-item {
		min-height: 44px;
	}

	#glyph-output {
		--glyph-columns: 6;
		gap: 5px;
	}

	#glyph-output div {
		font-size: 1rem;
	}

	.footer-links {
		gap: 0.75rem;
		justify-content: flex-start;
	}

	.footer-links a {
		width: 100%;
		text-align: left;
		padding: 0.25rem 0;
		min-height: 44px;
		display: flex;
		align-items: center;
	}

	.detail-actions {
		flex-direction: column;
	}

	.detail-actions .btn {
		width: 100%;
		flex: 0 0 auto;
		height: 48px;
	}

	.detail-meta {
		grid-template-columns: 1fr;
	}
}

/* ============================================================
   menkrep.id Branding
   ============================================================ */

/* Header badge */
.menkrep-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.10));
	border: 1px solid rgba(34, 197, 94, 0.35);
	border-radius: 999px;
	padding: 3px 10px 3px 6px;
	text-decoration: none;
	color: #16a34a;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	transition: all 0.25s ease;
	backdrop-filter: blur(6px);
}

.menkrep-badge:hover {
	background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(16, 185, 129, 0.18));
	border-color: rgba(34, 197, 94, 0.6);
	color: #15803d;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
	text-decoration: none;
}

.dark-mode .menkrep-badge {
	background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(16, 185, 129, 0.12));
	border-color: rgba(34, 197, 94, 0.4);
	color: #4ade80;
}

.dark-mode .menkrep-badge:hover {
	background: linear-gradient(135deg, rgba(34, 197, 94, 0.28), rgba(16, 185, 129, 0.20));
	border-color: rgba(74, 222, 128, 0.65);
	color: #86efac;
	box-shadow: 0 4px 18px rgba(34, 197, 94, 0.3);
}

/* Animated live dot */
.menkrep-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	display: inline-block;
	flex-shrink: 0;
	animation: menkrep-pulse 2s ease-in-out infinite;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
}

@keyframes menkrep-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
	50%  { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.menkrep-badge-text {
	line-height: 1;
}

/* Header server link button (desktop) */
.menkrep-server-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: linear-gradient(135deg, #16a34a, #059669);
	color: #fff !important;
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 700;
	padding: 0.45rem 1rem;
	border-radius: 999px;
	letter-spacing: 0.02em;
	transition: all 0.25s ease;
	box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.menkrep-server-link:hover {
	background: linear-gradient(135deg, #15803d, #047857);
	box-shadow: 0 6px 22px rgba(22, 163, 74, 0.5);
	transform: translateY(-1px);
	color: #fff !important;
	text-decoration: none;
}

.menkrep-server-link:active {
	transform: translateY(0);
}

/* Footer menkrep banner */
.footer-menkrep-banner {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.85rem;
	color: var(--text-secondary);
	background: rgba(34, 197, 94, 0.08);
	border: 1px solid rgba(34, 197, 94, 0.2);
	border-radius: 999px;
	padding: 6px 16px;
	flex-wrap: wrap;
	justify-content: center;
}

.footer-menkrep-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	display: inline-block;
	flex-shrink: 0;
	animation: menkrep-pulse 2s ease-in-out infinite;
}

.footer-menkrep-link {
	color: #16a34a;
	font-weight: 700;
	text-decoration: none;
	transition: color 0.2s;
}

.footer-menkrep-link:hover {
	color: #15803d;
	text-decoration: underline;
}

.dark-mode .footer-menkrep-banner {
	background: rgba(34, 197, 94, 0.10);
	border-color: rgba(34, 197, 94, 0.25);
}

.dark-mode .footer-menkrep-link {
	color: #4ade80;
}

.dark-mode .footer-menkrep-link:hover {
	color: #86efac;
}
