/* ============================================================
   CASK Virtual Microscopy — Responsive UI
   Redesign 2026 · CEITICB, Escuela de Biología, UNAH
   Color palette: Verde Biología + Azul UNAH
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
	/* Greens — Biology */
	--green-900: #1B5E20;
	--green-800: #2E7D32;
	--green-700: #388E3C;
	--green-600: #43A047;
	--green-500: #4CAF50;
	--green-400: #66BB6A;
	--green-300: #81C784;
	--green-200: #A5D6A7;
	--green-100: #C8E6C9;
	--green-50:  #E8F5E9;

	/* Blues — UNAH institutional */
	--blue-900: #0D3B66;
	--blue-800: #14568A;
	--blue-700: #1565C0;
	--blue-600: #1976D2;
	--blue-500: #2196F3;
	--blue-100: #BBDEFB;
	--blue-50:  #E3F2FD;

	/* Neutrals */
	--gray-50:  #FAFAFA;
	--gray-100: #F5F5F5;
	--gray-200: #EEEEEE;
	--gray-300: #E0E0E0;
	--gray-400: #BDBDBD;
	--gray-500: #9E9E9E;
	--gray-600: #757575;
	--gray-700: #616161;
	--gray-800: #424242;
	--gray-900: #212121;

	/* Semantic */
	--color-primary: var(--green-800);
	--color-primary-dark: var(--green-900);
	--color-primary-light: var(--green-100);
	--color-accent: var(--blue-800);
	--color-accent-dark: var(--blue-900);
	--color-bg: var(--green-50);
	--color-surface: #FFFFFF;
	--color-text: var(--gray-800);
	--color-text-muted: var(--gray-600);
	--color-text-on-dark: #FFFFFF;
	--color-border: var(--gray-300);

	/* Layout */
	--sidebar-w: 280px;
	--mobile-header-h: 52px;
	--toolbar-h: 44px;

	/* Typography */
	--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: 'Courier New', Courier, monospace;

	/* Radii & Shadows */
	--radius: 8px;
	--radius-sm: 4px;
	--shadow-sm: 0 1px 3px rgba(0,0,0,0.10);
	--shadow-md: 0 4px 12px rgba(0,0,0,0.12);
	--shadow-lg: 0 8px 30px rgba(0,0,0,0.18);
	--transition: 0.25s ease;
}


/* ---------- Base (scoped to caskviewer only) ---------- */
*, *::before, *::after {
	box-sizing: border-box;
}

body {
	background-color: var(--color-bg);
	overflow: hidden;
	font-family: var(--font);
	color: var(--color-text);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }
.hidden { display: none !important; }


/* ---------- Mobile header ---------- */
#mobileHeader {
	display: none; /* shown on mobile via media query */
	position: fixed;
	top: 0; left: 0; right: 0;
	height: var(--mobile-header-h);
	background: linear-gradient(135deg, #0f1c20, #142a2e);
	color: var(--color-text-on-dark);
	z-index: 2000;
	align-items: center;
	padding: 0 12px;
	box-shadow: var(--shadow-md);
}

#mobileMenuBtn {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	padding: 8px;
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	-webkit-tap-highlight-color: transparent;
}
#mobileMenuBtn:hover { background: rgba(255,255,255,0.15); }

.mobile-title {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.3px;
	margin-left: 8px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.mobile-title-icon { opacity: 0.8; }


/* ---------- Sidebar (nav) ---------- */
div#nav {
	position: fixed;
	left: 0; top: 0; bottom: 0;
	width: var(--sidebar-w);
	background: linear-gradient(180deg, #0f1c20 0%, #142a2e 40%, #1a3338 70%, #0f2027 100%);
	color: var(--color-text-on-dark);
	z-index: 1500;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 2px 0 20px rgba(0,0,0,0.4);
	transition: transform var(--transition);
}

/* Mobile close button */
#mobileCloseBtn {
	display: none; /* shown on mobile */
	position: absolute;
	top: 10px; right: 10px;
	background: none;
	border: none;
	color: rgba(255,255,255,0.7);
	cursor: pointer;
	padding: 6px;
	border-radius: var(--radius-sm);
	z-index: 10;
	-webkit-tap-highlight-color: transparent;
}
#mobileCloseBtn:hover { color: white; background: rgba(255,255,255,0.15); }


