:root {
	--green-900: #005d33;
	--green-800: #0a7546;
	--green-700: #118353;
	--green-100: #e8f3ec;
	--bg-page: #f1f3f4;
	--bg-surface: #ffffff;
	--text-900: #2b2f31;
	--text-700: #5b6368;
	--text-500: #8b9398;
	--border-soft: #d9e0e3;
	--shadow-soft: 0 2px 8px rgba(15, 32, 21, 0.08);
	--radius-s: 8px;
	--radius-m: 12px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	color: var(--text-900);
	font-family: "Trebuchet MS", "Lucida Sans Unicode", "Segoe UI", sans-serif;
	background: radial-gradient(circle at top left, #f7f9fa 0%, #edf1f2 45%, #e7ecee 100%);
}

a {
	color: inherit;
	text-decoration: none;
}

.eva-shell {
	display: flex;
	min-height: 100vh;
	flex-direction: column;
}

.top-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	border-bottom: 1px solid var(--border-soft);
	background: #ffffff;
	padding: 10px 24px;
}

.brand-block {
	display: flex;
	align-items: center;
	gap: 14px;
}

.brand-logo {
	display: grid;
	height: 54px;
	width: 54px;
	place-items: center;
	border-radius: 50%;
	border: 1px solid #b8d4c2;
	background: var(--green-100);
}

.brand-logo svg {
	height: 34px;
	width: 34px;
	fill: var(--green-800);
}

.brand-text strong {
	display: block;
	color: var(--green-800);
	font-size: 1.7rem;
	letter-spacing: 0.06em;
	line-height: 1;
}

.brand-text span {
	color: var(--text-700);
	font-size: 0.82rem;
}

.user-panel {
	display: flex;
	align-items: center;
	gap: 10px;
}

.icon-btn {
	display: grid;
	height: 32px;
	width: 32px;
	place-items: center;
	border: none;
	border-radius: 50%;
	background: #eef3ef;
	color: var(--green-800);
	cursor: pointer;
}

.icon-btn svg {
	height: 16px;
	width: 16px;
	fill: currentColor;
}

.icon-btn:hover {
	background: #e2ece5;
}

