fhtml { box-sizing: border-box; font-size: 62.5%; }
*, *::before, *::after { box-sizing: border-box; }
body { font-size: 1.6rem; line-height: 1.6; margin: 0; padding-top: 70px; font-family: "Open Sans", Arial, Helvetica, sans-serif; background-color: #f2f0ea; }

hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eeeeee; }
button, input, select, textarea { font: inherit; margin: 0; color: inherit; }

/* ── Design tokens the dd- classes rely on (var(--color-*)) ──
   Drop this block if your site already defines these globally. */
:root {
  --color-text-primary: #1f2328;
  --color-text-secondary: #57606a;
  --color-text-tertiary: #8b949e;
  --color-text-danger: #cc0000;
  --color-background-primary: #ffffff;
  --color-background-secondary: #eef1f5;
  --color-border-secondary: #d0d7de;
  --color-border-tertiary: #e8ebee;
  --color-accent: #0a66c2;
  --color-accent-bg: #eaf2fb;
  --font-sans: inherit;
  --border-radius-md: 6px;

  /* ── Modal/Toast tokens — referenced throughout the .mc- rules below
     (backdrop, dialog, content, toast) but were previously undefined,
     which silently broke Modal styling (no backdrop dim, no shadow, etc). ── */
  --mc-surface: #ffffff;
  --mc-border: #e5e7eb;
  --mc-text: #1f2328;
  --mc-muted: #9ca3af;
  --mc-radius: 10px;
  --mc-shadow: 0 20px 50px -12px rgba(15, 17, 21, 0.35);
  --mc-duration: 220ms;
  --mc-easing: cubic-bezier(0.22, 1, 0.36, 1);
  --mc-backdrop: rgba(15, 17, 21, 0.55);
  --mc-blue: #00a9e0; /* same blue as .mc-btn.mc-primary */
}