/* ---------- Logos institucionales (1 fila horizontal) ---------- */
.nav-logos {
	display: flex;
	align-items: center;
	justify-content: space-evenly;
	gap: 4px;
	padding: 10px 8px;
	background: rgba(255,255,255,0.95);
	border-bottom: 1px solid rgba(255,255,255,0.12);
	flex-shrink: 0;
	border-radius: 0 0 10px 10px;
	margin: 0 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-logo-link {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform var(--transition), opacity var(--transition);
	padding: 2px;
	flex: 1;
	min-width: 0;
}
.nav-logo-link:hover {
	transform: scale(1.08);
}

.nav-logo-img {
	height: 36px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	display: block;
}

/* Logo images only — do NOT apply broad img rules inside #nav
   because toolbar buttons, settings icons, etc. also live there */


/* ---------- Brand section ---------- */
.nav-brand {
	padding: 16px 16px 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid rgba(42,181,176,0.15);
	flex-shrink: 0;
	background: rgba(0,0,0,0.15);
}

.nav-brand-text {
	min-width: 0;
	text-align: center;
}
.nav-title {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.2;
	color: #ffffff;
	letter-spacing: 0.8px;
}
.nav-subtitle {
	font-size: 11px;
	color: #2ab5b0;
	margin-top: 4px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}


/* ---------- Toolbar layout container ---------- */
#toolsArea {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 8px 12px;
	border-bottom: 1px solid rgba(42,181,176,0.12);
	flex-shrink: 0;
	position: relative;
	z-index: 1100; /* above slidesContOverlay (1000) and SlideSetsMenuPane (1001) */
}

/* ---------- Toolbar buttons ---------- */
/* The info "i" button — styled to match original CASK structure */
div#buttonInfo {
	position: static;
	width: 34px;
	height: 34px;
	display: inline-block;
	line-height: 34px;
	text-align: center;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background var(--transition);
	color: rgba(255,255,255,0.8);
	font-family: Georgia, 'Times New Roman', serif;
	font-style: italic;
	font-weight: bold;
	font-size: 18px;
	vertical-align: middle;
	-webkit-tap-highlight-color: transparent;
}
div#buttonInfo:hover {
	background: rgba(255,255,255,0.15);
	color: white;
}

/* Tool button images — inline like original CASK layout */
img#buttonEditLabelsOn,
img#buttonEditLabelsOff,
img#buttonShowUrlBar,
img#buttonCloseUrlBar,
img#buttonWrench {
	position: static;
	display: inline-block;
	width: 20px;
	height: 20px;
	padding: 7px;
	box-sizing: content-box;
	opacity: 0.8;
	filter: brightness(10);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background var(--transition), opacity var(--transition);
	vertical-align: middle;
	-webkit-tap-highlight-color: transparent;
}
img#buttonEditLabelsOn:hover,
img#buttonEditLabelsOff:hover,
img#buttonShowUrlBar:hover,
img#buttonCloseUrlBar:hover,
img#buttonWrench:hover {
	opacity: 1;
	background: rgba(255,255,255,0.15);
}


/* ---------- Menu Tab (Biología button) ---------- */
a.menutab {
	position: static;
	display: block;
	width: auto;
	height: auto;
	margin: 10px 12px;
	padding: 13px 18px;
	font-family: var(--font);
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	text-decoration: none;
	background: linear-gradient(135deg, #1a9a9e, #0d7377);
	border-radius: var(--radius);
	cursor: pointer;
	opacity: 1;
	filter: none;
	transition: all var(--transition);
	text-align: left;
	flex-shrink: 0;
	letter-spacing: 0.4px;
	box-shadow: 0 3px 12px rgba(26,154,158,0.4);
	border: 1px solid rgba(42,181,176,0.3);
}
a.menutab:hover {
	background: linear-gradient(135deg, #2ab5b0, #1a9a9e);
	color: #ffffff;
	opacity: 1;
	filter: none;
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(42,181,176,0.5);
	border-color: rgba(42,181,176,0.5);
}
a.menutab:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(26,154,158,0.3);
}

/* Override any specific menutab styles */
a#menutab1, a#menutab2, a#menutab3 {
	position: static;
	top: auto;
	left: auto;
	background-color: transparent;
}
a#menutab2 {
	background: linear-gradient(135deg, #1a9a9e, #0d7377);
}