.user-name {
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text-700);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.avatar {
	display: grid;
	height: 42px;
	width: 42px;
	place-items: center;
	border: 2px solid #ffffff;
	border-radius: 50%;
	background: linear-gradient(145deg, #dfe7ef, #a7bacf);
	box-shadow: 0 0 0 1px #bdd0e1;
	color: #2d4054;
	font-weight: 700;
}

.main-nav {
	background: var(--green-800);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.main-nav-list {
	margin: 0;
	display: flex;
	list-style: none;
	gap: 4px;
	overflow-x: auto;
	padding: 0 20px;
	white-space: nowrap;
}

.main-nav-list li a {
	display: block;
	border-radius: 4px 4px 0 0;
	padding: 11px 13px;
	color: #f7fffa;
	font-size: 0.88rem;
}

.main-nav-list li a:hover,
.main-nav-list li a.active {
	background: rgba(255, 255, 255, 0.16);
}

.main-content {
	width: min(1200px, calc(100% - 40px));
	margin: 26px auto 36px;
	flex: 1;
}

.section-title-block h1 {
	margin: 0;
	color: #3a3f43;
	font-size: 2rem;
}

.section-title-block p {
	margin: 8px 0 18px;
	color: #616a70;
	font-weight: 700;
}

.filters-row {
	display: grid;
	grid-template-columns: 140px minmax(210px, 1fr) 280px 160px;
	align-items: end;
	gap: 12px;
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-s);
	background: #ffffff;
	padding: 12px;
	box-shadow: var(--shadow-soft);
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.field span {
	color: var(--text-700);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.field select,
.field input {
	height: 38px;
	border: 1px solid #c8d2d8;
	border-radius: 7px;
	background: #ffffff;
	padding: 8px 12px;
	color: #2e3437;
	font-size: 0.92rem;
}

.field input:focus,
.field select:focus {
	outline: 2px solid #b2d5bf;
	border-color: #8fbda0;
}

.field-search input {
	background: #fcfdfd;
}

.courses-grid {
	max-width: 1060px;
	margin: 18px auto 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(250px, 320px));
	justify-content: center;
	gap: 18px;
}

.course-card {
	display: flex;
	min-height: 254px;
	cursor: pointer;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #d8e0e2;
	border-radius: 10px;
	background: var(--bg-surface);
	box-shadow: var(--shadow-soft);
	transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.course-card:hover,
.course-card:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(15, 32, 21, 0.14);
}

.course-card:focus-visible {
	outline: 2px solid #83b69b;
	outline-offset: 2px;
}

.course-cover {
	position: relative;
	height: 92px;
	border-bottom: 1px solid #d6dde0;
}

.cover-amber {
	background: linear-gradient(135deg, #f0c25f 0%, #d5ab53 100%);
}

.cover-steel {
	background: linear-gradient(120deg, #c2ccd2 0%, #a7b1b8 100%);
}

.cover-violet {
	background: repeating-linear-gradient(45deg, #6261c5, #6261c5 8px, #7673d3 8px, #7673d3 16px);
}

.cover-rose {
	background:
		radial-gradient(circle at 20% 20%, #f99bc5 4px, transparent 5px),
		radial-gradient(circle at 70% 60%, #f075ae 8px, transparent 9px),
		#f58fbe;
	background-size: 46px 46px, 72px 72px, auto;
}

.cover-gray {
	background: linear-gradient(145deg, #d6dde2 0%, #c2ccd4 100%);
}

.cover-cyan {
	background: repeating-linear-gradient(60deg, #8ad9e1, #8ad9e1 14px, #73c7cf 14px, #73c7cf 28px);
}

.cover-teal {
	background: linear-gradient(130deg, #07b89f 0%, #0f9d88 100%);
}

.cover-jade {
	background: linear-gradient(145deg, #0fa896 0%, #1ec69f 100%);
}

.progress-badge {
	position: absolute;
	left: 10px;
	bottom: 10px;
	border-radius: 99px;
	background: rgba(255, 255, 255, 0.93);
	padding: 4px 8px;
	color: #0f5f3d;
	font-size: 0.74rem;
	font-weight: 700;
}

.course-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 12px 12px 10px;
}

.course-title {
	margin: 0;
	color: #394044;
	font-size: 0.88rem;
	font-weight: 800;
	line-height: 1.25;
	text-transform: uppercase;
}

.course-category {
	margin: 0;
	color: #7c868c;
	font-size: 0.75rem;
	text-transform: uppercase;
}

.course-actions {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.course-enter-btn {
	border: none;
	border-radius: 6px;
	background: var(--green-800);
	padding: 7px 12px;
	color: #ffffff;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
}

.course-enter-btn:hover {
	background: var(--green-900);
}

.course-menu-btn {
	height: 30px;
	width: 30px;
	border: none;
	border-radius: 50%;
	background: #edf2f3;
	color: #4a5359;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

.course-menu-btn:hover {
	background: #dfe7ea;
}

.empty-state {
	margin-top: 14px;
	border: 1px dashed #cfd8dc;
	border-radius: 8px;
	background: #ffffff;
	padding: 14px;
	color: #4f585d;
}

.hidden {
	display: none !important;
}

.view {
	display: none;
}

.view.view-active {
	display: block;
}

.detail-top-bar {
	margin-bottom: 14px;
}

.back-button {
	border: none;
	border-radius: 8px;
	background: #e1ece4;
	padding: 10px 14px;
	color: #0e643d;
	font-weight: 700;
	cursor: pointer;
}

.back-button:hover {
	background: #d0e2d6;
}

.course-detail-layout {
	display: grid;
	grid-template-columns: 2.2fr 1fr;
	gap: 16px;
}

.course-detail-layout.no-chatbot {
	grid-template-columns: 1fr;
}

.course-detail-layout.no-chatbot .chatbot-panel {
	display: none !important;
}

.course-detail-layout.no-chatbot ~ .tutor-toggle-bar,
.course-detail-layout.no-chatbot ~ .tutor-section {
	display: none !important;
}

.course-detail-card,
.chatbot-panel {
	border: 1px solid var(--border-soft);
	border-radius: 10px;
	background: #ffffff;
	padding: 18px;
	box-shadow: var(--shadow-soft);
}

.detail-header h2 {
	margin: 0 0 6px;
	color: #2f3538;
	font-size: 1.6rem;
}

.detail-category {
	margin: 0;
	color: #77828a;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.detail-description {
	margin: 14px 0 16px;
	color: #4f585d;
	line-height: 1.52;
}

.detail-sections {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.detail-panel h3 {
	margin: 0 0 10px;
	color: #275e42;
	font-size: 1rem;
}

.detail-list {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-left: 18px;
}

.detail-list li {
	color: #425158;
	line-height: 1.35;
}

.resource-link {
	color: #0e6f45;
	font-weight: 700;
}

.resource-link:hover {
	text-decoration: underline;
}

.chatbot-panel {
	border-left: 4px solid var(--green-700);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.chatbot-panel h3 {
	margin-top: 0;
	color: #2e363a;
	font-size: 1.1rem;
}

.chatbot-tagline {
	margin: 6px 0 10px;
	color: #0d6b43;
	font-weight: 700;
}

.chatbot-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.chatbot-reset {
	border: 1px solid #c9d7d0;
	border-radius: 999px;
	background: #f2f7f4;
	padding: 6px 12px;
	color: #2b5b42;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
}

.chatbot-reset:hover {
	background: #e6f1eb;
}

.chatbot-messages {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 360px;
	overflow-y: auto;
	padding: 10px;
	border-radius: 10px;
	border: 1px solid #d7e3de;
	background: linear-gradient(180deg, #f9fbfa 0%, #f1f6f3 100%);
}

.chat-message {
	display: flex;
}

.chat-message-user {
	justify-content: flex-end;
}

.chat-message-assistant,
.chat-message-system,
.chat-message-error {
	justify-content: flex-start;
}

.chat-bubble {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 0.9rem;
	line-height: 1.4;
	white-space: pre-wrap;
}

.chat-message-user .chat-bubble {
	background: #0f6f47;
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.chat-message-assistant .chat-bubble {
	background: #ffffff;
	color: #2f3538;
	border: 1px solid #d4dde1;
	border-bottom-left-radius: 4px;
}

.chat-message-system .chat-bubble {
	background: #eef4f0;
	color: #466252;
	border: 1px dashed #c7d6ce;
}

.chat-message-error .chat-bubble {
	background: #fff1f1;
	color: #7a2f2f;
	border: 1px solid #f2c8c8;
}

.chatbot-status {
	min-height: 18px;
	font-size: 0.78rem;
	color: #5c676c;
}

.chatbot-status.is-error {
	color: #8a3f3f;
}

.chatbot-form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	align-items: end;
}

.chatbot-input-wrap {
	position: relative;
}

.chatbot-input-actions {
	position: absolute;
	bottom: 7px;
	right: 8px;
	display: flex;
	gap: 5px;
	align-items: center;
}

.chatbot-form textarea {
	min-height: 64px;
	resize: vertical;
	border: 1px solid #c9d5d9;
	border-radius: 8px;
	padding: 10px 78px 10px 12px;
	font-family: inherit;
	font-size: 0.9rem;
	width: 100%;
	box-sizing: border-box;
}

.chatbot-form textarea:focus {
	outline: 2px solid #b2d5bf;
	border-color: #8fbda0;
}

.chatbot-send {
	border: none;
	border-radius: 8px;
	background: #117250;
	color: #ffffff;
	padding: 10px 16px;
	font-weight: 700;
	cursor: pointer;
}

.chatbot-send:disabled,
.chatbot-form textarea:disabled {
	background: #cfd9d3;
	color: #1f272a;
	cursor: not-allowed;
}

.chatbot-hint {
	margin: 0;
	color: #6a7479;
	font-size: 0.78rem;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.chatbot-button {
	margin-top: 10px;
	width: 100%;
	border: none;
	border-radius: 7px;
	background: #d6e2dc;
	padding: 10px 12px;
	color: #4b555a;
	font-weight: 700;
	cursor: not-allowed;
}

/* ── Tutor de Código ──────────────────────────────────────────────────────── */

.tutor-toggle-bar {
	margin-top: 20px;
}

.tutor-toggle-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid #b0cbb8;
	border-radius: 8px;
	background: #eaf3ec;
	padding: 10px 18px;
	color: #0a6b40;
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.12s;
}

.tutor-toggle-btn:hover {
	background: #d9ecde;
}

.tutor-icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
	flex-shrink: 0;
}

.tutor-toggle-chevron {
	font-size: 0.75rem;
	margin-left: 2px;
}

.tutor-section {
	margin-top: 16px;
	border: 1px solid #c2d9ca;
	border-radius: 12px;
	background: #ffffff;
	padding: 20px;
	box-shadow: var(--shadow-soft);
}

/* Controls bar */
.tutor-controls-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 14px;
	margin-bottom: 16px;
}

.tutor-selectors {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	flex: 1;
}

.tutor-label {
	display: flex;
	flex-direction: column;
	gap: 5px;
	color: var(--text-700);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.tutor-select {
	height: 38px;
	border: 1px solid #c8d2d8;
	border-radius: 7px;
	background: #fff;
	padding: 6px 10px;
	color: #2e3437;
	font-size: 0.88rem;
}

.tutor-unit-select {
	border-color: #b5c8d0;
	background: #f7fbfd;
	min-width: 130px;
}

/* Buttons */
.tutor-btn {
	height: 38px;
	border: none;
	border-radius: 7px;
	padding: 0 16px;
	font-weight: 700;
	font-size: 0.86rem;
	cursor: pointer;
	white-space: nowrap;
}

.tutor-btn-primary {
	background: var(--green-800);
	color: #fff;
}

.tutor-btn-primary:hover {
	background: var(--green-900);
}

.tutor-btn-primary:disabled {
	background: #a0bba8;
	cursor: not-allowed;
}

.tutor-btn-run {
	background: #1a6fa8;
	color: #fff;
}

.tutor-btn-run:hover { background: #155c8c; }
.tutor-btn-run:disabled { background: #8baec4; cursor: not-allowed; }

.tutor-btn-analyze {
	background: #7c3fa8;
	color: #fff;
}

.tutor-btn-analyze:hover { background: #672f90; }
.tutor-btn-analyze:disabled { background: #b09bc4; cursor: not-allowed; }

/* Exercise card */
.tutor-exercise-card {
	border: 1px solid #d4e8d9;
	border-left: 4px solid var(--green-700);
	border-radius: 8px;
	background: #f5fbf7;
	padding: 16px;
	margin-bottom: 16px;
}

.tutor-exercise-badge {
	display: inline-block;
	border-radius: 999px;
	background: var(--green-800);
	padding: 2px 10px;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.tutor-exercise-title {
	margin: 0 0 6px;
	color: #1e3e2a;
	font-size: 1rem;
}

.tutor-exercise-context {
	margin: 0 0 10px;
	color: #4a5d52;
	font-size: 0.88rem;
	line-height: 1.5;
}

.tutor-objective-block {
	border-top: 1px dashed #b9d4c0;
	padding-top: 8px;
}

.tutor-objective-label {
	color: #0f6b42;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tutor-objective-text {
	margin: 4px 0 0;
	color: #2d3f34;
	font-size: 0.9rem;
	line-height: 1.5;
}

/* Workspace */
.tutor-workspace {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	align-items: start;
}

/* Editor panel */
.tutor-editor-panel {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tutor-editor-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.tutor-editor-title {
	color: var(--text-700);
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tutor-action-btns {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.tutor-code-editor {
	width: 100%;
	min-height: 220px;
	border: 1px solid #c5d5cc;
	border-radius: 8px;
	background: #1a1f1c;
	padding: 12px 14px;
	color: #c8f0d6;
	font-family: "Cascadia Code", "Fira Code", "Consolas", "Courier New", monospace;
	font-size: 0.88rem;
	line-height: 1.55;
	resize: vertical;
	tab-size: 4;
}

.tutor-code-editor:focus {
	outline: 2px solid #3db87a;
	border-color: #3db87a;
}

.tutor-output-block {
	border: 1px solid #cdd8d4;
	border-radius: 8px;
	overflow: hidden;
}

.tutor-output-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #eef3f0;
	padding: 6px 12px;
	color: var(--text-700);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tutor-run-status {
	font-size: 0.78rem;
	font-weight: 700;
}

.tutor-run-status.status-ok { color: #0d7a45; }
.tutor-run-status.status-err { color: #a33030; }

.tutor-output {
	margin: 0;
	padding: 10px 14px;
	background: #f8faf9;
	color: #2a3530;
	font-family: "Cascadia Code", "Fira Code", "Consolas", "Courier New", monospace;
	font-size: 0.83rem;
	line-height: 1.55;
	max-height: 160px;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-all;
}

/* Feedback panel */
.tutor-feedback-panel {
	border: 1px solid #d4dde1;
	border-radius: 10px;
	background: #fafcfb;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: 620px;
	overflow-y: auto;
}

.tutor-feedback-heading {
	margin: 0;
	color: #2e363a;
	font-size: 1rem;
	border-bottom: 1px solid #e2eae6;
	padding-bottom: 8px;
}

.tutor-feedback-placeholder {
	text-align: center;
	padding: 24px 12px;
	color: #6a7479;
}

.tutor-placeholder-icon {
	font-size: 2.4rem;
	margin-bottom: 10px;
}

.tutor-feedback-placeholder p {
	margin: 6px 0;
	font-size: 0.88rem;
	line-height: 1.5;
}

.tutor-placeholder-hint {
	color: #5c676c;
	font-size: 0.8rem !important;
}

/* Loading spinner */
.tutor-feedback-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 24px;
	color: #5a6368;
	font-size: 0.88rem;
}

.tutor-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #d0e4d8;
	border-top-color: var(--green-700);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Trace section */
.tutor-trace-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tutor-trace-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.tutor-section-subtitle {
	margin: 0;
	color: #334a3c;
	font-size: 0.88rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tutor-trace-toggle {
	border: none;
	background: none;
	color: #0a6b40;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}

.tutor-trace-steps {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.trace-step {
	border: 1px solid #dce8e2;
	border-left: 3px solid var(--green-700);
	border-radius: 6px;
	background: #f7fbf8;
	padding: 10px 12px;
}

.trace-step-header {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 6px;
}

.trace-step-num {
	background: var(--green-800);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	border-radius: 4px;
	padding: 1px 6px;
}

.trace-line-num {
	color: var(--text-500);
	font-size: 0.75rem;
}

.trace-code-line {
	display: block;
	background: #1a1f1c;
	color: #c8f0d6;
	border-radius: 4px;
	padding: 5px 10px;
	font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
	font-size: 0.8rem;
	margin-bottom: 6px;
	white-space: pre-wrap;
	word-break: break-all;
}

.trace-explanation {
	margin: 0 0 6px;
	color: #3a4e42;
	font-size: 0.82rem;
}

.trace-memory {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	flex-wrap: wrap;
}

.trace-mem-label {
	color: var(--text-500);
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	white-space: nowrap;
	padding-top: 2px;
}

.trace-mem-table {
	border-collapse: collapse;
	font-size: 0.78rem;
}

.trace-mem-table td {
	padding: 1px 6px;
}

.mem-key {
	color: #1a6fa8;
	font-family: "Cascadia Code", "Consolas", monospace;
	font-weight: 700;
}

.mem-val {
	color: #7c3fa8;
	font-family: "Cascadia Code", "Consolas", monospace;
}

.trace-mem-empty {
	color: var(--text-500);
	font-size: 0.75rem;
	font-style: italic;
}

/* AI analysis */
.tutor-ai-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
	border-top: 1px solid #e2eae6;
	padding-top: 12px;
}

.tutor-ai-content {
	color: #2e3a34;
	font-size: 0.88rem;
	line-height: 1.6;
}

.tutor-ai-content strong {
	color: #0f5f3d;
}

.tutor-footer-hint {
	margin: 14px 0 0;
	color: #8a9499;
	font-size: 0.76rem;
	border-top: 1px dashed #d6e0da;
	padding-top: 10px;
}

/* Responsive tutor */
@media (max-width: 900px) {
	.tutor-workspace {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.tutor-selectors {
		flex-direction: column;
	}

	.tutor-action-btns {
		flex-direction: column;
	}

	.tutor-btn {
		width: 100%;
	}
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.main-footer {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 20px;
	background: #006737;
	padding: 24px min(40px, 5vw);
	color: #f3fff8;
}

.footer-column h4 {
	margin: 0 0 8px;
}

.footer-column p {
	margin: 4px 0;
	font-size: 0.9rem;
}

@media (max-width: 980px) {
	.filters-row {
		grid-template-columns: 1fr 1fr;
	}

	.courses-grid {
		grid-template-columns: repeat(2, minmax(240px, 340px));
	}

	.course-detail-layout {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.top-header {
		align-items: flex-start;
		padding-inline: 14px;
	}

	.main-nav-list {
		padding-inline: 10px;
	}

	.main-content {
		width: calc(100% - 24px);
		margin-top: 18px;
	}

	.section-title-block h1 {
		font-size: 1.7rem;
	}

	.courses-grid {
		grid-template-columns: minmax(220px, 420px);
	}

	.detail-sections {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 520px) {
	.filters-row {
		grid-template-columns: 1fr;
	}

	.user-name {
		max-width: 140px;
	}

	.main-nav-list li a {
		padding: 10px 9px;
		font-size: 0.8rem;
	}

	.courses-grid {
		grid-template-columns: 1fr;
	}

	.brand-text strong {
		font-size: 1.5rem;
	}
}

/* ── Voice buttons (chatbot) — floating inside textarea ───────────────────── */

.chatbot-voice-btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	background: transparent;
	transition: background 0.12s, border-color 0.12s, transform 0.08s, box-shadow 0.12s;
	flex-shrink: 0;
}

.chatbot-voice-btn:active {
	transform: scale(0.88);
}

.chatbot-voice-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	transform: none;
}

.chatbot-voice-btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	display: block;
	pointer-events: none;
}

/* Microphone */
.chatbot-mic {
	color: #0a7546;
}

.chatbot-mic:hover {
	background: rgba(10, 117, 70, 0.12);
	border-color: rgba(10, 117, 70, 0.3);
}

.chatbot-mic.recording {
	background: #fcebeb;
	border-color: #f7acac;
	color: #a81919;
	animation: pulse-rec 0.85s ease-in-out infinite;
}

/* Speaker / TTS */
.chatbot-tts {
	color: #1a5aa8;
}

.chatbot-tts:hover {
	background: rgba(26, 90, 168, 0.12);
	border-color: rgba(26, 90, 168, 0.3);
}

.chatbot-tts.speaking {
	background: rgba(26, 90, 168, 0.15);
	border-color: rgba(26, 90, 168, 0.45);
	animation: pulse-spk 1.15s ease-in-out infinite;
}

@keyframes pulse-rec {
	0%, 100% { box-shadow: 0 0 0 0 rgba(196, 48, 48, 0.35); }
	50%       { box-shadow: 0 0 0 5px rgba(196, 48, 48, 0); }
}

@keyframes pulse-spk {
	0%, 100% { box-shadow: 0 0 0 0 rgba(26, 90, 168, 0.3); }
	50%       { box-shadow: 0 0 0 5px rgba(26, 90, 168, 0); }
}

/* ── Data-structure visualizations (tutor trace) ──────────────────────────── */

.trace-viz {
	margin-top: 8px;
	padding: 8px 10px;
	background: #f0f7ff;
	border: 1px solid #cce0f5;
	border-radius: 6px;
}

.trace-viz-label {
	font-size: 0.7rem;
	font-weight: 700;
	color: #1a6fa8;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
}

/* Array: horizontal dashed box */
.trace-viz-array {
	display: inline-flex;
	flex-direction: row;
	gap: 6px;
	background: rgba(26, 111, 168, 0.02);
	padding: 8px;
	border-radius: 6px;
	border: 1px dashed #cce0f5;
	align-items: flex-start;
}

/* Queue: horizontal pipe */
.trace-viz-queue {
	display: inline-flex;
	flex-direction: row;
	gap: 4px;
	border-top: 3px solid #1a6fa8;
	border-bottom: 3px solid #1a6fa8;
	padding: 6px 12px;
	background: rgba(26, 111, 168, 0.04);
	min-height: 48px;
	align-items: center;
}

/* Stack: vertical cylinder open at the top */
.trace-viz-stack {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	border-left: 3px solid #1a6fa8;
	border-right: 3px solid #1a6fa8;
	border-bottom: 3px solid #1a6fa8;
	border-bottom-left-radius: 8px;
	border-bottom-right-radius: 8px;
	padding: 12px 8px 6px 8px;
	background: rgba(26, 111, 168, 0.04);
	min-width: 100px;
	min-height: 100px;
	align-items: stretch;
}

.viz-cell-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.viz-cell {
	min-width: 36px;
	min-height: 28px;
	border: 2px solid #1a6fa8;
	border-radius: 4px;
	background: #ffffff;
	color: #1a3a54;
	font-family: "Cascadia Code", "Consolas", monospace;
	font-size: 0.76rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 6px;
	gap: 4px;
}

.viz-cell-top {
	border-color: #0a7546;
	background: #e8f3ec;
	color: #0a6b3e;
}

.viz-top-label {
	font-size: 0.62rem;
	color: #0a6b3e;
	font-weight: 700;
	white-space: nowrap;
}

.viz-index {
	font-size: 0.62rem;
	color: #8a949a;
	font-family: "Cascadia Code", "Consolas", monospace;
}

.viz-queue-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.62rem;
	color: #1a6fa8;
	font-weight: 700;
	margin-top: 3px;
	padding: 0 2px;
}

/* ── Panel visual paso a paso ────────────────────────────────────────── */

.tutor-visual-panel {
	background: #f0f7ff;
	border: 1px solid #cce0f5;
	border-radius: 8px;
	padding: 12px;
	margin-top: 12px;
	flex-shrink: 0;
}

.tutor-visual-panel.hidden {
	display: none;
}

.viz-panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.viz-panel-title {
	font-size: 0.8rem;
	font-weight: 700;
	color: #1a6fa8;
}

.viz-step-counter {
	font-size: 0.75rem;
	color: #5a7080;
	font-family: "Cascadia Code", "Consolas", monospace;
}

.viz-nav-controls {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.viz-nav-btn {
	background: #0a7546;
	color: white;
	border: none;
	border-radius: 4px;
	padding: 4px 12px;
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.viz-nav-btn:hover {
	background: #095a3a;
}

.viz-nav-btn:disabled {
	background: #c0c0c0;
	cursor: not-allowed;
}

.viz-step-info {
	font-family: "Cascadia Code", "Consolas", monospace;
	font-size: 0.75rem;
	color: #234;
	margin-bottom: 8px;
	line-height: 1.4;
}

.viz-structures-area {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.viz-memory-frame-area {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.viz-memory-frame {
	border: 1px solid #1a6fa8;
	border-radius: 6px;
	background: white;
	padding: 6px 10px;
	font-size: 0.73rem;
}

.viz-frame-title {
	text-transform: uppercase;
	font-size: 0.65rem;
	color: #1a6fa8;
	font-weight: 700;
	margin-bottom: 4px;
}

.viz-frame-var {
	display: flex;
	gap: 6px;
	margin-bottom: 2px;
	font-family: "Cascadia Code", "Consolas", monospace;
	line-height: 1.3;
}

.viz-var-name {
	color: #c0392b;
	font-weight: 600;
}

.viz-var-val {
	color: #6c3483;
}

.viz-tree-svg-wrap {
	overflow: hidden;
	max-width: 100%;
	margin-top: 8px;
}

.viz-tree-svg-wrap svg {
	max-width: 100%;
	height: auto;
}

.viz-linked-list-wrap {
	display: flex;
	align-items: center;
	gap: 0;
	flex-wrap: wrap;
	margin-top: 8px;
}

.viz-ll-node {
	display: inline-flex;
	border: 2px solid #1a6fa8;
	border-radius: 6px;
	background: white;
	font-size: 0.75rem;
	font-family: "Cascadia Code", "Consolas", monospace;
	overflow: hidden;
	flex-shrink: 0;
}

.viz-ll-data {
	padding: 4px 8px;
	color: #1a3a54;
	font-weight: 700;
	border-right: 1px solid #cce0f5;
}

.viz-ll-next {
	padding: 4px 6px;
	color: #1a6fa8;
	background: #f0f7ff;
	font-weight: 700;
}

.viz-ll-arrow {
	margin: 0 4px;
	color: #1a6fa8;
	font-weight: 700;
	font-size: 0.85rem;
	flex-shrink: 0;
}

.viz-ll-null {
	color: #8a949a;
	font-size: 0.75rem;
	font-family: "Cascadia Code", "Consolas", monospace;
	padding: 4px 8px;
	flex-shrink: 0;
}

/* ── Estilos para el Estado Básico (CPU / Memoria RAM) ── */
.viz-basic-state {
	display: flex;
	gap: 16px;
	width: 100%;
	flex-wrap: wrap;
	margin-top: 8px;
}

.viz-cpu-card {
	flex: 1 1 220px;
	background: #1e1e24;
	color: #a9b7c6;
	border-radius: 8px;
	padding: 12px;
	border: 1px solid #323238;
	box-shadow: 0 4px 6px rgba(0,0,0,0.15);
	font-family: "Cascadia Code", "Consolas", monospace;
}

.viz-cpu-title {
	font-size: 0.7rem;
	font-weight: 700;
	color: #4ec9b0;
	text-transform: uppercase;
	margin-bottom: 8px;
	border-bottom: 1px solid #323238;
	padding-bottom: 4px;
	display: flex;
	justify-content: space-between;
}

.viz-cpu-instruction {
	font-size: 0.8rem;
	color: #ffffff;
	margin-bottom: 8px;
}

.viz-cpu-alu {
	background: #2b2b30;
	border-radius: 6px;
	padding: 8px;
	font-size: 0.72rem;
	margin-top: 6px;
	border: 1px solid #3c3f41;
}

.viz-alu-title {
	color: #ffc66d;
	font-weight: 700;
	margin-bottom: 4px;
}

.viz-cpu-decision {
	background: #2b2b30;
	border: 1px solid #3c3f41;
	border-radius: 6px;
	padding: 8px;
	font-size: 0.72rem;
	margin-top: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.viz-decision-diamond {
	width: 50px;
	height: 50px;
	background: #733303;
	color: white;
	transform: rotate(45deg);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	border-radius: 4px;
	border: 1px solid #e08e45;
}

.viz-decision-diamond span {
	transform: rotate(-45deg);
	font-size: 0.6rem;
}

.viz-ram-card {
	flex: 1 1 240px;
	background: #ffffff;
	border: 1px solid #cce0f5;
	border-radius: 8px;
	padding: 12px;
	box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.viz-ram-title {
	font-size: 0.7rem;
	font-weight: 700;
	color: #1a6fa8;
	text-transform: uppercase;
	margin-bottom: 8px;
	border-bottom: 1px solid #e8f0fe;
	padding-bottom: 4px;
}

.viz-ram-grid {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.viz-ram-row {
	display: flex;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	overflow: hidden;
	font-family: "Cascadia Code", "Consolas", monospace;
	font-size: 0.7rem;
	background: #f7fafc;
}

.viz-ram-addr {
	background: #edf2f7;
	color: #2d3748;
	padding: 4px 6px;
	min-width: 60px;
	text-align: center;
	border-right: 1px solid #e2e8f0;
}

.viz-ram-var {
	flex: 1;
	color: #c0392b;
	font-weight: 600;
	padding: 4px 8px;
	border-right: 1px solid #e2e8f0;
}

.viz-ram-val {
	flex: 1;
	color: #2c3e50;
	font-weight: 700;
	padding: 4px 8px;
	background: white;
}

/* ── Markdown Code block styles inside AI Analisis ── */
.tutor-code-block {
	background: #2d3748;
	color: #f7fafc;
	padding: 10px 12px;
	border-radius: 6px;
	font-family: "Cascadia Code", "Consolas", monospace;
	font-size: 0.8rem;
	overflow-x: auto;
	margin: 8px 0;
	border-left: 4px solid #1a6fa8;
}

.tutor-inline-code {
	background: #edf2f7;
	color: #2d3748;
	padding: 2px 4px;
	border-radius: 4px;
	font-family: "Cascadia Code", "Consolas", monospace;
	font-size: 0.85rem;
}

/* ── Micro-animación de entrada ── */
@keyframes popIn {
	0% {
		opacity: 0;
		transform: scale(0.8);
		background-color: #ffe066;
		border-color: #f59f00;
	}
	50% {
		background-color: #ffe066;
		border-color: #f59f00;
	}
	100% {
		opacity: 1;
		transform: scale(1);
	}
}

.viz-animate-enter {
	animation: popIn 0.4s ease-out;
}

/* Hash Table Visualization */
.viz-hash-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 8px;
	font-family: "Cascadia Code", "Consolas", monospace;
	font-size: 0.75rem;
	background: #ffffff;
	border: 1px solid #cce0f5;
	border-radius: 6px;
	overflow: hidden;
}

.viz-hash-table td {
	padding: 6px 10px;
	border: 1px solid #e2e8f0;
}

.viz-hash-key {
	background: #edf2f7;
	color: #1a6fa8;
	font-weight: 700;
	width: 40%;
}

.viz-hash-val {
	color: #7c3fa8;
	font-weight: 700;
}

/* Stdin Inputs Block */
.tutor-input-block {
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.tutor-inputs-label {
	font-size: 0.72rem;
	font-weight: 700;
	color: #334a3c;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tutor-inputs-field {
	width: 100%;
	min-height: 48px;
	padding: 8px 12px;
	border: 1px solid #dce8e2;
	border-radius: 6px;
	background: #f7faf8;
	color: #2d3748;
	font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
	font-size: 0.8rem;
	resize: vertical;
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.tutor-inputs-field:focus {
	border-color: var(--green-700);
	box-shadow: 0 0 0 2px rgba(10, 107, 64, 0.1);
}

/* ── Chatbot Tutorial Overlay ───────────────────────────────────────────── */
.tutorial-highlight {
	z-index: 10001 !important;
	position: relative !important;
	pointer-events: none !important;
	background: #ffffff !important;
	box-shadow: 0 0 0 10px #ffffff, 0 0 25px rgba(255, 255, 255, 0.9) !important;
	transition: all 0.3s ease !important;
}

@keyframes pulse-anim {
	0% {
		transform: scale(0.85);
		box-shadow: 0 0 0 0 rgba(16, 124, 65, 0.7);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 8px rgba(16, 124, 65, 0);
	}
	100% {
		transform: scale(0.85);
		box-shadow: 0 0 0 0 rgba(16, 124, 65, 0);
	}
}