.text-center { text-align: center; }
.fide-title { color: #cc0000; }

.mc-card { display: block; margin-bottom: 30px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); padding: 5px; border: 1px solid transparent; border-radius: 4px; transition: box-shadow .5s, border-color 1s; }
.mc-card h2 { display: block; padding: 9px 4px 4px 4px; text-align: center; font-size: 17px; margin: 0; line-height: 27px; }
.mc-card h2 strong { color: #cc0000; }
.mc-card img { transition: opacity .5s; }
.mc-card:hover { box-shadow: 0 1px 3px #337ab7; border-color: #337ab7; text-decoration: none; }
.mc-card:hover img { opacity: .7; }
.mc-card:hover h2 { color: #337ab7; }

.mc-thumbnail { display: block; padding: 5px; margin-bottom: 20px; line-height: 1.43; background-color: #fff; border: 1px solid #ccc; border-radius: 4px; transition: all 0.2s ease-in-out; }
.mc-thumbnail img { margin-left: auto; margin-right: auto; border-radius: 4px; }
.mc-thumbnail:hover, .mc-thumbnail:focus { opacity: 0.7; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); border-color: #0066cc; }

.mc-layout { display: flex; flex-wrap: wrap; gap: 20px 30px; }
.mc-layout > .sidebar, .mc-layout > .main { width: 100%; min-width: 0; }

@media (min-width: 768px) {
    .mc-layout > .sidebar { width: calc(25% - 22.5px); }
    .mc-layout > .main { width: calc(75% - 7.5px); }
}

.items .item { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; margin-bottom: 10px; }
.items .item .left-column, .items .item .right-column { box-sizing: border-box; padding-left: 15px; padding-right: 15px; margin-top: 20px; }
.items .item .left-column, .items .item .right-column { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 480px) and (max-width: 767px) {
   .items .item .left-column { flex: 0 0 33.33333%; max-width: 33.33333%; }
   .items .item .right-column { flex: 0 0 66.66667%; max-width: 66.66667%; }
}

@media (min-width: 768px) {
   .items .item .left-column { flex: 0 0 25%; max-width: 25%; }
   .items .item .right-column { flex: 0 0 75%; max-width: 75%; }
}

@media (max-width: 480px) {
   .items .item .left-column { flex: 0 0 70%; max-width: 70%; margin-left: 15%; margin-right: 15%; }
   .items .item .right-column { margin-top: 0; }
}

.items-wide .item { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; margin-bottom: 10px; }
.items-wide .item .left-column, .items-wide .item .right-column { box-sizing: border-box; padding-left: 15px; padding-right: 15px; margin-top: 20px; }
.items-wide .item .left-column, .items-wide .item .right-column { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 768px) {
   .items-wide .item .left-column { flex: 0 0 41.66667%; max-width: 41.66667%; }
   .items-wide .item .right-column { flex: 0 0 58.33333%; max-width: 58.33333%; }
}

.items-medium .item { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; margin-bottom: 10px; }
.items-medium .item .left-column, .items-medium .item .right-column { box-sizing: border-box; padding-left: 15px; padding-right: 15px; margin-top: 20px; }
.items-medium .item .left-column, .items-medium .item .right-column { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 480px) and (max-width: 767px) {
   .items-medium .item .left-column { flex: 0 0 33.33333%; max-width: 33.33333%; }
   .items-medium .item .right-column { flex: 0 0 66.66667%; max-width: 66.66667%; }
}

@media (min-width: 768px) {
   .items-medium .item .left-column { flex: 0 0 33.33333%; max-width: 33.33333%; }
   .items-medium .item .right-column { flex: 0 0 66.66667%; max-width: 66.66667%; }
}

@media (max-width: 480px) {
/*    .items-medium .item .left-column { flex: 0 0 70%; max-width: 70%; margin-left: 15%; margin-right: 15%; } */
   .items-medium .item .right-column { margin-top: 0; }
}

.course-progress { margin: 10px 0 15px; padding: 12px 14px; background: #fbf9f5; border: 1px solid #e5dfd3; border-radius: 6px; max-width: 520px; }
.course-progress-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 6px; }
.course-progress-percent { font-weight: 600; font-size: 1.5rem; color: var(--color-text-primary); }
.course-progress-meta { font-size: 1.3rem; color: var(--color-text-secondary); }
.course-progress .mc-progress { height: 10px; margin-bottom: 10px; }
.course-progress-foot { display: flex; align-items: center; gap: 12px; }
.course-progress-foot .mc-btn { margin-left: auto; flex-shrink: 0; }
.course-progress-chapter { flex: 1; min-width: 0; font-size: 1.4rem; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-progress-label { color: var(--color-text-secondary); margin-right: 4px; }

@media (max-width: 480px) {
    .course-progress-foot { flex-wrap: wrap; }
    .course-progress-foot .mc-btn { width: 100%; margin-left: 0; justify-content: center; }
}

a:hover { text-decoration: none; }

.mc-toast-container { position: fixed; top: 100px; right: 24px; z-index: 1200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mc-toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--mc-radius); background: #333; color: #fff; font-size: 1.4rem; box-shadow: 0 4px 8px rgba(0,0,0,0.2); opacity: 0; transform: scale(0.95); transition: opacity 200ms ease, transform 200ms ease; cursor: pointer; }
.mc-toast.mc-show { opacity: 1; transform: scale(1); }
.mc-toast-success { background: #2e7d32; }
.mc-toast-error { background: #c0392b; }
.mc-toast-warning { background: #b7791f; }
.mc-toast-close { background: none; border: none; color: inherit; font-size: 1.8rem; line-height: 1; cursor: pointer; margin-left: auto; padding: 0; }

/* ── dd- component (from Dropdown.js's own stylesheet, unmodified) ── */
.dd-wrapper { position: relative; display: inline-block; --dd-gap: 4px; --dd-gap-arrow: 7px; }
.dd-trigger { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer; color: var(--color-text-primary); line-height: 1.4; white-space: nowrap; }
.dd-trigger { background: transparent; border: none; }
.dd-trigger:hover:not(.mc-btn):not(.mc-label) { background: rgba(0, 0, 0, 0.05); color: #111827; border-radius: 4px; }
.dd-trigger .dd-arrow { font-size: 12px; transition: transform 0.15s; display: inline-block; flex-shrink: 0; }
.dd-trigger.open .dd-arrow { transform: rotate(180deg); }
.dd-trigger .dd-icon { flex-shrink: 0; }
.dd-trigger .dd-trigger-label:empty { display: none; }
.dd-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.sl-trigger .dd-trigger-label { flex: 1; } /* Select's fixed-width button: label fills the space, caret stays pinned to the right edge */
.dd-menu { position: absolute; top: calc(100% + var(--dd-gap)); left: 0; min-width: 180px; background: var(--color-background-primary); border: 0.5px solid var(--color-border-secondary); }
.dd-menu { border-radius: 4px; padding: 4px 0; z-index: 1010; display: none; box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.dd-menu.right { right: 0; left: auto; }
.dd-menu.open  { display: block; }
.dd-menu:has(.dd-menu-scroll) { padding: 0; }
.dd-menu-scroll { padding: 4px 0; }
.dd-popup { min-width: 240px; }
.dd-popup .dd-menu-scroll { padding: 0; } /* .dd-popup-body supplies its own padding instead */
.dd-menu::-webkit-scrollbar, .dd-menu-scroll::-webkit-scrollbar { width: 4px; }
.dd-menu::-webkit-scrollbar-track, .dd-menu-scroll::-webkit-scrollbar-track { background: transparent; }
.dd-menu::-webkit-scrollbar-thumb, .dd-menu-scroll::-webkit-scrollbar-thumb { background: var(--color-border-secondary); border-radius: 99px; }

/* ── placement — which side of the trigger the menu opens on (default: bottom) ── */
.dd-menu.pop-top   { top: auto; bottom: calc(100% + var(--dd-gap)); }
.dd-menu.pop-left  { top: 0; left: auto; right: calc(100% + var(--dd-gap)); }
.dd-menu.pop-right { top: 0; left: calc(100% + var(--dd-gap)); }

/* ── popover content (custom HTML instead of a menu) ── */
.dd-popup-body { padding: 14px 16px; font-size: 1.4rem; line-height: 1.5; color: var(--color-text-primary); }
.dd-popup-body a { color: #337ab7;  border-bottom: none; }
.dd-popup-body a:hover { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }

.dd-menu-arrow { position: absolute; width: 10px; height: 10px; background: var(--color-background-primary); border: 0.5px solid var(--color-border-secondary); transform: rotate(45deg); }
.dd-menu:not(.pop-top):not(.pop-left):not(.pop-right) .dd-menu-arrow { top: -5px; border-bottom: none; border-right: none; }
.dd-menu.pop-top   .dd-menu-arrow { bottom: -5px; top: auto; border-top: none; border-left: none; }
.dd-menu.pop-left  .dd-menu-arrow { right: -5px; left: auto; top: 14px; border-bottom: none; border-left: none; }
.dd-menu.pop-right .dd-menu-arrow { left: -5px; top: 14px; border-top: none; border-right: none; }
.dd-menu:not(.pop-left):not(.pop-right).right .dd-menu-arrow { left: auto; right: 14px; }
.dd-menu:not(.pop-left):not(.pop-right):not(.right) .dd-menu-arrow { left: 14px; }

.dd-menu:has(.dd-menu-arrow)           { top: calc(100% + var(--dd-gap-arrow)); }
.dd-menu:has(.dd-menu-arrow).pop-top   { top: auto; bottom: calc(100% + var(--dd-gap-arrow)); }
.dd-menu:has(.dd-menu-arrow).pop-left  { top: 0; left: auto; right: calc(100% + var(--dd-gap-arrow)); }
.dd-menu:has(.dd-menu-arrow).pop-right { top: 0; left: calc(100% + var(--dd-gap-arrow)); }
.dd-item { padding: 8px 14px; cursor: pointer; color: var(--color-text-primary); white-space: nowrap; display: flex; align-items: center; gap: 15px; text-decoration: none; }
.dd-item:hover   { background: var(--color-background-secondary); }
.dd-item.danger  { color: var(--color-text-danger); }
.dd-item.selected { background: var(--color-accent-bg); color: var(--color-accent); font-weight: 500; }
.dd-divider { border: none; border-top: 0.5px solid var(--color-border-tertiary); margin: 4px 0; }
.dd-group-label { font-size: 12px; color: var(--color-text-tertiary); padding: 6px 14px 2px; font-weight: 500; }

.dd-filter-wrap { padding: 10px; }
.dd-filter { width: 100%; padding: 6px 12px; font-family: var(--font-sans); border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-md); background: var(--color-background-secondary); color: var(--color-text-primary); outline: none; }
.dd-filter:focus { border-color: var(--color-accent); }
.dd-no-results { padding: 10px 14px; font-size: 13px; color: var(--color-text-tertiary); text-align: center; }

.dd-item.active { background: var(--color-background-secondary); box-shadow: inset 2px 0 0 var(--color-accent); }

.dd-popup-body:has(.sl-multi-body) { padding: 0; }

/* Utilities (unprefixed — generic helpers, not mc- components) */
.icon-left  { margin-right: 9px; }
.icon-right { margin-left: 9px; }

/* Your CSS (one-line per rule) */
.mc-btn { padding: 10px 20px; border-radius: 6px; font-size: 1.6rem; line-height: 1.33; cursor: pointer; border: 1px solid transparent; display: inline-flex;  }
.mc-btn { filter: brightness(1); transition: filter 0.25s ease, box-shadow 250ms ease, transform 100ms ease; align-items: center; justify-content: center; text-align: center; white-space: nowrap; }
.mc-btn:hover { filter: brightness(0.95); }

.mc-active-down:active { box-shadow: 0 1px 2px rgba(0,0,0,0.12); transform: translateY(1px); }
.mc-btn.mc-default { color: #333; background-color: #f3f4f6; text-shadow: 1px 1px rgba(255,255,255,0.5); border-bottom-color: #ccc; box-shadow: 0 3px 4px -2px rgba(0,0,0,0.25); }
.mc-btn.mc-default:hover { border-bottom-color: #ccc; }
.mc-btn.mc-primary { color: #fff; background-color: #00a9e0; border: 1px solid rgba(0,0,0,0.15); box-shadow: 0 4px 4px -2px rgba(0,0,0,0.3); text-shadow: 1px 1px 1px rgba(0,0,0,0.25); }
.mc-btn.mc-danger { color: #fff; background-color: #e74c3c; border: 1px solid rgba(0,0,0,0.15); box-shadow: 0 4px 4px -2px rgba(0,0,0,0.3); text-shadow: 1px 1px 1px rgba(0,0,0,0.25); }
.mc-btn.mc-white { color: #333; background-color: #fff; border: 1px solid #d1d5db; box-shadow: 0 4px 4px -2px rgba(0,0,0,0.1); text-shadow: none; }
.mc-btn.mc-success { color: #fff; font-weight: 500; background-color: #5cb85c; border: 1px solid rgba(0,0,0,0.15); box-shadow: 0 4px 4px -2px rgba(0,0,0,0.3); text-shadow: 1px 1px 1px rgba(0,0,0,0.25); }

.mc-btn.mc-payment:hover { box-shadow: 0 1px 3px #337ab7; border-color: rgba(0,0,0,0.15); }
.mc-btn.mc-payment:hover img { opacity: 0.7; }

.mc-danger.mc-outline { color: #cc0000; border-color: #cc0000; background-color: white; text-shadow: none; }
/* .mc-danger.mc-outline:hover { background: #eee; } */

/* Button group */
.mc-btn-group { display: inline-flex; }
.mc-btn-group .dd-trigger { display: inline-flex; align-items: center; justify-content: center; }
.mc-btn-group > .mc-btn, .mc-btn-group > .dd-wrapper > .mc-btn { border-radius: 0; position: relative; }
.mc-btn-group > .mc-btn:first-child, .mc-btn-group > .dd-wrapper:first-child > .mc-btn { border-radius: 6px 0 0 6px; }
.mc-btn-group > .mc-btn:last-child, .mc-btn-group > .dd-wrapper:last-child > .mc-btn { border-radius: 0 6px 6px 0; }
.mc-btn-group > .mc-btn:not(:first-child), .mc-btn-group > .dd-wrapper:not(:first-child) > .mc-btn { margin-left: -1px; }
.mc-btn-group:has(> :only-child) .mc-btn { border-radius: 6px; }

.mc-btn-group.mc-btn-group-justified { display: flex; align-items: stretch; width: 100%; }
.mc-btn-group.mc-btn-group-justified > .mc-btn, .mc-btn-group.mc-btn-group-justified > .dd-wrapper { flex: 1 1 0; width: 1%; min-width: 0; }

.mc-btn-group.mc-btn-group-justified > .dd-wrapper { display: flex; }
.mc-btn-group.mc-btn-group-justified > .dd-wrapper > .mc-btn { flex: 1 1 auto; width: 100%; min-width: 0; overflow: hidden; white-space: nowrap;}

/* Active/toggled state */
.mc-btn.active { filter: brightness(0.9); color: #fff !important; border-color: #0087b3; box-shadow: inset 0 3px 5px rgba(0,0,0,0.12); }
.mc-btn.mc-white.active, .mc-btn.mc-default.active { color: black !important; } 

.mc-btn .icon-left { margin-right: 7px; }
.mc-btn .icon-right { margin-left: 7px; }
.mc-btn.mc-lg .icon-left, .mc-btn.mc-large .icon-left { margin-right: 10px; }
.mc-btn.mc-lg .icon-right, .mc-btn.mc-large .icon-right { margin-left: 10px; }

.mc-btn.mc-block { display: flex; width: 100%; justify-content: center; }
.mc-btn.mc-block .dd-trigger-label { flex: 1; }
.sl-trigger.mc-block { min-width: 0; max-width: none; }
.dd-wrapper:has(.mc-btn.mc-block) { display: block; width: 100%; }

.mc-input { width: 100%; line-height: 1.33; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 1.6rem; outline: none; transition: border-color var(--mc-duration), box-shadow var(--mc-duration); }
.mc-input:hover { border-color: #80bdff; box-shadow: 0 0 0 3px rgba(213, 213, 213, 0.5); }
.mc-input:focus { border-color: #80bdff; box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); }
.mc-input[readonly], .mc-input:disabled { background-color: #f3f4f6; color: #6b7280; cursor: default; }
.mc-input:disabled { cursor: not-allowed; }

body.mc-open { overflow: hidden; }
.mc-backdrop { display: none; position: fixed; inset: 0; z-index: 1050; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; background: transparent; transition: background var(--mc-duration) var(--mc-easing); }
.mc-backdrop.mc-show { background: var(--mc-backdrop); }
.mc-dialog { width: 100%; max-width: 500px; margin: auto 0; opacity: 0; transform: translateY(-24px) scale(0.96); transition: opacity var(--mc-duration) var(--mc-easing), transform var(--mc-duration) var(--mc-easing); }
.mc-backdrop.mc-show .mc-dialog { opacity: 1; transform: translateY(0) scale(1); }
.mc-dialog.mc-pulse { animation: mc-pulse 200ms ease-in-out; }
@keyframes mc-pulse { 50% { transform: scale(1.02); } }
.mc-dialog.modal-sm { max-width: 430px; }
.mc-dialog.modal-lg { max-width: 830px; }
.mc-content { display: flex; flex-direction: column; background: var(--mc-surface); border-radius: var(--mc-radius); box-shadow: var(--mc-shadow); outline: none; overflow: hidden; }
.mc-header, .mc-body, .mc-footer { min-width: 0; }
.mc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.mc-title { font-size: 3rem; font-weight: 600; color: var(--mc-text); line-height: 1.4; }
.mc-close { flex-shrink: 0; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 8px; color: var(--mc-muted); font-size: 2rem; cursor: pointer; transition: background 250ms ease, color 250ms ease; padding: 0; }
.mc-close:hover { background: #f2f3f5; color: var(--mc-text); }
.mc-close:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.mc-body { padding: 20px 24px; color: var(--mc-text); font-size: 1.6rem; line-height: 1.55; }
.mc-footer { display: flex; justify-content: flex-end; gap: 15px; padding: 20px 24px 24px; }
.mc-confirm-message { margin: 0; color: var(--mc-text); }
.mc-prompt-label { display: block; margin-bottom: 8px; font-size: 1.4rem; font-weight: 500; color: var(--mc-text); }

.sl-inline { display: flex; flex-direction: column; min-width: 0; }
.sl-inline .sl-list { max-height: 42vh; overflow-y: auto; min-width: 0; }
/* .sl-search-wrap / .sl-list / .sl-clear-wrap are flex children of .sl-inline;
   min-width:0 lets them shrink to the panel's width instead of overflowing
   to fit their content (e.g. the search input, or a long item label). */
.sl-search-wrap, .sl-clear-wrap { min-width: 0; }

.sl-row { align-items: center; }
.sl-check {
  width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
  border: 0.5px solid var(--color-border-secondary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
  align-self: center;
}
.dd-item.selected .sl-check { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.sl-row-value { flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; }

/* course row markup (built by caller, passed as label) */
.course-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.course-thumb { width: 32px; height: 44px; object-fit: cover; border-radius: 4px; flex-shrink: 0; border: 0.5px solid var(--color-border-tertiary); }
.course-info { display: flex; flex-direction: column; overflow: hidden; }
.course-name { font-size: 13px; font-weight: 500; color: var(--color-text-primary); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.course-author { font-size: 12px; color: var(--color-text-tertiary); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

.sl-trigger { min-width: 160px; max-width: 260px; justify-content: space-between; overflow: hidden; }
.sl-trigger-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-trigger-label.placeholder { color: var(--color-text-primary); }

.sl-search-wrap { padding: 10px; }
.sl-search { width: 100%; padding: 6px 12px; font-family: var(--font-sans); border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-md); background: var(--color-background-secondary); color: var(--color-text-primary); outline: none; }
.sl-search:focus { border-color: var(--color-accent); }
.sl-no-results { padding: 10px 14px; font-size: 13px; color: var(--color-text-tertiary); text-align: center; }
.sl-loading { padding: 10px 14px; font-size: 13px; color: var(--color-text-tertiary); text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }

.dd-item .sl-check { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; border: 0.5px solid var(--color-border-secondary); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.dd-item.selected .sl-check { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.sl-clear-wrap { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; margin-top: 4px; }
.sl-clear-count { font-size: 14px; color: var(--color-text-secondary); }
.sl-clear { font-size: 14px; color: var(--color-accent); cursor: pointer; font-weight: 500; }
.sl-clear:hover { color: var(--color-text-danger); }

@media (prefers-reduced-motion: reduce) {
  .mc-backdrop, .mc-dialog, .mc-dialog.mc-pulse { transition: none; animation: none; }
}

.mc-tooltip {
  position: fixed; z-index: 1150; --mc-tooltip-gap: 8px;
  max-width: 230px; padding: 6px 10px;
  background: #1f2937; color: #fff; font-size: 1.3rem; line-height: 1.4;
  border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  opacity: 0; transform: scale(0.95); transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}
.mc-tooltip.mc-show { opacity: 1; transform: scale(1); }
.mc-tooltip-inner { position: relative; z-index: 1; }
.mc-tooltip-arrow { position: absolute; width: 8px; height: 8px; background: #1f2937; transform: rotate(45deg); }
.mc-tooltip-top    .mc-tooltip-arrow { bottom: -4px; left: 50%; margin-left: -4px; }
.mc-tooltip-bottom .mc-tooltip-arrow { top: -4px; left: 50%; margin-left: -4px; }
.mc-tooltip-left   .mc-tooltip-arrow { right: -4px; top: 50%; margin-top: -4px; }
.mc-tooltip-right  .mc-tooltip-arrow { left: -4px; top: 50%; margin-top: -4px; }
@media (prefers-reduced-motion: reduce) {
  .mc-tooltip { transition: none; }
}

.mc-progress { position: relative; width: 100%; height: 16px; background: var(--color-background-secondary); border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.16); }
.mc-progress-bar { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background-color: var(--mc-blue); border-radius: 99px; transition: width 300ms ease; }
.mc-progress-bar.mc-progress-success { background-color: #2e7d32; }
.mc-progress-bar.mc-progress-danger  { background-color: #c0392b; }
.mc-progress-bar.mc-progress-warning { background-color: #b7791f; }
.mc-progress-bar.mc-progress-striped {
  background-image: repeating-linear-gradient(45deg,
    rgba(255,255,255,0.15) 0, rgba(255,255,255,0.15) 8px,
    transparent 8px, transparent 16px);
}
.mc-progress-bar.mc-progress-striped.mc-progress-animated { animation: mc-progress-stripes 1s linear infinite; }
@keyframes mc-progress-stripes { from { background-position: 0 0; } to { background-position: 22.63px 0; } } /* 16px pattern period / cos(45deg) — one full, seamless loop */
.mc-progress.mc-progress-indeterminate .mc-progress-bar { width: 40%; transition: none; animation: mc-progress-indeterminate 1.2s ease-in-out infinite; }
@keyframes mc-progress-indeterminate {
  0%   { left: -40%; }
  100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .mc-progress-bar { transition: none; }
  .mc-progress.mc-progress-indeterminate .mc-progress-bar { animation: none; left: 0; }
  .mc-progress-bar.mc-progress-striped.mc-progress-animated { animation: none; }
}

.dd-popup-body:has(.cal-container) { padding: 0; }

.cal-container { width: 280px; padding: 12px; font-size: 1.4rem; color: var(--color-text-primary); box-sizing: border-box; }
.cal-inline { width: 100%; max-width: 320px; }

.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 4px; }
.cal-title { font-weight: 600; font-size: 1.4rem; }
button.cal-title-btn { background: none; border: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; color: var(--color-text-primary); }
button.cal-title-btn:hover { background: var(--color-background-secondary); }
.cal-nav { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--color-text-secondary); font-size: 1.8rem; line-height: 1; padding: 0; flex-shrink: 0; }
.cal-nav:hover { background: var(--color-background-secondary); color: var(--color-text-primary); }

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 1.1rem; font-weight: 600; color: var(--color-text-tertiary); padding: 4px 0; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; color: var(--color-text-primary); outline: none; }
.cal-day:hover:not(.cal-disabled) { background: var(--color-background-secondary); }
.cal-day.cal-outside  { color: var(--color-text-tertiary); opacity: 0.7; }
.cal-day.cal-disabled { color: var(--color-text-tertiary); opacity: 0.35; cursor: not-allowed; }
.cal-day.cal-today    { box-shadow: inset 0 0 0 1px var(--color-accent); font-weight: 600; }
.cal-day.cal-selected { background: var(--color-accent); color: #fff; font-weight: 600; }
.cal-day.cal-in-range    { background: var(--color-accent-bg); border-radius: 0; }
.cal-day.cal-range-start { border-radius: 6px 0 0 6px; }
.cal-day.cal-range-end   { border-radius: 0 6px 6px 0; }
.cal-day.cal-range-start.cal-range-end { border-radius: 6px; } /* single-day range: don't leave one side square */
.cal-day.cal-focus:focus-visible { box-shadow: 0 0 0 2px var(--color-accent); }

.cal-grid-months, .cal-grid-years { grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0; }
.cal-cell { border: none; background: transparent; padding: 12px 4px; border-radius: 6px; cursor: pointer; font-size: 1.3rem; color: var(--color-text-primary); }
.cal-cell:hover:not(:disabled) { background: var(--color-background-secondary); }
.cal-cell:disabled { color: var(--color-text-tertiary); opacity: 0.35; cursor: not-allowed; }
.cal-cell.cal-cell-today   { box-shadow: inset 0 0 0 1px var(--color-accent); font-weight: 600; }
.cal-cell.cal-cell-current { background: var(--color-accent); color: #fff; font-weight: 600; }

.cal-footer { display: flex; justify-content: flex-end; margin-top: 6px; }
.cal-clear-btn { background: none; border: none; color: var(--color-accent); font-size: 1.3rem; font-weight: 500; cursor: pointer; padding: 4px 6px; }
.cal-clear-btn:hover { text-decoration: underline; }

.mc-btn.mc-lg, .mc-btn.mc-large { padding: 10px 16px; font-size: 1.8rem; }
.mc-btn.mc-warning { color: #fff; background-color: #f0ad4e; border: 1px solid rgba(0,0,0,0.15); box-shadow: 0 4px 4px -2px rgba(0,0,0,0.2); text-shadow: 1px 1px 1px rgba(0,0,0,0.25); }
/* .mc-btn.mc-warning:hover { filter: brightness(0.95); } */
.mc-btn.mc-info { color: #fff; background-color: #5bc0de; border: 1px solid rgba(0,0,0,0.15); box-shadow: 0 4px 4px -2px rgba(0,0,0,0.2); text-shadow: 1px 1px 1px rgba(0,0,0,0.25); }
/* .mc-btn.mc-info:hover { filter: brightness(0.95); } */

.mc-container { margin: 0 auto; padding: 0 15px; }

@media (max-width: 767px) {
   body { font-size: 1.5rem; padding-top: 50px; }
   .mc-container { padding: 0 15px; }
}

@media (min-width: 768px) {
  .mc-container { max-width: 750px; }
}

@media (min-width: 992px) {
  .mc-container { max-width: 970px; }
}

@media (min-width: 1200px) {
  .mc-container { max-width: 1170px; }
}

@media (min-width: 1400px) {
  .mc-container { max-width: 1370px; }
}

.memory-booster { margin-bottom: 30px; }
.memory-booster .chess-logo img, .computer-practice .chess-logo img { margin-left: 0 !important; }
.memory-booster .main { display: flex; border: 1px solid lightgray; border-radius: 4px; background-color: #fbf9f5; }
.memory-booster .left-column { flex: 6.5; min-width: 0; padding: 20px; }
.memory-booster .right-column { display: flex; flex: 5.5; min-width: 0; }
.memory-booster .progress-column { flex: 1; min-width: 0; padding: 20px; }
.memory-booster .chapters-column { flex: 1; min-width: 0; padding: 20px; overflow-y: auto; min-height: 0; contain: size layout; }
.memory-booster .mc-progress { margin-bottom: 20px; }

@media (max-width: 767px) {
  .memory-booster .main { flex-direction: column; }
  .memory-booster .right-column { border-left: none; border-top: 1px solid lightgray; }
  .memory-booster .chess-logo img { margin-left: auto !important; }
}

.strategy-booster { margin-bottom: 30px; }
.strategy-booster .chess-logo img { margin-left: 0 !important; }
.strategy-booster .main { display: flex; border: 1px solid lightgray; border-radius: 4px; background-color: #fbf9f5; }
.strategy-booster .left-column { flex: 6.5; min-width: 0; padding: 20px; }
.strategy-booster .right-column { display: flex; flex: 5.5; min-width: 0; }
.strategy-booster .progress-column { flex: 1; min-width: 0; padding: 20px; overflow-y: auto; }
.strategy-booster .chapters-column { flex: 1; min-width: 0; padding: 20px; overflow-y: auto; min-height: 0; contain: size layout; }
.strategy-booster .mc-progress { margin-bottom: 20px; }
.strategy-booster .problem-status { font-size: 1.6rem; font-weight: 600; color: var(--color-text-primary); margin: 0 0 10px; }

@media (max-width: 767px) {
  .strategy-booster .main { flex-direction: column; }
  .strategy-booster .right-column { border-left: none; border-top: 1px solid lightgray; }
  .strategy-booster .chess-logo img { margin-left: auto !important; margin-right: auto !important; }
}

.chess-viewer { margin-bottom: 30px; }
.chess-viewer .main { display: flex; border: 1px solid #dcd4c7; border-radius: 3px; transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out; }
.chess-viewer .left-column { flex: 6.5; min-width: 0; padding: 15px; background-color: #f4efe7; border-right: 1px solid #dcd4c7; }
.chess-viewer .right-column { flex: 5.5; display: flex; flex-direction: column; min-width: 0; background-color: #fbf9f5; }
.chess-viewer .chess-moves { flex: 1; overflow-y: scroll; min-height: 0; contain: size layout; }
.chess-viewer .chess-board, .chess-tester .chess-board { margin-bottom: 15px; }

.chess-viewer[tabindex="0"]:focus { outline: none; }
.chess-viewer[tabindex="0"]:focus .main { box-shadow: 0 0 0 3px #bfdeff; border-color: #4ba0ff; }
 
@media (max-width: 767px) {
  .chess-viewer .main { flex-direction: column; }
  .chess-viewer .left-column { border-right: none; border-bottom: 1px solid #dcd4c7; }
  .chess-viewer .right-column { min-height: 320px; }
}
 
.component.chess-viewer .chess-analysis .stockfish-short { display: none; }

.chess-tester { margin-bottom: 30px; }
.chess-tester .main { display: flex; border: 1px solid #dcd4c7; border-radius: 3px; transition: box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out; }
.chess-tester .left-column { flex: 6.5; min-width: 0; padding: 15px; background-color: #f4efe7; border-right: 1px solid #dcd4c7; }
.chess-tester .right-column { flex: 5.5; display: flex; flex-direction: column; min-width: 0; background-color: #fbf9f5; }
.chess-tester .chess-moves { flex: 1; overflow-y: auto; min-height: 0; contain: size layout; }
 
.chess-tester .chess-progress { padding: 7px 5px 7px 15px; }
.chess-tester .chess-progress i { font-size: 25px; padding: 5px; }
.chess-tester .chess-progress .far.fa-check-circle { color: green; }
.chess-tester .chess-progress .far.fa-times-circle { color: #cc0000; }
.chess-tester .chess-controls { display: flex; align-items: stretch; border-bottom: 1px solid #dcd4c7; }
.chess-tester .chess-progress { flex: 1; }
.chess-tester .chess-controls .control-btn { margin-left: auto; border: none; border-left: 1px solid #dcd4c7; align-self: stretch; padding: 0 25px !important; display: flex; align-items: center; }

.chess-tester[tabindex="0"]:focus { outline: none; }
.chess-tester[tabindex="0"]:focus .main { box-shadow: 0 0 0 3px #bfdeff; border-color: #4ba0ff; }

@media (max-width: 767px) {
  .chess-tester .main { flex-direction: column; }
  .chess-tester .left-column { border-right: none; border-bottom: 1px solid #dcd4c7; }
  .chess-tester .right-column { min-height: 320px; }
  .chess-tester .chess-progress .progress-label { display: none; }
}
 
.mc-alert { position: relative; padding: 10px 14px; border-radius: 6px; margin-bottom: 30px; }
.mc-alert:has(.mc-alert-close) { padding-right: 40px; }
.mc-alert.mc-info    { background: #eaf2fb; color: #0a66c2; border: 1px solid #cfe3f7; }
.mc-alert.mc-success { background: #e6f4ea; color: #1e7e34; border: 1px solid #b7dfc0; }
.mc-alert.mc-danger  { background: #fbeaea; color: #a12622; border: 1px solid #f0c4c2; }
.mc-alert.mc-warning { background: #fcf3e3; color: #8a6116; border: 1px solid #f7e2b8; }
.mc-alert-close { position: absolute; top: 8px; right: 12px; padding: 0; border: none; background: none; color: inherit; font-size: 2rem; line-height: 1; opacity: 0.5; cursor: pointer; }
.mc-alert-close:hover { opacity: 0.8; }
.mc-alert-link { font-weight: 700; color: inherit; }
.mc-alert-link:hover { text-decoration: underline; }

.video-synchronizer { padding: 20px; margin-bottom: 30px; }
.video-synchronizer .main { display: flex; border: 1px solid #dcd4c7; border-radius: 4px; background-color: #fbf9f5; }
.video-synchronizer .left-column { flex: 6.5; min-width: 0; padding: 20px; }
.video-synchronizer .right-column { flex: 5.5; min-width: 0; padding: 20px; display: flex; align-items: center; }
.video-synchronizer .mc-video-wrap { width: 100%; margin-bottom: 0; }
 
@media (max-width: 767px) {
  .video-synchronizer .main { flex-direction: column; }
}

.computer-practice { margin-bottom: 30px; }
.computer-practice .main { display: flex; border: 1px solid #dcd4c7; border-radius: 4px; background-color: #fbf9f5; }
.computer-practice .left-column { flex: 6; min-width: 0; padding: 20px; }
.computer-practice .right-column { display: flex; flex: 6; min-width: 0; }
.computer-practice .progress-column { flex: 1; min-width: 0; padding: 20px; }
.computer-practice .chapters-column { flex: 1; min-width: 0; padding: 20px; overflow-y: auto; min-height: 0; contain: size layout; }
.component.computer-practice p { margin-bottom:20px; }

@media (max-width: 767px) {
  .computer-practice .main { flex-direction: column; }
  .computer-practice .right-column { border-left: none; border-top: 1px solid #dcd4c7; }
}

.mc-video-responsive video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

@media (min-width: 768px) and (max-width: 991px) {
  .component.chess-viewer .chess-analysis .info { line-height: 18px; font-size: 1.3rem; }
  .component.chess-viewer .chess-analysis .stockfish { display: none; }
  .component.chess-viewer .chess-analysis .stockfish-short { display: inline-block; }
}

.mc-badge { display: inline-block; font-size: 1.2rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.mc-badge-free { background: #e6f4ea; color: #1e7e34; }
.mc-badge-locked { background: var(--color-background-secondary); color: var(--color-text-tertiary); }
.mc-list-item.mc-list-item-disabled { cursor: not-allowed; color: var(--color-text-tertiary); opacity: 0.8; }

.mc-list { display: flex; flex-direction: column; gap: 2px; }
.mc-list-item { display: block; padding: 9px 12px; border-radius: 6px; color: var(--color-text-primary); text-decoration: none !important; }
.mc-list-item:hover { background: var(--color-background-secondary); }
.mc-list-item.active { background: var(--color-accent-bg); color: var(--color-accent); font-weight: 600; }
.mc-img-responsive, img.mc-responsive { max-width: 100%; height: auto; display: block; }
.center-block { display: block; margin-left: auto; margin-right: auto; }

.position-setup { margin-bottom: 5px; }
.position-setup .main { display: flex; gap: 20px; margin-bottom: 10px; }
.position-setup .left-column { flex: 7; min-width: 0; }
.position-setup .right-column { flex: 5; min-width: 0; }
.mc-field { display: flex; flex-direction: column; height: 100%; }
.mc-field .mc-input { flex: 0 0 70%; resize: vertical; margin-bottom: 15px; }
.mc-field.has-error .mc-input { border-color: var(--color-text-danger); box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.15); }
.mc-field.has-success .mc-input { border-color: #2e7d32; }
.position-setup .mc-help-text { margin-top: -5px; margin-bottom: 10px; font-size: 1.4rem; color: var(--color-text-danger); }
.position-setup .mc-input { font-size: 15px; }
.position-setup .controls { display: flex; align-items: flex-start; gap: 15px; }
.position-setup .board-controls { flex: 7; }
.position-setup .search-btn-wrap { flex: 5; }
.position-setup .board-controls .mc-btn-group { width: 100%; }
.position-setup .board-controls .mc-btn { color: #777; }
.position-setup .search-btn-wrap .mc-btn { width: 100%; }
 
@media (min-width: 768px) {
   .position-setup .board-controls .mc-btn-group { width: 50%; }
}
 
@media (max-width: 767px) {
   .position-setup .mc-input { font-size: 13px; }
   .position-setup .controls { flex-direction: column; }
   .position-setup .board-controls { width: 50%; margin-bottom: 10px; }
   .position-setup .search-btn-wrap { width: 100%; }
}
 
@media (max-width: 480px) {
   .position-setup .right-column { display: none; }
   .mc-dialog .mc-title { font-size: 2.7rem; }
   .mc-btn-group.mc-btn-group-justified > .mc-btn, .mc-btn-group.mc-btn-group-justified > .dd-wrapper > .mc-btn { padding-left: 8px; padding-right: 8px; font-size: 14px; }
}

.mc-btn.mc-large { padding: 7px 15px 8px 15px; font-size: 1.7rem; }
.mc-btn.mc-small { padding: 5px 15px 6px 15px; font-size: 1.5rem; }

.password-reveal { position: relative; }
.password-reveal .mc-input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.password-reveal .mc-input::-ms-reveal, .password-reveal .mc-input::-ms-clear { display: none; }
.password-reveal-btn { position: absolute; top: 0; right: 0; bottom: 0; width: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .6; transition: opacity .15s; }
.password-reveal-btn:hover, .password-reveal-btn:focus-visible { opacity: 1; }
.password-reveal-btn:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; border-radius: 4px; }
.password-reveal-btn .fas { width: 20px; text-align: center; }