/* ---------- Slides Container ---------- */
div#slidesCont {
	position: relative;
	left: 0;
	top: 0;
	width: 100%;
	overflow-x: hidden;
	overflow-y: auto;
	flex: 1;
	min-height: 80px;
	padding: 4px 0;
}

/* Scrollbar styling */
div#slidesCont::-webkit-scrollbar { width: 6px; }
div#slidesCont::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
div#slidesCont::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }
div#slidesCont::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }


/* ---------- Slide cards ---------- */
.cont {
	position: relative;
	left: 0;
	top: 0;
	width: calc(100% - 24px);
	height: 100px;
	margin: 6px 12px;
	z-index: 1;
	list-style-type: none;
	background: rgba(255,255,255,0.06);
	border-radius: var(--radius);
	transition: all var(--transition);
	overflow: hidden;
	border: 1px solid rgba(42,181,176,0.1);
	touch-action: manipulation;
	-webkit-tap-highlight-color: rgba(42,181,176,0.15);
}
.cont:hover {
	background: rgba(42,181,176,0.12);
	border-color: rgba(42,181,176,0.3);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.slide {
	position: absolute;
	left: 0; top: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	opacity: 0.08;
	object-fit: cover;
}

.img {
	position: absolute;
	left: 12px;
	top: 8px;
	z-index: 1;
	margin: 0;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
	border: 2px solid rgba(255,255,255,0.25);
}

.sensor {
	position: absolute;
	left: 0; top: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.caption {
	position: absolute;
	left: 12px;
	bottom: 8px;
	right: 12px;
	height: auto;
	max-height: 36px;
	font-family: var(--font);
	font-size: 12px;
	font-weight: 600;
	color: #ffffff;
	line-height: 1.3;
	overflow: hidden;
	text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.written {
	position: absolute;
	right: 12px;
	top: 8px;
	width: 40px;
	height: 50px;
	font-family: var(--font-mono);
	font-size: 8px;
	font-style: italic;
	line-height: 1;
	color: rgba(255,255,255,0.3);
	z-index: 1;
	overflow: hidden;
	word-wrap: break-word;
}


/* ---------- Slides overlay & menu pane ---------- */
div#slidesContOverlay {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: auto;
	z-index: 1000;
	background-color: rgba(15, 28, 32, 0.88);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

div#SlideSetsMenuPane {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	margin: 0;
	padding: 0;
	z-index: 1001;
	font-family: var(--font);
	opacity: 1;
	filter: none;
	overflow-y: auto;
	max-height: 100%;
}

.slideSetsMenu {
	position: relative;
	left: 0;
	top: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
}

.slideSetsMenu h3:hover,
.slideSetsMenu div:hover {
	color: var(--green-300);
}

.slideSetsMenu .accordionHeader {
	margin: 0;
	padding: 12px 16px;
	min-height: auto;
	color: #FFFFFF;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	font-weight: 600;
	font-size: 13px;
	font-family: var(--font);
	letter-spacing: 0.3px;
	background: linear-gradient(135deg, #142a2e, #1a3338);
	transition: background var(--transition);
	border-left: 3px solid #1a9a9e;
}
.slideSetsMenu .accordionHeader:hover {
	background: linear-gradient(135deg, #1a3338, #1f3d42);
	border-left-color: #2ab5b0;
}

.slideSetsMenu .accordionEntry {
	margin: 0;
	padding: 10px 16px 10px 24px;
	width: auto;
	height: auto;
	font-size: 13px;
	font-family: var(--font);
	color: var(--gray-700);
	border-bottom: 1px solid var(--gray-200);
	background: var(--color-surface);
	transition: all var(--transition);
}
.slideSetsMenu .accordionEntry:hover {
	background: var(--green-50);
	color: var(--green-900);
	padding-left: 28px;
}


/* ---------- Edit Label Panel ---------- */
div#editLabelPanel {
	display: none;
	position: relative;
	left: 0;
	top: 0;
	width: auto;
	padding: 12px 16px;
	z-index: 200;
	background-color: rgba(0,0,0,0.2);
	border-top: 1px solid rgba(42,181,176,0.15);
	border-bottom: 1px solid rgba(42,181,176,0.15);
	overflow: auto;
	font-family: var(--font);
	color: rgba(255,255,255,0.9);
	flex-shrink: 0;
}
div#labelPanelInfo h5 {
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 6px;
}
div#labelPanelInfo {
	font-size: 12px;
	color: rgba(255,255,255,0.6);
	margin-bottom: 10px;
	line-height: 1.6;
}
img.linkIconSmall {
	width: 14px;
	height: 14px;
	vertical-align: middle;
	filter: brightness(10);
}

#addLabelButton {
	width: 100%;
	height: 36px;
	vertical-align: middle;
	background: #1a9a9e;
	color: white;
	border: none;
	border-radius: var(--radius-sm);
	font-family: var(--font);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--transition);
}
#addLabelButton:hover {
	background: #2ab5b0;
}

