/* CS4U LMS – front-end and admin styles. Colours follow the theme / Site Kit settings via CSS variables. */
:root {
	--cs4u-primary: var(--brand, #2563eb);
	--cs4u-primary-dark: var(--brand-dark, #1d4ed8);
	--cs4u-accent: var(--accent, #06b6d4);
	--cs4u-ink: var(--ink, #0d1117);
	--cs4u-muted: var(--ink-soft, #4b5563);
	--cs4u-line: var(--line, #e5e7eb);
	--cs4u-soft: var(--bg-alt, #f7f9fc);
	--cs4u-ok: #0f9d6e;
	--cs4u-bad: #d6336c;
	--cs4u-radius: var(--radius, 16px);
}

.cs4u, .cs4u * { box-sizing: border-box; }
.cs4u { color: var(--cs4u-ink); line-height: 1.6; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
.cs4u h2, .cs4u h3 { line-height: 1.25; margin: 0 0 .6em; }
.cs4u a { color: var(--cs4u-primary); }
.cs4u-center { text-align: center; }
.cs4u-small { font-size: .875rem; color: var(--cs4u-muted); }
.cs4u-empty { color: var(--cs4u-muted); font-style: italic; }
.cs4u-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.cs4u-inline { display: inline-block; margin: 0; }

/* Buttons */
.cs4u-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid var(--cs4u-primary); background: var(--cs4u-primary); color: #fff !important; font: inherit; font-weight: 600; text-decoration: none !important; cursor: pointer; transition: background .15s, transform .15s, color .15s; line-height: 1.2; }
.cs4u-btn:hover { background: var(--cs4u-primary-dark); border-color: var(--cs4u-primary-dark); transform: translateY(-1px); }
.cs4u-btn--ghost { background: transparent; color: var(--cs4u-primary) !important; }
.cs4u-btn--ghost:hover { background: var(--cs4u-soft); color: var(--cs4u-primary-dark) !important; }
.cs4u-btn--small { padding: .4rem .9rem; font-size: .875rem; }
.cs4u-btn--block { display: flex; width: 100%; margin-top: .6rem; }
.cs4u-btn--danger { background: #fff; color: var(--cs4u-bad) !important; border-color: var(--cs4u-bad); }
.cs4u-btn--danger:hover { background: var(--cs4u-bad); color: #fff !important; border-color: var(--cs4u-bad); }
.cs4u-btn:focus-visible, .cs4u a:focus-visible, .cs4u input:focus-visible, .cs4u select:focus-visible, .cs4u textarea:focus-visible { outline: 3px solid var(--cs4u-accent); outline-offset: 2px; }
.cs4u-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }

/* Notices, chips, boxes */
.cs4u-notice { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; border: 1px solid; background: #eef2ff; border-color: #c7d2fe; color: #312e81; }
.cs4u-notice--success { background: #e7f8f1; border-color: #a7e6cd; color: #065f46; }
.cs4u-notice--error { background: #fdecf2; border-color: #f7b6cc; color: #9d174d; }
.cs4u-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.cs4u-chip { display: inline-block; padding: .2rem .7rem; border-radius: 999px; background: var(--cs4u-soft); color: var(--cs4u-ink); font-size: .8125rem; font-weight: 600; }
.cs4u-chip--level { background: #eef2ff; color: var(--cs4u-primary-dark); }
.cs4u-chip--admin { background: #fee2e2; color: #991b1b; }
.cs4u-chip--instructor { background: #fef3c7; color: #92400e; }
.cs4u-chip--student { background: #dbeafe; color: #1e40af; }
.cs4u-chip--publish, .cs4u-chip--completed { background: #dcfce7; color: #166534; }
.cs4u-chip--pending { background: #fef3c7; color: #92400e; }
.cs4u-chip--draft { background: #e5e7eb; color: #374151; }
.cs4u-box { background: #fff; border: 1px solid var(--cs4u-line); border-radius: var(--cs4u-radius); padding: 1.4rem; margin: 0 0 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.cs4u-stars { color: var(--cs4u-accent); letter-spacing: 1px; }
.cs4u-bar { height: 8px; background: var(--cs4u-line); border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.cs4u-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--cs4u-primary), var(--cs4u-accent)); border-radius: 99px; }
.cs4u-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cs4u-checks li::before { content: "✓"; color: var(--cs4u-ok); font-weight: 800; margin-inline-end: .5rem; }

/* Cards */
.cs4u-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); margin: 1rem 0; }
.cs4u-cols-1 { grid-template-columns: 1fr; } .cs4u-cols-2 { grid-template-columns: repeat(2, 1fr); } .cs4u-cols-4 { grid-template-columns: repeat(4, 1fr); }
.cs4u-card { background: #fff; border: 1px solid var(--cs4u-line); border-radius: var(--cs4u-radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .2s, transform .2s; }
.cs4u-card:hover { box-shadow: 0 12px 30px rgba(15,23,42,.1); transform: translateY(-2px); }
.cs4u-card__thumb { display: block; aspect-ratio: 16/9; background: var(--cs4u-soft); overflow: hidden; }
.cs4u-card__thumb img, .cs4u-course__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs4u-thumb-fallback { width: 100%; height: 100%; min-height: 140px; display: grid; place-items: center; font-size: 3rem; background: linear-gradient(135deg, var(--cs4u-primary), var(--cs4u-accent)); }
.cs4u-card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.cs4u-card__title { margin: 0; font-size: 1.1rem; } .cs4u-card__title a { color: var(--cs4u-ink); text-decoration: none; } .cs4u-card__title a:hover { color: var(--cs4u-primary); }
.cs4u-card__text { margin: 0; color: var(--cs4u-muted); font-size: .9rem; }
.cs4u-card__meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 0; font-size: .8125rem; color: var(--cs4u-muted); }
.cs4u-card__foot { display: flex; justify-content: space-between; align-items: center; margin: auto 0 0; padding-top: .6rem; border-top: 1px solid var(--cs4u-line); }
.cs4u-price { font-size: 1.15rem; color: var(--cs4u-primary-dark); } .cs4u-price.is-free { color: var(--cs4u-ok); }
.cs4u-card--row { flex-direction: row; } .cs4u-card--row .cs4u-card__thumb { width: 190px; aspect-ratio: auto; flex: none; }
.cs4u-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1rem; }
.cs4u-filters input, .cs4u-filters select { padding: .6rem .8rem; border: 1px solid var(--cs4u-line); border-radius: 10px; font: inherit; background: #fff; }
.cs4u-filters input[type=search] { flex: 1 1 220px; }
.cs4u-pager { display: flex; gap: .4rem; justify-content: center; margin: 1.5rem 0; }
.cs4u-pager a { padding: .4rem .8rem; border: 1px solid var(--cs4u-line); border-radius: 8px; text-decoration: none; } .cs4u-pager a.is-current { background: var(--cs4u-primary); color: #fff; border-color: var(--cs4u-primary); }

/* Course page */
.cs4u-course__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.cs4u-sticky { position: sticky; top: 100px; }
.cs4u-course__thumb { border-radius: 10px; overflow: hidden; margin-bottom: 1rem; aspect-ratio: 16/9; }
.cs4u-course__price { font-size: 2rem; font-weight: 800; margin: 0 0 .4rem; color: var(--cs4u-primary-dark); }
.cs4u-curriculum { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.cs4u-curriculum li { display: flex; align-items: center; gap: .7rem; padding: .7rem .5rem; border-bottom: 1px solid var(--cs4u-line); }
.cs4u-curriculum li:last-child { border-bottom: 0; } .cs4u-curriculum small { margin-inline-start: auto; color: var(--cs4u-muted); }
.cs4u-curriculum li.is-done a { color: var(--cs4u-muted); } .cs4u-curriculum li.is-current { background: #eef2ff; border-radius: 8px; font-weight: 700; }
.cs4u-curriculum--manage li { flex-wrap: wrap; }
.cs4u-reviews { list-style: none; padding: 0; margin: 0 0 1rem; } .cs4u-reviews li { padding: .8rem 0; border-bottom: 1px solid var(--cs4u-line); } .cs4u-reviews p { margin: .3rem 0 0; }

/* Player */
.cs4u-player { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.cs4u-player__nav { background: #fff; border: 1px solid var(--cs4u-line); border-radius: var(--cs4u-radius); padding: 1rem; position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; }
.cs4u-player__course { font-size: 1rem; } .cs4u-player__main { background: #fff; border: 1px solid var(--cs4u-line); border-radius: var(--cs4u-radius); padding: 1.6rem; min-width: 0; }
.cs4u-video { margin: 0 0 1.2rem; aspect-ratio: 16/9; } .cs4u-video iframe, .cs4u-video video { width: 100%; height: 100%; border-radius: 10px; border: 0; }
.cs4u-prose img { max-width: 100%; height: auto; } .cs4u-prose { overflow-wrap: anywhere; }
.cs4u-prevnext { display: flex; justify-content: space-between; margin-top: 2rem; gap: 1rem; }
.cs4u-done-badge { color: var(--cs4u-ok); font-weight: 700; }
.cs4u-q { border: 1px solid var(--cs4u-line); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1rem; } .cs4u-q legend { font-weight: 700; padding: 0 .4rem; }
.cs4u-opt { display: block; padding: .55rem .8rem; border-radius: 8px; cursor: pointer; border: 1px solid transparent; } .cs4u-opt:hover { background: var(--cs4u-soft); }
.cs4u-opt.is-correct { background: #e7f8f1; border-color: #a7e6cd; } .cs4u-opt.is-wrong { background: #fdecf2; border-color: #f7b6cc; }

/* Forms */
.cs4u-form .cs4u-field { margin: 0 0 1rem; display: block; }
.cs4u-field label, .cs4u-field legend { display: block; font-weight: 600; margin-bottom: .3rem; }
.cs4u-field input[type=text], .cs4u-field input[type=email], .cs4u-field input[type=password], .cs4u-field input[type=number], .cs4u-field input[type=url], .cs4u-field select, .cs4u-field textarea { width: 100%; padding: .7rem .85rem; border: 1px solid #cbd2e1; border-radius: 10px; font: inherit; background: #fff; }
.cs4u-field small { color: var(--cs4u-muted); display: block; margin-top: .25rem; }
.cs4u-check { display: inline-flex; gap: .5rem; align-items: center; }
.cs4u-choice label { display: flex; gap: .6rem; align-items: center; font-weight: 500; padding: .6rem .8rem; border: 1px solid var(--cs4u-line); border-radius: 10px; margin-bottom: .5rem; cursor: pointer; }
.cs4u-grid { display: grid; gap: 0 1rem; } .cs4u-grid--2 { grid-template-columns: repeat(2, 1fr); } .cs4u-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cs4u-auth { max-width: 460px; margin: 2rem auto; background: #fff; border: 1px solid var(--cs4u-line); border-radius: 18px; padding: 1.5rem; box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.cs4u-tabs { display: flex; gap: .4rem; background: var(--cs4u-soft); padding: .3rem; border-radius: 12px; margin-bottom: 1.2rem; }
.cs4u-tabs a { flex: 1; text-align: center; padding: .6rem; border-radius: 9px; text-decoration: none; color: var(--cs4u-muted); font-weight: 600; } .cs4u-tabs a.is-active { background: #fff; color: var(--cs4u-primary-dark); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.cs4u-thumb-preview img { width: 120px; height: auto; border-radius: 8px; display: block; margin-bottom: .5rem; }

/* Quiz builder */
.cs4u-qitem { border: 1px solid var(--cs4u-line); border-radius: 12px; padding: 1rem; margin: 0 0 1rem; background: #fafbff; }
.cs4u-qhead { display: flex; gap: .6rem; margin-bottom: .5rem; } .cs4u-qhead input { flex: 1; padding: .6rem .8rem; border: 1px solid #cbd2e1; border-radius: 8px; }
.cs4u-qopt { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; } .cs4u-qopt input[type=text] { flex: 1; padding: .5rem .7rem; border: 1px solid #cbd2e1; border-radius: 8px; }
.cs4u-x { border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; color: var(--cs4u-bad); }

/* Dashboard */
.cs4u-dash { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-block: 1.5rem; }
.cs4u-dash__nav { background: #fff; border: 1px solid var(--cs4u-line); border-radius: var(--cs4u-radius); padding: 1rem; position: sticky; top: 100px; }
.cs4u-dash__user { text-align: center; padding-bottom: 1rem; border-bottom: 1px solid var(--cs4u-line); margin-bottom: .7rem; display: grid; gap: .3rem; justify-items: center; } .cs4u-dash__user img { border-radius: 50%; }
.cs4u-dash__nav nav { display: grid; gap: .2rem; } .cs4u-dash__nav nav a { display: block; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; color: var(--cs4u-ink); font-weight: 500; }
.cs4u-dash__nav nav a:hover { background: var(--cs4u-soft); } .cs4u-dash__nav nav a.is-active { background: var(--cs4u-primary); color: #fff; } .cs4u-dash__nav nav a.is-danger { color: var(--cs4u-bad); }
.cs4u-h { margin: 0 0 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; font-size: 1.6rem; }
.cs4u-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.cs4u-stat { background: #fff; border: 1px solid var(--cs4u-line); border-radius: var(--cs4u-radius); padding: 1rem 1.2rem; display: grid; gap: .1rem; } .cs4u-stat strong { font-size: 1.8rem; line-height: 1.1; color: var(--cs4u-primary-dark); } .cs4u-stat span { color: var(--cs4u-muted); font-size: .875rem; } .cs4u-stat__icon { font-size: 1.4rem; }
.cs4u-todo { list-style: none; padding: 0; margin: 0; } .cs4u-todo li { padding: .5rem 0; border-bottom: 1px solid var(--cs4u-line); } .cs4u-todo li:last-child { border: 0; }
.cs4u-guide { padding-inline-start: 1.2rem; display: grid; gap: .8rem; } .cs4u-guide li { padding: .8rem 1rem; background: #fff; border: 1px solid var(--cs4u-line); border-radius: 12px; } .cs4u-guide strong { display: block; } .cs4u-guide span { color: var(--cs4u-muted); }
.cs4u-tablewrap { overflow-x: auto; margin: 0 0 1.25rem; } .cs4u-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--cs4u-line); border-radius: 12px; overflow: hidden; }
.cs4u-table th { text-align: left; background: var(--cs4u-soft); font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--cs4u-muted); } .cs4u-table th, .cs4u-table td { padding: .75rem .9rem; border-bottom: 1px solid var(--cs4u-line); vertical-align: middle; }
.cs4u-actions-cell { white-space: nowrap; } .cs4u-danger-zone { margin-top: 1rem; }

/* Admin screens */
.cs4u-admin .cs4u-stats { max-width: 1100px; } .cs4u-admin .cs4u-box { max-width: 1100px; } .cs4u-admin .cs4u-table { max-width: 1100px; }
.cs4u-field--admin label { font-weight: 600; display: block; margin-bottom: 4px; } .cs4u-field--admin input, .cs4u-field--admin select, .cs4u-field--admin textarea { width: 100%; max-width: 520px; }

/* Header account menu */
.cs4u-acct { display: inline-flex; gap: .5rem; align-items: center; position: relative; }
.cs4u-acct--menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .7rem .25rem .25rem; border: 1px solid var(--cs4u-line); border-radius: 999px; background: #fff; }
.cs4u-acct--menu summary::-webkit-details-marker { display: none; } .cs4u-acct--menu img { border-radius: 50%; display: block; }
.cs4u-acct__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: #fff; border: 1px solid var(--cs4u-line); border-radius: 12px; padding: .6rem; box-shadow: 0 14px 34px rgba(15,23,42,.15); z-index: 80; display: grid; }
.cs4u-acct__panel a { padding: .5rem .6rem; border-radius: 8px; text-decoration: none; color: var(--cs4u-ink); } .cs4u-acct__panel a:hover { background: var(--cs4u-soft); } .cs4u-acct__panel a.is-danger { color: var(--cs4u-bad); } .cs4u-acct__panel p { margin: 0 0 .3rem; }

/* Responsive */
@media (max-width: 960px) {
	.cs4u-cards, .cs4u-cols-4 { grid-template-columns: repeat(2, 1fr); }
	.cs4u-course__grid, .cs4u-player, .cs4u-dash { grid-template-columns: 1fr; }
	.cs4u-sticky, .cs4u-player__nav, .cs4u-dash__nav { position: static; max-height: none; }
	.cs4u-course__side { order: -1; }
	.cs4u-dash__nav nav { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
	.cs4u-cards, .cs4u-cols-2, .cs4u-cols-4, .cs4u-grid--2, .cs4u-grid--3 { grid-template-columns: 1fr; }
	.cs4u-card--row { flex-direction: column; } .cs4u-card--row .cs4u-card__thumb { width: 100%; aspect-ratio: 16/9; }
	.cs4u-table thead { display: none; } .cs4u-table tr { display: block; padding: .5rem 0; border-bottom: 2px solid var(--cs4u-line); }
	.cs4u-table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem .9rem; } .cs4u-table td[data-label]::before { content: attr(data-label); color: var(--cs4u-muted); font-weight: 600; }
	.cs4u-acct--menu summary span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cs4u-btn, .cs4u-card { transition: none !important; } }

/* Password field: eye button + checklist */
.cs4u-pw { position: relative; }
.cs4u-pw input { width: 100%; padding-right: 3rem; }
.cs4u-pw__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; cursor: pointer; color: var(--cs4u-muted); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; padding: 0; }
.cs4u-pw__toggle:hover { color: var(--cs4u-primary); background: var(--cs4u-soft); }
.cs4u-pw__toggle .cs4u-eye-off { display: none; } .cs4u-pw__toggle[aria-pressed="true"] .cs4u-eye { display: none; } .cs4u-pw__toggle[aria-pressed="true"] .cs4u-eye-off { display: block; }
.cs4u-pwnote { background: var(--cs4u-soft); border: 1px solid var(--cs4u-line); border-radius: 10px; padding: .7rem .9rem; margin-top: .5rem; font-size: .875rem; }
.cs4u-pwnote p { margin: 0 0 .3rem; } .cs4u-pwnote ul { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .15rem; }
.cs4u-pwnote li { color: var(--cs4u-muted); } .cs4u-pwnote li::before { content: "○ "; } .cs4u-pwnote li.is-ok { color: var(--cs4u-ok); font-weight: 600; } .cs4u-pwnote li.is-ok::before { content: "✓ "; }
.cs4u-google { gap: .6rem; } .cs4u-or { margin: .8rem 0 0; position: relative; }

/* Profile photo */
.cs4u-avatar-edit { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.cs4u-avatar-edit .cs4u-avatar, .cs4u-avatar-edit img.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--cs4u-line); }

/* Learning materials: upload form + display */
.cs4u-attach { border: 1px dashed var(--cs4u-line); border-radius: var(--cs4u-radius); padding: 1rem 1.2rem; margin: 1.2rem 0; background: var(--cs4u-soft); }
.cs4u-attach legend { font-weight: 700; padding: 0 .5rem; }
.cs4u-attach h4 { margin: 1rem 0 .4rem; }
.cs4u-attach__slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.cs4u-attach__slot { background: #fff; border: 1px solid var(--cs4u-line); border-radius: 10px; padding: .6rem; }
.cs4u-attach__slot input[type=file], .cs4u-attach__group input[type=file] { max-width: 100%; }
.cs4u-attach__thumb { width: 100%; max-width: 160px; height: auto; border-radius: 8px; display: block; margin-bottom: .4rem; }
.cs4u-attach__current { margin: 0 0 .4rem; font-size: .9rem; word-break: break-all; }
.cs4u-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.cs4u-gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; border-radius: var(--cs4u-radius); border: 1px solid var(--cs4u-line); display: block; }
.cs4u-files { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cs4u-files li { padding: .5rem .7rem; background: var(--cs4u-soft); border-radius: 10px; word-break: break-word; }
@media (max-width: 640px) { .cs4u-attach__slots { grid-template-columns: 1fr; } }

/* ===== v1.2 — account menu, popups, chips, charts, responsive ===== */
.cs4u-acct--menu summary { padding: 3px 12px 3px 3px; transition: box-shadow .15s, border-color .15s; user-select: none; }
.cs4u-acct--menu summary:hover, .cs4u-acct--menu[open] summary { border-color: var(--cs4u-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.cs4u-acct--menu summary img { width: 32px; height: 32px; object-fit: cover; }
.cs4u-acct__name { font-weight: 600; font-size: .9rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cs4u-ink); }
.cs4u-acct__caret { color: var(--cs4u-muted); transition: transform .2s; flex: none; } .cs4u-acct--menu[open] .cs4u-acct__caret { transform: rotate(180deg); }
.cs4u-acct__panel { display: block; width: 290px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; border-radius: 16px; box-shadow: 0 20px 44px -12px rgba(15,23,42,.28); text-align: left; animation: cs4u-pop .14s ease-out; }
@keyframes cs4u-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cs4u-acct__head { display: flex; gap: .8rem; align-items: center; padding: 1rem 1.05rem; background: linear-gradient(135deg, #eff6ff, #ecfeff); border-bottom: 1px solid var(--cs4u-line); }
.cs4u-acct__head img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(15,23,42,.15); }
.cs4u-acct__who { display: grid; gap: 2px; min-width: 0; }
.cs4u-acct__who strong { font-size: .98rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs4u-acct__who small { color: var(--cs4u-muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs4u-acct__chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cs4u-acct__chips .cs4u-chip { font-size: .68rem; padding: .1rem .5rem; }
.cs4u-acct__links { display: grid; padding: .45rem; }
.cs4u-acct__panel a { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 10px; font-size: .92rem; font-weight: 500; line-height: 1.2; }
.cs4u-acct__panel a span { width: 1.4rem; text-align: center; font-size: 1.05rem; flex: none; }
.cs4u-acct__logout { margin: 0 .45rem .45rem; border-top: 1px solid var(--cs4u-line); border-radius: 0 0 10px 10px !important; padding-top: .8rem !important; color: var(--cs4u-bad) !important; }
.cs4u-acct__logout:hover { background: #fff1f5 !important; }
@media (max-width: 640px) {
	.cs4u-acct--menu .cs4u-acct__name, .cs4u-acct--menu summary > span.cs4u-acct__name { display: none; }
	.cs4u-acct--menu summary { padding: 3px 8px 3px 3px; gap: .3rem; }
	.cs4u-acct__panel { position: fixed; left: 12px; right: 12px; top: 68px; width: auto; max-width: none; }
}

/* chips */
.cs4u-chip--paid { background: #dcfce7; color: #166534; } .cs4u-chip--free { background: #f1f5f9; color: #475569; } .cs4u-chip--expired { background: #fef3c7; color: #92400e; }
.cs4u-chip--admin { background: #ede9fe; color: #5b21b6; } .cs4u-chip--instructor { background: #e0f2fe; color: #075985; } .cs4u-chip--student { background: #e8efff; color: #1d4ed8; }

/* popup (native <dialog>) */
.cs4u-modal { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px -20px rgba(15,23,42,.5); color: var(--cs4u-ink, #0d1117); background: #fff; overflow: hidden; }
.cs4u-modal::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(2px); }
.cs4u-modal[open] { display: flex; flex-direction: column; }
.cs4u-modal__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--cs4u-line); background: var(--cs4u-soft); }
.cs4u-modal__bar h2 { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.cs4u-modal__close { border: 0; background: #fff; border: 1px solid var(--cs4u-line); width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; line-height: 1; flex: none; }
.cs4u-modal__body { padding: 1.2rem; overflow: auto; }
.cs4u-modal__body > .cs4u-modal__title { display: none; }
.cs4u-modal__body table { width: 100%; border-collapse: collapse; }
.cs4u-modal__form h3 { margin: 1rem 0 .6rem; }
.cs4u-modal__form input[type=text], .cs4u-modal__form input[type=date], .cs4u-modal__form input[type=time], .cs4u-modal__form input[type=number], .cs4u-modal__form input[type=datetime-local], .cs4u-modal__form select, .cs4u-modal__form textarea { width: 100%; max-width: 100%; }
.cs4u-modal__form label { display: block; font-weight: 600; font-size: .9rem; }
.cs4u-modal__form .cs4u-field { margin: 0 0 .8rem; }

/* profile card + subscription box */
.cs4u-pcard__head { display: flex; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.cs4u-pcard__head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--cs4u-line); }
.cs4u-pcard__table th { text-align: left; width: 34%; color: var(--cs4u-muted); font-weight: 600; padding: .35rem .6rem .35rem 0; vertical-align: top; } .cs4u-pcard__table td { padding: .35rem 0; word-break: break-word; }
.cs4u-pcard__list { margin: .3rem 0 .8rem 1.1rem; padding: 0; }
.cs4u-subbox { border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; } .cs4u-subbox p { margin: .3rem 0 0; }
.cs4u-subbox--paid { background: #f0fdf4; border: 1px solid #bbf7d0; } .cs4u-subbox--free { background: #f8fafc; border: 1px solid var(--cs4u-line); }
.cs4u-locknote { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1rem; }

/* admin lists + toolbars (wp-admin and front end) */
.cs4u-admin .cs4u-table { max-width: none; } .cs4u-admin .cs4u-stats, .cs4u-admin .cs4u-box { max-width: 1200px; }
.cs4u-tabsbar { margin: 1rem 0; }
.cs4u-nameline { display: inline-flex; align-items: center; gap: .6rem; } .cs4u-nameline img { border-radius: 50%; }
.cs4u-actions-cell { white-space: normal !important; } .cs4u-actions-cell .button { margin: 0 4px 4px 0; }
.cs4u-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cs4u-toolbar .cs4u-filters { margin: 0; } .cs4u-dl { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cs4u-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.cs4u-muted { color: var(--cs4u-muted); }
.cs4u-filters label { font-weight: 600; font-size: .85rem; display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* charts */
.cs4u-donutbox { display: grid; grid-template-columns: 170px 1fr; gap: .4rem 1.2rem; align-items: center; } .cs4u-donutbox h3 { grid-column: 1 / -1; margin: 0; }
.cs4u-donut { width: 170px; height: 170px; max-width: 100%; transform: none; color: var(--cs4u-ink); }
.cs4u-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; } .cs4u-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .5rem; vertical-align: -1px; }
.cs4u-legend--row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .6rem; }
.cs4u-chartscroll { overflow-x: auto; max-width: 100%; color: var(--cs4u-ink); } .cs4u-bars { display: block; }
@media (max-width: 520px) { .cs4u-donutbox { grid-template-columns: 1fr; justify-items: center; text-align: center; } .cs4u-donutbox .cs4u-legend { justify-items: start; } }

/* ----- responsive: every button group wraps, never overflows ----- */
.cs4u-btn { max-width: 100%; text-align: center; white-space: normal; }
.cs4u-actions, .cs4u-btnrow, .cs4u-form__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cs4u form button, .cs4u form .cs4u-btn { max-width: 100%; }
@media (max-width: 960px) { .cs4u-admin .cs4u-grid--2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
	.cs4u .cs4u-btn:not(.cs4u-btn--small) { width: 100%; }
	.cs4u-form button.cs4u-btn, .cs4u-form input[type=submit] { width: 100%; }
	.cs4u-actions .cs4u-btn, .cs4u-btnrow .cs4u-btn { flex: 1 1 calc(50% - .6rem); }
	.cs4u-admin .cs4u-table thead { display: table-header-group; } .cs4u-admin .cs4u-table tr { display: table-row; padding: 0; border: 0; } .cs4u-admin .cs4u-table td { display: table-cell; padding: .75rem .9rem; border-bottom: 1px solid var(--cs4u-line); }
	.cs4u-admin .cs4u-tablewrap { border: 1px solid var(--cs4u-line); border-radius: 12px; } .cs4u-admin .cs4u-table { min-width: 620px; }
	.cs4u-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 14px; }
	.cs4u-modal__body .cs4u-grid--2 { grid-template-columns: 1fr; }
	.cs4u-pcard__table th { width: 38%; }
	.cs4u-toolbar { flex-direction: column; align-items: stretch; }
}