img#closeLabelPanel {
	float: right;
	margin-top: -30px;
	filter: brightness(10);
	opacity: 0.6;
	cursor: pointer;
}
img#closeLabelPanel:hover { opacity: 1; }


/* ---------- Settings Panel ---------- */
div#settingsDiv {
	display: none;
	position: relative;
	left: 0;
	top: 0;
	width: auto;
	padding: 12px 16px;
	z-index: 200;
	background: rgba(0,0,0,0.2);
	border-top: 1px solid rgba(42,181,176,0.15);
	border-bottom: 1px solid rgba(42,181,176,0.15);
	overflow: auto;
	font-family: var(--font);
	font-size: 13px;
	color: rgba(255,255,255,0.85);
	flex-shrink: 0;
}

div#settingsDiv hr {
	border: none;
	border-top: 1px solid rgba(255,255,255,0.12);
	margin: 8px 0;
}

div#settingsDiv label {
	font-size: 13px;
	cursor: pointer;
}

div#settingsDiv img {
	vertical-align: middle;
	width: 20px;
	height: 20px;
	margin-right: 4px;
}

.settings-label {
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: rgba(255,255,255,0.6);
}

.shiftUp {
	position: static;
	top: auto;
}


/* ---------- Nav footer (CASK credit) ---------- */
.nav-footer {
	padding: 12px 16px;
	border-top: 1px solid rgba(42,181,176,0.1);
	flex-shrink: 0;
	margin-top: auto;
}

.nav-footer-link {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: rgba(255,255,255,0.45);
	font-size: 11px;
	transition: color var(--transition);
}
.nav-footer-link:hover {
	color: rgba(255,255,255,0.7);
	text-decoration: none;
}

.nav-footer-logo {
	width: 36px;
	height: auto;
	opacity: 0.35;
	filter: brightness(10);
	transition: opacity var(--transition);
}
.nav-footer-link:hover .nav-footer-logo {
	opacity: 0.6;
}


/* ---------- SlideBox open image (hidden, replaced by CSS) ---------- */
img#slideBoxOpen {
	display: none !important;
}


/* ---------- Welcome Overlay (animated splash) ---------- */
#welcomeOverlay {
	position: fixed;
	top: 0; right: 0; bottom: 0;
	left: var(--sidebar-w);
	z-index: 900;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1a6e5c 0%, #1b7d6a 20%, #2a8f6e 40%, #3d9b6a 60%, #5a9f5c 80%, #7aaa4e 100%);
	overflow: hidden;
	transition: opacity 0.8s ease, visibility 0.8s ease;
}

#welcomeOverlay.welcome-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* Floating particles */
.welcome-particles {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}

.particle {
	position: absolute;
	border-radius: 50%;
	background: rgba(255,255,255,0.25);
	animation: particleFloat linear infinite;
}
.particle.p1  { width: 6px;  height: 6px;  left: 5%;   top: 80%; animation-duration: 14s; animation-delay: 0s;   }
.particle.p2  { width: 4px;  height: 4px;  left: 15%;  top: 90%; animation-duration: 18s; animation-delay: -2s;  }
.particle.p3  { width: 8px;  height: 8px;  left: 25%;  top: 85%; animation-duration: 12s; animation-delay: -4s;  }
.particle.p4  { width: 5px;  height: 5px;  left: 35%;  top: 95%; animation-duration: 16s; animation-delay: -1s;  }
.particle.p5  { width: 3px;  height: 3px;  left: 45%;  top: 88%; animation-duration: 20s; animation-delay: -6s;  }
.particle.p6  { width: 7px;  height: 7px;  left: 55%;  top: 92%; animation-duration: 15s; animation-delay: -3s;  }
.particle.p7  { width: 4px;  height: 4px;  left: 65%;  top: 82%; animation-duration: 17s; animation-delay: -5s;  }
.particle.p8  { width: 6px;  height: 6px;  left: 75%;  top: 87%; animation-duration: 13s; animation-delay: -7s;  }
.particle.p9  { width: 5px;  height: 5px;  left: 85%;  top: 93%; animation-duration: 19s; animation-delay: -2s;  }
.particle.p10 { width: 3px;  height: 3px;  left: 10%;  top: 75%; animation-duration: 22s; animation-delay: -8s;  }
.particle.p11 { width: 7px;  height: 7px;  left: 40%;  top: 78%; animation-duration: 11s; animation-delay: -4s;  }
.particle.p12 { width: 4px;  height: 4px;  left: 70%;  top: 96%; animation-duration: 21s; animation-delay: -10s; }

@keyframes particleFloat {
	0%   { transform: translateY(0) translateX(0); opacity: 0; }
	10%  { opacity: 0.6; }
	90%  { opacity: 0.4; }
	100% { transform: translateY(-100vh) translateX(40px); opacity: 0; }
}

.welcome-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	z-index: 1;
	animation: welcomeFadeIn 1.2s ease-out;
}

.welcome-logo-container {
	position: relative;
	width: 260px;
	height: 260px;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: welcomeFloat 4s ease-in-out infinite;
}

.welcome-logo {
	width: 260px;
	height: 260px;
	object-fit: contain;
	position: relative;
	z-index: 1;
	filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
}

.welcome-title {
	margin-top: 28px;
	font-family: var(--font);
	font-size: 34px;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: 1.5px;
	text-shadow: 0 2px 8px rgba(0,0,0,0.2);
	animation: welcomeSlideUp 1s ease-out 0.3s both;
}

.welcome-subtitle {
	margin-top: 6px;
	font-family: var(--font);
	font-size: 15px;
	font-weight: 600;
	color: rgba(255,255,255,0.85);
	letter-spacing: 0.5px;
	text-transform: uppercase;
	animation: welcomeSlideUp 1s ease-out 0.5s both;
}

.welcome-divider {
	width: 60px;
	height: 3px;
	margin: 20px auto;
	background: rgba(255,255,255,0.5);
	border-radius: 2px;
	animation: welcomeSlideUp 1s ease-out 0.6s both;
}

.welcome-instruction {
	font-family: var(--font);
	font-size: 14px;
	color: rgba(255,255,255,0.65);
	font-style: italic;
	animation: welcomeSlideUp 1s ease-out 0.8s both;
}

.welcome-footer {
	position: absolute;
	bottom: 28px;
	display: flex;
	align-items: center;
	gap: 16px;
	z-index: 1;
	animation: welcomeSlideUp 1s ease-out 1s both;
	background: rgba(255,255,255,0.12);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	padding: 14px 32px;
	border-radius: 40px;
	border: 1px solid rgba(255,255,255,0.2);
}

.welcome-footer-logo {
	width: 52px;
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}

.welcome-footer-text {
	font-family: var(--font);
	font-size: 14px;
	font-weight: 500;
	color: rgba(255,255,255,0.9);
	letter-spacing: 0.3px;
	line-height: 1.5;
}

/* Welcome animations */
@keyframes welcomeFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes welcomeSlideUp {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes welcomeFloat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-10px); }
}


/* ---------- Main container (viewer) ---------- */
div#container {
	position: relative;
	padding-left: var(--sidebar-w);
	height: 100%;
}

#viewerFrame {
	height: 100%;
	width: 100%;
	background-color: #FFFFFF;
	border: none;
}

#iFrameContainer {
	width: 100%;
	height: 100%;
}


/* ---------- URL Bar ---------- */
#urlBar {
	display: none;
	position: absolute;
	top: 0; left: 0; right: 0;
	padding: 12px 16px;
	z-index: 10;
	border-bottom: 2px solid #1a9a9e;
	font-family: var(--font);
	font-size: 13px;
	color: rgba(255,255,255,0.8);
	background: linear-gradient(135deg, #0f1c20, #142a2e);
}

#urlString {
	width: 100%;
	height: 60px;
	background-color: rgba(255,255,255,0.95);
	border: 1px solid var(--gray-300);
	border-radius: var(--radius-sm);
	padding: 8px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--gray-800);
	resize: vertical;
	box-sizing: border-box;
}

div.urlInfoBarLeader {
	margin-bottom: 8px;
}

img#buttonCloseUrlBar2 {
	float: right;
	cursor: pointer;
	filter: brightness(10);
	opacity: 0.6;
	transition: opacity var(--transition);
}
img#buttonCloseUrlBar2:hover { opacity: 1; }


/* ---------- Info Panel ---------- */
div#infoPanel {
	display: none;
	position: absolute;
	left: 20px; right: 20px;
	top: 20px; bottom: 20px;
	border: none;
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	padding: 32px;
	background: var(--color-surface);
	color: var(--gray-700);
	font-family: var(--font);
	overflow: auto;
	z-index: 100;
}

div#infoPanel #buttonCloseInfoPanel {
	float: right;
	cursor: pointer;
	opacity: 0.4;
	transition: opacity var(--transition);
}
div#infoPanel #buttonCloseInfoPanel:hover { opacity: 0.8; }

div#infoPanel h1 {
	font-size: 1.5em;
	font-weight: 700;
	margin-top: 24px;
	color: var(--green-900);
	border-bottom: 2px solid var(--green-100);
	padding-bottom: 8px;
}

div#infoPanel p { margin-top: 12px; line-height: 1.6; }
div#infoPanel .strong { font-weight: 600; color: var(--green-800); }
div#infoPanel ul { margin: 8px 0; padding-left: 1.2em; }
div#infoPanel li { list-style: disc; font-size: 0.9em; padding-top: 4px; line-height: 1.5; }
div#infoPanel a { color: var(--color-accent); }
div#infoPanel a:hover { color: var(--color-primary-dark); text-decoration: underline; }
div#infoPanel .small { font-size: 0.85em; line-height: 1.5; color: var(--gray-500); }


/* ---------- Chrome local warning ---------- */
div#chromeLocalWarning {
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	display: none;
	width: 360px;
	max-width: 90%;
	border: none;
	border-radius: var(--radius);
	background: linear-gradient(135deg, #0f1c20, #142a2e);
	color: white;
	font-family: var(--font);
	font-size: 14px;
	padding: 20px;
	z-index: 10;
	box-shadow: var(--shadow-lg);
	line-height: 1.5;
}


/* ---------- Left div & overlay ---------- */
div#leftDiv {
	display: none;
	position: absolute;
	width: 300px;
	height: 100%;
	visibility: hidden;
}

div#leftDivOverlay {
	display: none;
	position: fixed;
	left: 0; top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 1400;
	transition: opacity var(--transition);
	opacity: 0;
	pointer-events: none;
}

div#leftDivOverlay.overlay-visible {
	display: block;
	opacity: 1;
	pointer-events: auto;
}


/* ---------- Tab Open/Close Menu (legacy, hidden) ---------- */
img#tabOpenMenu,
img#tabCloseMenu {
	display: none !important;
}


/* ---------- Tooltips ---------- */
/* Hide source tooltip divs (jQuery UI creates its own dynamic overlay tooltips).
   These are the static HTML tooltip divs that serve as content sources.
   Using child combinator > so we don't accidentally hide jQuery UI's
   dynamic tooltips which are appended to <body>. */
div#nav > .tooltip,
#toolsArea > .tooltip,
.nav-logos > .nav-logo-link > .tooltip,
div#editLabelPanel > .tooltip {
	display: none !important;
}

.caskTooltipName {
	color: var(--green-900);
	font-weight: 600;
}

.caskTooltipCredit {
	font-style: italic;
	font-size: 0.9em;
	color: var(--gray-500);
}


/* ---------- Log (debug) ---------- */
div#log {
	display: none;
	position: absolute;
	bottom: 10px;
	left: 10px;
	width: 250px;
	max-height: 200px;
	background: rgba(0,0,0,0.85);
	border: 1px solid var(--gray-700);
	border-radius: var(--radius-sm);
	z-index: 9999;
	font-family: var(--font-mono);
	color: var(--green-400);
	font-size: 11px;
	overflow: auto;
	padding: 8px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- Tablet & small desktop (<=1024px) --- */
@media (max-width: 1024px) {
	:root {
		--sidebar-w: 260px;
	}

	/* Welcome overlay — slightly smaller on tablets */
	.welcome-logo-container,
	.welcome-logo {
		width: 200px;
		height: 200px;
	}
	.welcome-title { font-size: 28px; }
}

/* --- Mobile (<=768px) --- */
@media (max-width: 768px) {
	/* Show mobile header */
	#mobileHeader {
		display: flex;
	}

	/* Show mobile close button in sidebar */
	#mobileCloseBtn {
		display: flex;
	}

	/* Sidebar becomes a drawer */
	div#nav {
		position: fixed;
		width: 300px;
		max-width: 85vw;
		transform: translateX(-100%);
		z-index: 2500;
		top: 0;
		bottom: 0;
	}

	div#nav.nav-open {
		transform: translateX(0);
	}

	/* Container takes full width */
	div#container {
		padding-left: 0;
		padding-top: var(--mobile-header-h);
	}

	/* Overlay visible when menu is open */
	body.menu-open div#leftDivOverlay {
		display: block;
		opacity: 1;
		pointer-events: auto;
	}

	/* Welcome overlay — mobile: full width since sidebar is drawer */
	#welcomeOverlay {
		left: 0;
	}
	.welcome-logo-container,
	.welcome-logo {
		width: 160px;
		height: 160px;
	}
	.welcome-title {
		font-size: 24px;
		letter-spacing: 1px;
		margin-top: 20px;
	}
	.welcome-subtitle {
		font-size: 13px;
	}
	.welcome-divider {
		width: 40px;
		margin: 14px auto;
	}
	.welcome-instruction {
		font-size: 12px;
		padding: 0 20px;
		text-align: center;
	}
	.welcome-footer {
		bottom: 16px;
		padding: 8px 16px;
		gap: 8px;
	}
	.welcome-footer-logo {
		width: 28px;
	}
	.welcome-footer-text {
		font-size: 10px;
	}

	/* Reduce particle sizes on mobile for performance */
	.particle { animation-duration: 20s !important; }

	/* Info panel adjustments */
	div#infoPanel {
		left: 8px; right: 8px;
		top: calc(var(--mobile-header-h) + 8px);
		bottom: 8px;
		padding: 20px;
	}
	div#infoPanel h1 { font-size: 1.2em; }

	/* URL bar — full width on mobile */
	#urlBar {
		margin-left: 0;
		padding: 10px 12px;
	}
	#urlString {
		font-size: 11px;
		height: 50px;
	}

	/* Edit Label Panel — more compact */
	div#editLabelPanel {
		padding: 10px 12px;
	}
	div#labelPanelInfo { font-size: 11px; }

	/* Settings panel — more compact */
	div#settingsDiv {
		padding: 10px 12px;
		font-size: 12px;
	}

	/* Toolbar — slightly tighter on mobile */
	#toolsArea {
		padding: 6px 10px;
		gap: 1px;
	}
	div#buttonInfo {
		width: 30px;
		height: 30px;
		line-height: 30px;
		font-size: 16px;
	}
	img#buttonEditLabelsOn,
	img#buttonEditLabelsOff,
	img#buttonShowUrlBar,
	img#buttonCloseUrlBar,
	img#buttonWrench {
		width: 18px;
		height: 18px;
		padding: 6px;
	}

	/* Slide cards — touch-friendly larger tap targets */
	.cont {
		height: 90px;
		margin: 5px 10px;
	}
	.sensor {
		height: 100%; /* full card height for easier tapping */
		-webkit-tap-highlight-color: rgba(42,181,176,0.2);
		touch-action: manipulation; /* prevent 300ms delay */
	}
	.caption {
		font-size: 11px;
	}

	/* Accordion — bigger touch targets */
	.slideSetsMenu .accordionHeader {
		padding: 14px 16px;
		font-size: 14px;
		min-height: 44px; /* iOS minimum tap target */
	}
	.slideSetsMenu .accordionEntry {
		padding: 12px 16px 12px 24px;
		font-size: 14px;
		min-height: 44px;
	}

	/* Chrome warning centered */
	div#chromeLocalWarning {
		width: 90%;
		max-width: 320px;
		font-size: 13px;
		padding: 16px;
	}
}

/* --- Small phones (<=480px) --- */
@media (max-width: 480px) {
	div#nav {
		width: 100%;
		max-width: 100vw;
	}

	.nav-logos {
		gap: 4px;
		padding: 8px 6px;
		margin: 0 4px;
	}
	.nav-logo-img {
		height: 30px;
	}

	.nav-brand {
		padding: 10px 12px 8px;
	}

	.nav-title { font-size: 14px; }
	.nav-subtitle { font-size: 9px; }

	a.menutab {
		margin: 6px 10px;
		padding: 10px 14px;
		font-size: 13px;
	}

	.cont {
		margin: 4px 10px;
		height: 85px;
	}

	/* Welcome overlay — compact for small phones */
	.welcome-logo-container,
	.welcome-logo {
		width: 120px;
		height: 120px;
	}
	.welcome-title {
		font-size: 20px;
		margin-top: 16px;
	}
	.welcome-subtitle {
		font-size: 11px;
	}
	.welcome-instruction {
		font-size: 11px;
		padding: 0 16px;
	}
	.welcome-footer {
		bottom: 12px;
		padding: 6px 12px;
		border-radius: 30px;
	}
	.welcome-footer-logo { width: 22px; }
	.welcome-footer-text { font-size: 9px; }

	/* Hide some particles on very small screens for performance */
	.particle.p7, .particle.p8, .particle.p9,
	.particle.p10, .particle.p11, .particle.p12 {
		display: none;
	}
}

/* --- Landscape phones (short + wide) --- */
@media (max-height: 500px) and (orientation: landscape) {
	/* Welcome overlay — horizontal layout */
	.welcome-content {
		flex-direction: row;
		gap: 24px;
		align-items: center;
		padding: 0 20px;
	}
	.welcome-logo-container,
	.welcome-logo {
		width: 100px;
		height: 100px;
		flex-shrink: 0;
	}
	.welcome-logo-container {
		animation: none; /* disable float in landscape to save space */
	}
	.welcome-title {
		font-size: 20px;
		margin-top: 0;
		text-align: left;
	}
	.welcome-subtitle {
		font-size: 11px;
		text-align: left;
	}
	.welcome-divider {
		display: none;
	}
	.welcome-instruction {
		font-size: 11px;
		text-align: left;
		padding: 0;
	}
	.welcome-footer {
		bottom: 8px;
		padding: 5px 12px;
	}
	.welcome-footer-logo { width: 20px; }
	.welcome-footer-text { font-size: 9px; }

	/* Mobile header thinner in landscape */
	#mobileHeader {
		height: 40px;
	}
	div#container {
		padding-top: 40px;
	}

	/* Sidebar drawer narrower in landscape */
	div#nav {
		width: 260px;
	}

	/* Smaller logos and brand */
	.nav-logos {
		padding: 6px 6px;
	}
	.nav-logo-img { height: 28px; }
	.nav-brand { padding: 8px 12px 6px; }
	.nav-title { font-size: 16px; }
	.nav-subtitle { font-size: 9px; }

	/* Compact toolbar */
	#toolsArea { padding: 4px 10px; }

	/* Compact menutab */
	a.menutab {
		margin: 4px 10px;
		padding: 8px 14px;
		font-size: 13px;
	}

	/* Shorter cards */
	.cont {
		height: 75px;
		margin: 3px 10px;
	}

	/* Info panel full screen in landscape */
	div#infoPanel {
		left: 4px; right: 4px;
		top: 44px; bottom: 4px;
		padding: 16px;
	}
}


/* ============================================================
   jQuery UI Accordion overrides
   ============================================================ */
.ui-accordion .ui-accordion-header {
	margin: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	outline: none !important;
}

.ui-accordion .ui-accordion-content {
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
}

.ui-accordion .ui-accordion-header-icon {
	display: none; /* hide default jQuery UI icons */
}

/* Override jQuery UI widget font */
.ui-widget {
	font-family: var(--font) !important;
}
