/*
 * Hocthietke Design System
 * Centralized tokens and component mapping for the dashboard theme.
 */

:root {
    /* Primitive colors */
    --ds-white: #ffffff;
    --ds-black: #0c0f14;
    --ds-gray-25: #fbfcfd;
    --ds-gray-50: #f6f8fb;
    --ds-gray-100: #eef1f5;
    --ds-gray-200: #e1e6ee;
    --ds-gray-300: #cbd3df;
    --ds-gray-400: #9aa5b5;
    --ds-gray-500: #687385;
    --ds-gray-600: #4b5565;
    --ds-gray-700: #333b49;
    --ds-gray-800: #1f2632;
    --ds-gray-900: #111722;
    --ds-blue-50: #eef5ff;
    --ds-blue-100: #d9e9ff;
    --ds-blue-500: #2563eb;
    --ds-blue-600: #1d4ed8;
    --ds-green-50: #eafaf0;
    --ds-green-100: #cff5dc;
    --ds-green-500: #22c55e;
    --ds-green-700: #15803d;
    --ds-amber-50: #fff7e6;
    --ds-amber-500: #f59e0b;
    --ds-red-50: #fff1f2;
    --ds-red-500: #e11d48;

    /* Semantic colors */
    --ds-bg: var(--ds-gray-50);
    --ds-surface: var(--ds-white);
    --ds-surface-soft: var(--ds-gray-25);
    --ds-surface-raised: var(--ds-white);
    --ds-text: var(--ds-gray-900);
    --ds-text-soft: var(--ds-gray-600);
    --ds-text-muted: var(--ds-gray-500);
    --ds-text-inverse: var(--ds-white);
    --ds-border: var(--ds-gray-200);
    --ds-border-soft: var(--ds-gray-100);
    --ds-border-strong: var(--ds-gray-300);
    --ds-primary: var(--ds-gray-900);
    --ds-primary-hover: var(--ds-gray-800);
    --ds-primary-soft: var(--ds-gray-100);
    --ds-accent: var(--ds-blue-500);
    --ds-accent-hover: var(--ds-blue-600);
    --ds-success: var(--ds-green-500);
    --ds-success-soft: var(--ds-green-100);
    --ds-success-text: var(--ds-green-700);
    --ds-warning: var(--ds-amber-500);
    --ds-warning-soft: var(--ds-amber-50);
    --ds-danger: var(--ds-red-500);
    --ds-danger-soft: var(--ds-red-50);

    /* App theme colors */
    --ds-app-ps-bg: linear-gradient(145deg, #081a34 0%, #123d73 56%, #2f7fc0 100%);
    --ds-app-ai-bg: radial-gradient(circle at 80% 18%, #ff7a1c 0%, #6f3307 28%, #151820 100%);
    --ds-app-pr-bg: linear-gradient(145deg, #170d58 0%, #2c2a98 48%, #101322 100%);
    --ds-app-ae-bg: linear-gradient(145deg, #080b39 0%, #30257e 52%, #9c7bff 100%);
    --ds-app-af-bg: linear-gradient(145deg, #073466 0%, #0f77b7 56%, #55c7ed 100%);
    --ds-app-id-bg: linear-gradient(145deg, #3d061a 0%, #b40856 62%, #f06b99 100%);
    --ds-app-lr-bg: linear-gradient(145deg, #061c32 0%, #096d99 55%, #45d5ff 100%);
    --ds-app-figma-bg: linear-gradient(145deg, #17171d 0%, #7b3ff2 45%, #18c99a 100%);
    --ds-app-corel-bg: linear-gradient(145deg, #062b19 0%, #148340 55%, #8ed647 100%);
    --ds-app-canva-bg: linear-gradient(145deg, #5b26b6 0%, #00a8be 50%, #25d7d1 100%);
    --ds-app-capcut-bg: linear-gradient(145deg, #080a0f 0%, #252a36 58%, #666f7c 100%);
    --ds-app-blend-bg: linear-gradient(145deg, #112432 0%, #e86b19 55%, #ffb04e 100%);

    /* Typography */
    --ds-font-family: "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    --ds-fs-100: 0.75rem;
    --ds-fs-200: 0.8125rem;
    --ds-fs-300: 0.875rem;
    --ds-fs-400: 0.9375rem;
    --ds-fs-500: 1rem;
    --ds-fs-600: 1.125rem;
    --ds-fs-700: 1.375rem;
    --ds-fs-800: 1.75rem;
    --ds-fw-medium: 500;
    --ds-fw-semibold: 600;
    --ds-fw-bold: 700;
    --ds-lh-tight: 1.2;
    --ds-lh-body: 1.55;

    /* Spacing */
    --ds-space-1: 0.25rem;
    --ds-space-2: 0.5rem;
    --ds-space-3: 0.75rem;
    --ds-space-4: 1rem;
    --ds-space-5: 1.25rem;
    --ds-space-6: 1.5rem;
    --ds-space-8: 2rem;
    --ds-space-10: 2.5rem;

    /* Radius */
    --ds-radius-xs: 6px;
    --ds-radius-sm: 8px;
    --ds-radius-md: 10px;
    --ds-radius-lg: 12px;
    --ds-radius-xl: 14px;
    --ds-radius-2xl: 18px;
    --ds-radius-pill: 999px;

    /* Sizing */
    --ds-topbar-height: 76px;
    --ds-sidebar-left: 280px;
    --ds-sidebar-right: 320px;
    --ds-content-max: none;
    --ds-control-height: 46px;
    --ds-nav-item-height: 42px;
    --ds-mobile-drawer-width: 286px;
    --ds-mobile-page-gutter: 1rem;

    /* Elevation and motion */
    --ds-shadow-1: 0 1px 2px rgba(17, 23, 34, 0.05);
    --ds-shadow-2: 0 8px 24px rgba(17, 23, 34, 0.08);
    --ds-shadow-3: 0 16px 40px rgba(17, 23, 34, 0.12);
    --ds-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.18);
    --ds-motion-fast: 140ms;
    --ds-motion-normal: 220ms;
    --ds-ease: ease;
}

body {
    background: var(--ds-bg);
}

.htk-dashboard {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.07), transparent 34rem),
        linear-gradient(180deg, var(--ds-white) 0, var(--ds-bg) 20rem);
    color: var(--ds-text);
    font-family: var(--ds-font-family);
    line-height: var(--ds-lh-body);
}

.htk-dashboard *,
.htk-dashboard *::before,
.htk-dashboard *::after {
    box-sizing: border-box;
}

.htk-dashboard a {
    color: var(--ds-text);
    text-decoration: none;
    transition:
        color var(--ds-motion-fast) var(--ds-ease),
        background-color var(--ds-motion-fast) var(--ds-ease),
        border-color var(--ds-motion-fast) var(--ds-ease),
        box-shadow var(--ds-motion-fast) var(--ds-ease),
        transform var(--ds-motion-fast) var(--ds-ease);
}

.htk-dashboard a:hover,
.htk-dashboard a:focus {
    color: var(--ds-primary-hover);
    text-decoration: none;
}

.htk-dashboard a:focus-visible,
.htk-dashboard button:focus-visible,
.htk-dashboard input:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

.htk-topbar {
    grid-template-columns: var(--ds-sidebar-left) minmax(280px, 1fr) auto;
    min-height: var(--ds-topbar-height);
    padding: var(--ds-space-4) var(--ds-space-6);
    border: 0;
    border-bottom: 1px solid var(--ds-border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.htk-mobile-menu-toggle,
.htk-sidebar-close,
.htk-sidebar-mobile-head,
.htk-sidebar-backdrop {
    display: none;
}

.htk-brand {
    gap: var(--ds-space-3);
}

.htk-footer-logo-mark {
    color: var(--ds-primary);
    letter-spacing: 0;
}

.htk-brand-text strong {
    color: var(--ds-primary);
    letter-spacing: 0;
}

.htk-footer-logo-text {
    color: var(--ds-primary);
    letter-spacing: 0;
}

.htk-brand small,
.htk-user-meta small,
.htk-section-head p,
.htk-course-body p,
.htk-panel-item p,
.htk-note-list-2 small,
.htk-footer p,
.htk-footer li,
.htk-footer small {
    color: var(--ds-text-soft);
}

.htk-sidebar-divider {
    background: var(--ds-border);
}

.htk-notify {
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md);
    transition:
        background-color var(--ds-motion-fast) var(--ds-ease),
        border-color var(--ds-motion-fast) var(--ds-ease),
        transform var(--ds-motion-fast) var(--ds-ease);
}

.htk-notify:hover {
    background: var(--ds-surface-soft);
    border-color: var(--ds-border);
}

.htk-search {
    height: var(--ds-control-height);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-white);
    box-shadow: var(--ds-shadow-1);
}

.htk-search:focus-within {
    border-color: var(--ds-gray-400);
    box-shadow: 0 0 0 3px rgba(17, 23, 34, 0.08);
}

.htk-search input {
    color: var(--ds-text);
    font-size: var(--ds-fs-400);
    box-shadow: none;
}

.htk-search input::placeholder {
    color: var(--ds-gray-400);
}

.htk-dashboard .htk-search input:focus,
.htk-dashboard .htk-search input:focus-visible {
    outline: none;
    box-shadow: none;
}

.htk-dashboard-grid {
    grid-template-columns: var(--ds-sidebar-left) minmax(0, 1fr) var(--ds-sidebar-right);
    width: 100%;
    max-width: none;
    margin: 0;
    gap: var(--ds-space-6);
    padding: var(--ds-space-5) var(--ds-space-6);
}

.htk-sidebar,
.htk-main,
.htk-panel,
.htk-course-card,
.htk-lessons-wrap {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-xl);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-1);
}

.htk-main {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.htk-sidebar-left {
    padding: var(--ds-space-4);
}

.htk-sidebar-left a {
    min-height: var(--ds-nav-item-height);
    padding: 0.66rem 0.75rem;
    border-radius: var(--ds-radius-md);
    color: var(--ds-gray-700);
    font-size: var(--ds-fs-400);
    font-weight: var(--ds-fw-semibold);
    line-height: 1.4;
}

.htk-sidebar-left a:hover,
.htk-sidebar-left a:focus {
    background: var(--ds-surface-soft);
    color: var(--ds-text);
}

.htk-sidebar-left a.is-active {
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
    box-shadow: var(--ds-shadow-2);
}

.htk-nav-icon {
    color: currentColor;
}

.htk-nav-badge-free,
.htk-free-pill,
.htk-free-mini {
    background: var(--ds-success-soft);
    color: var(--ds-success-text);
}

.htk-nav-badge-dot,
.htk-notify-dot {
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
}

.htk-pro-box {
    margin-top: var(--ds-space-4);
    border-radius: var(--ds-radius-xl);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.22), transparent 10rem),
        linear-gradient(145deg, var(--ds-gray-900), #05070a);
    box-shadow: var(--ds-shadow-2);
}

.htk-pro-box p {
    color: rgba(255, 255, 255, 0.76);
}

.htk-section-head h2 {
    color: var(--ds-text);
    font-size: var(--ds-fs-800);
    line-height: var(--ds-lh-tight);
    letter-spacing: 0;
}

.htk-section-head p {
    max-width: 58ch;
    font-size: var(--ds-fs-500);
}

.htk-course-grid {
    gap: var(--ds-space-4);
}

.htk-course-card {
    overflow: hidden;
    transition:
        transform var(--ds-motion-normal) var(--ds-ease),
        box-shadow var(--ds-motion-normal) var(--ds-ease),
        border-color var(--ds-motion-normal) var(--ds-ease);
}

.htk-course-card:hover {
    border-color: var(--ds-border-strong);
    box-shadow: var(--ds-shadow-2);
    transform: translateY(-2px);
}

.htk-course-cover,
.htk-lesson-thumb {
    aspect-ratio: 16 / 9;
    height: auto;
}

.htk-course-cover {
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding: var(--ds-space-4);
    color: var(--ds-text-inverse);
    text-decoration: none;
}

.htk-course-cover:hover,
.htk-course-cover:focus {
    color: var(--ds-text-inverse);
    text-decoration: none;
}

.htk-course-cover-image {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.htk-course-cover::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    background: linear-gradient(0deg, rgba(12, 15, 20, 0.62), rgba(12, 15, 20, 0.08));
    pointer-events: none;
}

.htk-theme-ps,
.htk-app-ps {
    background: var(--ds-app-ps-bg);
}

.htk-theme-ai,
.htk-app-ai {
    background: var(--ds-app-ai-bg);
}

.htk-theme-pr,
.htk-app-pr {
    background: var(--ds-app-pr-bg);
}

.htk-theme-ae,
.htk-app-ae {
    background: var(--ds-app-ae-bg);
}

.htk-theme-af,
.htk-app-af {
    background: var(--ds-app-af-bg);
}

.htk-theme-id,
.htk-app-id {
    background: var(--ds-app-id-bg);
}

.htk-theme-lr,
.htk-app-lr {
    background: var(--ds-app-lr-bg);
}

.htk-theme-figma,
.htk-app-figma {
    background: var(--ds-app-figma-bg);
}

.htk-theme-corel,
.htk-app-corel {
    background: var(--ds-app-corel-bg);
}

.htk-theme-canva,
.htk-app-canva {
    background: var(--ds-app-canva-bg);
}

.htk-theme-capcut,
.htk-app-capcut {
    background: var(--ds-app-capcut-bg);
}

.htk-theme-blend,
.htk-app-blend {
    background: var(--ds-app-blend-bg);
}

.htk-course-badge {
    position: relative;
    z-index: 2;
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(4, 8, 14, 0.45);
    color: var(--ds-white);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.htk-course-cover h3 {
    position: relative;
    z-index: 2;
    color: var(--ds-white);
    font-size: var(--ds-fs-600);
    letter-spacing: 0;
}

.htk-path-cover-link {
    position: relative;
    display: flex;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--ds-radius-lg);
    color: var(--ds-white);
    text-decoration: none;
}

.htk-path-cover-link:hover,
.htk-path-cover-link:focus {
    color: var(--ds-white);
    text-decoration: none;
}

.htk-path-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.htk-path-cover-link.has-fallback {
    align-items: flex-end;
    background: linear-gradient(135deg, var(--ds-surface-soft), var(--ds-gray-100));
    border: 1px solid var(--ds-border);
    color: var(--ds-text);
    padding: var(--ds-space-5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.htk-path-cover-link.has-fallback:hover,
.htk-path-cover-link.has-fallback:focus {
    color: var(--ds-text);
}

.htk-path-cover-link.has-fallback::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.44));
    pointer-events: none;
}

.htk-path-cover-title {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 92%;
    color: var(--ds-text);
    font-size: var(--ds-fs-700);
    font-weight: 800;
    line-height: 1.16;
    overflow-wrap: anywhere;
}

.htk-path-lessons {
    display: grid;
    gap: var(--ds-space-2);
}

.htk-path-lessons > a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--ds-space-3);
}

.htk-path-lesson-thumb {
    display: block;
    width: 56px;
    height: 40px;
    border-radius: var(--ds-radius-sm);
    object-fit: cover;
    background: var(--ds-gray-100);
}

.htk-path-lesson-thumb.is-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ds-border);
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-200);
    font-weight: var(--ds-fw-bold);
}

.htk-path-lesson-title {
    min-width: 0;
}

.htk-course-body {
    padding: var(--ds-space-4);
}

.htk-course-progress-text {
    color: var(--ds-text);
    font-size: var(--ds-fs-400);
}

.htk-progress,
.htk-progress-thin,
.htk-course-body .htk-progress {
    background: var(--ds-gray-100);
    border-radius: var(--ds-radius-pill);
    overflow: hidden;
}

.htk-progress span,
.htk-progress-thin span,
.htk-course-body .htk-progress span {
    background: var(--ds-primary);
    border-radius: var(--ds-radius-pill);
}

.htk-progress-green span {
    background: var(--ds-success);
}

.htk-upgrade-btn,
.htk-pro-box a,
.htk-filter-tabs button.is-active {
    border: 1px solid var(--ds-primary);
    border-radius: var(--ds-radius-md);
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
    font-weight: var(--ds-fw-semibold);
    box-shadow: var(--ds-shadow-1);
}

.htk-dashboard .htk-topbar-right .htk-upgrade-btn,
.htk-dashboard .htk-topbar-right .htk-upgrade-btn:visited {
    color: var(--ds-text-inverse);
}

.htk-upgrade-btn:hover,
.htk-pro-box a:hover,
.htk-filter-tabs button.is-active:hover {
    border-color: var(--ds-primary-hover);
    background: var(--ds-primary-hover);
    color: var(--ds-text-inverse);
    box-shadow: var(--ds-shadow-2);
    transform: translateY(-1px);
}

.htk-dashboard .htk-topbar-right .htk-upgrade-btn:hover,
.htk-dashboard .htk-topbar-right .htk-upgrade-btn:focus {
    color: var(--ds-text-inverse);
}

.htk-filter-tabs button.is-active:hover,
.htk-filter-tabs button.is-active:focus {
    border-color: var(--ds-primary);
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
    box-shadow: none;
    transform: none;
}

.htk-dashboard a.htk-course-btn,
.htk-dashboard a.htk-course-btn:visited {
    border: 1px solid var(--ds-border-strong);
    border-radius: var(--ds-radius-md);
    background: var(--ds-primary-soft);
    color: var(--ds-primary);
    font-weight: var(--ds-fw-semibold);
    opacity: 1;
    box-shadow: none;
}

.htk-dashboard a.htk-course-btn:hover,
.htk-dashboard a.htk-course-btn:focus {
    border-color: var(--ds-primary);
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
    opacity: 1;
    box-shadow: var(--ds-shadow-2);
    transform: translateY(-1px);
}

.htk-pro-box a {
    border-color: var(--ds-white);
    background: var(--ds-white);
    color: var(--ds-text);
}

.htk-pro-box a:hover,
.htk-pro-box a:focus {
    border-color: var(--ds-white);
    background: var(--ds-gray-100);
    color: var(--ds-text);
}

.htk-filter-tabs button,
.htk-lesson-action,
.htk-lessons-footer a {
    border: 1px solid var(--ds-border-strong);
    border-radius: var(--ds-radius-md);
    background: var(--ds-white);
    color: var(--ds-gray-700);
    font-size: var(--ds-fs-400);
    font-weight: var(--ds-fw-semibold);
}

.htk-lesson-action:hover,
.htk-lessons-footer a:hover {
    border-color: var(--ds-gray-400);
    background: var(--ds-surface-soft);
    color: var(--ds-text);
    transform: translateY(-1px);
}

.htk-filter-tabs button {
    font-size: var(--ds-fs-200);
    box-shadow: none;
    transition:
        background-color var(--ds-motion-fast) var(--ds-ease),
        border-color var(--ds-motion-fast) var(--ds-ease),
        color var(--ds-motion-fast) var(--ds-ease);
}

.htk-filter-tabs button:hover,
.htk-filter-tabs button:focus {
    border-color: var(--ds-gray-400);
    background: var(--ds-gray-50);
    color: var(--ds-primary);
    transform: none;
    box-shadow: none;
}

.htk-course-next {
    border-color: var(--ds-border);
    background: var(--ds-white);
    color: var(--ds-gray-600);
    box-shadow: var(--ds-shadow-2);
}

.htk-course-next:hover {
    color: var(--ds-text);
    transform: translateX(2px);
}

.htk-lessons-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.htk-lesson-card {
    grid-template-columns: minmax(0, 1fr);
    border-color: var(--ds-border-soft);
    box-shadow: var(--ds-shadow-1);
    transition:
        border-color var(--ds-motion-fast) var(--ds-ease),
        box-shadow var(--ds-motion-fast) var(--ds-ease),
        transform var(--ds-motion-fast) var(--ds-ease);
}

.htk-lesson-card:hover {
    border-color: var(--ds-border-strong);
    box-shadow: var(--ds-shadow-2);
    transform: translateY(-2px);
}

.htk-lesson-thumb {
    width: 100%;
    min-height: 0;
    border-radius: var(--ds-radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.htk-lesson-thumb-link {
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
}

.htk-lesson-content {
    min-width: 0;
    overflow: hidden;
}

.htk-lesson-content h3,
.htk-lesson-content p {
    word-break: break-word;
}

.htk-dashboard .htk-lesson-title-link,
.htk-dashboard .htk-lesson-title-link:visited {
    color: var(--ds-text);
    text-decoration: none;
}

.htk-dashboard .htk-lesson-title-link:hover,
.htk-dashboard .htk-lesson-title-link:focus {
    color: var(--ds-gray-600);
    text-decoration: none;
}

.htk-lesson-action {
    align-self: end;
    width: 100%;
    justify-self: stretch;
    justify-content: center;
}

.htk-lesson-content small {
    color: var(--ds-text-muted);
}

.htk-lesson-content .htk-lesson-path-order {
    display: block;
    margin-top: 2px;
}

.htk-lesson-content h3,
.htk-item-title-wrap strong,
.htk-note-list-2 strong {
    color: var(--ds-text);
}

.htk-lesson-content p {
    color: var(--ds-text-soft);
}

.htk-lessons-empty {
    border-color: var(--ds-border);
    border-radius: var(--ds-radius-xl);
    background: var(--ds-surface);
}

.htk-lessons-empty strong {
    color: var(--ds-text);
}

.htk-lessons-empty p {
    color: var(--ds-text-soft);
}

.htk-lesson-meta {
    color: var(--ds-text-muted);
}

.htk-sidebar-right {
    gap: var(--ds-space-4);
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.htk-panel {
    padding: var(--ds-space-3);
    overflow: hidden;
}

.htk-panel h3 {
    font-size: var(--ds-fs-600);
    line-height: var(--ds-lh-tight);
    letter-spacing: 0;
}

.htk-panel-head {
    align-items: flex-start;
    gap: var(--ds-space-3);
    margin-bottom: var(--ds-space-3);
}

.htk-panel-head a {
    color: var(--ds-gray-600);
    font-size: var(--ds-fs-300);
    font-weight: var(--ds-fw-semibold);
}

.htk-panel-head a:hover {
    color: var(--ds-text);
}

.htk-panel-head p {
    margin: var(--ds-space-1) 0 0;
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-300);
    line-height: 1.35;
}

.htk-panel-head .htk-practice-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-pill);
    color: var(--ds-gray-600);
    flex-shrink: 0;
}

.htk-panel-head .htk-practice-link:hover,
.htk-panel-head .htk-practice-link:focus {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface-soft);
    color: var(--ds-text);
}

.htk-practice-link svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.htk-practice-list {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-3);
}

.htk-practice-empty {
    margin: 0;
    padding: var(--ds-space-4);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface-soft);
    color: var(--ds-text-soft);
    font-size: var(--ds-fs-300);
    line-height: 1.5;
}

.htk-practice-card {
    overflow: hidden;
    border: 1px solid var(--ds-border-soft);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-white);
}

.htk-practice-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    overflow: hidden;
    background: var(--ds-gray-900);
}

.htk-practice-thumb-link {
    text-decoration: none;
}

.htk-practice-thumb-link:hover .htk-practice-media,
.htk-practice-thumb-link:focus .htk-practice-media {
    transform: scale(1.03);
}

.htk-practice-backdrop,
.htk-practice-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.htk-practice-backdrop {
    object-fit: cover;
    filter: blur(14px);
    opacity: 0.62;
    transform: scale(1.14);
}

.htk-practice-media {
    z-index: 1;
    object-fit: contain;
    transition: transform var(--ds-motion-fast) var(--ds-ease);
}

.htk-practice-type {
    position: absolute;
    top: var(--ds-space-2);
    left: var(--ds-space-2);
    padding: 0.28rem 0.48rem;
    border-radius: var(--ds-radius-pill);
    background: rgba(255, 255, 255, 0.94);
    color: var(--ds-gray-700);
    font-size: var(--ds-fs-100);
    font-weight: var(--ds-fw-semibold);
    line-height: 1;
    z-index: 2;
}

.htk-practice-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--ds-radius-pill);
    background: rgba(255, 255, 255, 0.95);
    color: var(--ds-primary);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.htk-practice-play svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.htk-practice-body {
    padding: var(--ds-space-3);
}

.htk-practice-body h4 {
    margin: 0 0 var(--ds-space-2);
    color: var(--ds-text);
    font-size: var(--ds-fs-400);
    line-height: 1.3;
}

.htk-practice-author {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    color: var(--ds-text);
}

.htk-practice-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--ds-radius-pill);
    color: var(--ds-text-inverse);
    font-size: var(--ds-fs-200);
    font-weight: var(--ds-fw-semibold);
    flex-shrink: 0;
}

.htk-avatar-image {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--ds-radius-pill);
    object-fit: cover;
}

.htk-member-avatar:has(.htk-avatar-image),
.htk-practice-avatar:has(.htk-avatar-image) {
    border-radius: var(--ds-radius-pill);
    background: transparent;
    box-shadow: none;
}

.htk-practice-author strong {
    font-size: var(--ds-fs-300);
    line-height: 1.3;
}

.htk-practice-body p {
    margin: var(--ds-space-2) 0 0;
    color: var(--ds-text-soft);
    font-size: var(--ds-fs-200);
    line-height: 1.4;
}

.htk-member-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.htk-member-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: var(--ds-space-3);
    align-items: center;
    padding: var(--ds-space-3) 0;
}

.htk-member-item:first-child {
    padding-top: 0;
}

.htk-member-item + .htk-member-item {
    border-top: 1px solid var(--ds-border-soft);
}

.htk-member-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: var(--ds-radius-md);
    color: var(--ds-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ds-fs-600);
    font-weight: var(--ds-fw-bold);
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.htk-member-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.htk-member-body strong,
.htk-member-body span,
.htk-member-body small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.htk-member-body strong {
    color: var(--ds-text);
    font-size: var(--ds-fs-400);
    line-height: 1.3;
}

.htk-member-body span {
    color: var(--ds-text-soft);
    font-size: var(--ds-fs-300);
    line-height: 1.35;
}

.htk-member-body .htk-member-lesson-link {
    color: var(--ds-text-soft);
    font-size: var(--ds-fs-300);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.htk-member-body .htk-member-lesson-link:hover,
.htk-member-body .htk-member-lesson-link:focus {
    color: var(--ds-text);
}

.htk-member-body small {
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-200);
    line-height: 1.3;
}

.htk-member-progress {
    width: 100%;
    height: 5px;
    margin-top: var(--ds-space-1);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-gray-100);
    overflow: hidden;
}

.htk-member-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--ds-primary);
}

.htk-online-count {
    min-width: 28px;
    height: 28px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--ds-space-2);
    font-size: var(--ds-fs-300);
    font-weight: var(--ds-fw-bold);
    flex-shrink: 0;
}

.htk-online-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--ds-white);
    border-radius: var(--ds-radius-pill);
    background: var(--ds-success);
}

.htk-online-avatar-list {
    list-style: none;
    margin: 0;
    padding: var(--ds-space-3);
    border: 1px solid var(--ds-border-soft);
    border-radius: var(--ds-radius-xl);
    background: var(--ds-surface-soft);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-2);
}

.htk-online-avatar-list li {
    display: inline-flex;
}

.htk-online-avatar-list .htk-member-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--ds-radius-pill);
    font-size: var(--ds-fs-500);
}

.htk-online-summary {
    margin: var(--ds-space-3) 0 0;
    color: var(--ds-text-soft);
    font-size: var(--ds-fs-300);
    line-height: 1.35;
}

.htk-item-app,
.htk-note-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--ds-radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: var(--ds-fs-600);
    flex: 0 0 36px;
}

.htk-panel-item {
    padding-top: var(--ds-space-3);
}

.htk-panel-item:first-of-type {
    padding-top: 0;
}

.htk-panel-item + .htk-panel-item {
    margin-top: var(--ds-space-3);
    border-top: 1px solid var(--ds-border-soft);
}

.htk-item-top small {
    color: var(--ds-text);
    font-size: var(--ds-fs-500);
    font-weight: var(--ds-fw-semibold);
    line-height: var(--ds-lh-tight);
    flex-shrink: 0;
}

.htk-item-title-wrap {
    gap: var(--ds-space-2);
    min-width: 0;
}

.htk-item-title-wrap strong {
    min-width: 0;
    font-size: var(--ds-fs-400);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.htk-panel-item p {
    font-size: var(--ds-fs-300);
    line-height: 1.35;
}

.htk-progress-thin {
    height: 5px;
    margin-top: var(--ds-space-2);
}

.htk-note-list-2 li {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--ds-space-2);
}

.htk-note-list-2 li + li {
    margin-top: var(--ds-space-3);
    padding-top: var(--ds-space-3);
    border-top: 1px solid var(--ds-border-soft);
}

.htk-note-list-2 strong {
    font-size: var(--ds-fs-400);
    line-height: 1.3;
}

.htk-note-list-2 p {
    margin: 0.15rem 0;
    font-size: var(--ds-fs-300);
    line-height: 1.35;
}

.htk-note-list-2 small {
    font-size: var(--ds-fs-200);
    line-height: 1.35;
}

.htk-note-gold {
    background: var(--ds-warning-soft);
    color: var(--ds-warning);
}

.htk-note-blue {
    background: var(--ds-gray-100);
    color: var(--ds-gray-700);
}

.htk-note-green {
    background: var(--ds-green-50);
    color: var(--ds-success-text);
}

.htk-note-list-2 p {
    color: var(--ds-text-soft);
}

.htk-footer {
    margin-top: var(--ds-space-6);
    border-top: 1px solid var(--ds-border);
    background: rgba(255, 255, 255, 0.72);
}

.htk-footer-inner {
    width: min(100%, 1400px);
    max-width: 1400px;
    margin-inline: auto;
    padding-inline: var(--ds-space-6);
}

.htk-footer h4 {
    color: var(--ds-text);
    font-size: var(--ds-fs-300);
    letter-spacing: 0;
}

.htk-footer a {
    color: var(--ds-text-soft);
}

.htk-footer a:hover,
.htk-footer a:focus {
    color: var(--ds-text);
}

.htk-footer-socials a {
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
    box-shadow: var(--ds-shadow-1);
}

.htk-footer-socials a:hover {
    background: var(--ds-primary-hover);
    color: var(--ds-text-inverse);
    transform: translateY(-1px);
}

@media (max-width: 1200px) {
    .htk-dashboard-grid {
        grid-template-columns: 245px minmax(0, 1fr);
        gap: var(--ds-space-4);
        padding: var(--ds-space-4);
    }

    .htk-footer-inner {
        padding-inline: var(--ds-space-4);
    }

}

@media (max-width: 900px) {
    .htk-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "left right"
            "search search";
        min-height: auto;
        padding: var(--ds-space-4) var(--ds-space-4);
    }

    .htk-topbar-left {
        grid-area: left;
        justify-content: flex-start;
    }

    .htk-search {
        grid-area: search;
    }

    .htk-topbar-right {
        grid-area: right;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .htk-topbar-right .htk-upgrade-btn {
        display: none;
    }

    .htk-mobile-menu-toggle {
        width: 40px;
        height: 40px;
        border: 1px solid var(--ds-border);
        border-radius: var(--ds-radius-md);
        background: var(--ds-surface);
        color: var(--ds-text);
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0;
        cursor: pointer;
        flex-shrink: 0;
    }

    .htk-mobile-menu-toggle span {
        width: 18px;
        height: 2px;
        border-radius: var(--ds-radius-pill);
        background: currentColor;
    }

    .htk-dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--ds-space-3);
        padding: var(--ds-space-3) var(--ds-mobile-page-gutter);
    }

    .htk-sidebar-left {
        position: fixed;
        z-index: 60;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(var(--ds-mobile-drawer-width), calc(100vw - 52px));
        max-height: 100dvh;
        overflow-y: auto;
        border-radius: 0 var(--ds-radius-xl) var(--ds-radius-xl) 0;
        transform: translateX(calc(-100% - var(--ds-space-4)));
        visibility: hidden;
        transition:
            transform var(--ds-motion-normal) var(--ds-ease),
            visibility var(--ds-motion-normal) var(--ds-ease);
    }

    .htk-sidebar-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: var(--ds-space-3);
        margin-bottom: var(--ds-space-2);
        border-bottom: 1px solid var(--ds-border);
        font-size: var(--ds-fs-500);
    }

    .htk-sidebar-close {
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: var(--ds-radius-md);
        background: var(--ds-surface-soft);
        color: var(--ds-text);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
    }

    .htk-sidebar-close svg {
        width: 19px;
        height: 19px;
        fill: currentColor;
    }

    .htk-sidebar-backdrop {
        position: fixed;
        z-index: 55;
        inset: 0;
        border: 0;
        background: rgba(12, 15, 20, 0.42);
        opacity: 0;
        visibility: hidden;
        transition:
            opacity var(--ds-motion-normal) var(--ds-ease),
            visibility var(--ds-motion-normal) var(--ds-ease);
    }

    body.htk-sidebar-open .htk-sidebar-left {
        transform: translateX(0);
        visibility: visible;
    }

    body.htk-sidebar-open .htk-sidebar-backdrop {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    body.htk-sidebar-lock {
        overflow: hidden;
    }

    .htk-footer-inner {
        padding-inline: var(--ds-mobile-page-gutter);
    }

    .htk-section-head h2,
    .htk-panel h3 {
        font-size: var(--ds-fs-700);
    }
}

@media (max-width: 640px) {
    :root {
        --ds-fs-100: 0.6875rem;
        --ds-fs-200: 0.75rem;
        --ds-fs-300: 0.8125rem;
        --ds-fs-400: 0.875rem;
        --ds-fs-500: 0.9375rem;
        --ds-fs-600: 1.0625rem;
        --ds-fs-700: 1.25rem;
        --ds-fs-800: 1.5rem;
        --ds-space-2: 0.375rem;
        --ds-space-3: 0.625rem;
        --ds-space-4: 0.875rem;
        --ds-space-5: 1rem;
        --ds-space-6: 1.125rem;
        --ds-space-8: 1.5rem;
        --ds-space-10: 2rem;
        --ds-radius-md: 8px;
        --ds-radius-lg: 10px;
        --ds-radius-xl: 12px;
        --ds-radius-2xl: 14px;
        --ds-control-height: 40px;
        --ds-nav-item-height: 38px;
        --ds-mobile-drawer-width: 272px;
        --ds-mobile-page-gutter: 1rem;
    }

    .htk-topbar {
        padding: var(--ds-space-3);
        gap: var(--ds-space-3);
    }

    .htk-mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .htk-brand-text strong {
        font-size: var(--ds-fs-600);
    }

    .htk-brand small {
        font-size: var(--ds-fs-200);
    }

    .htk-topbar-right {
        gap: var(--ds-space-3);
    }

    .htk-dashboard-grid {
        gap: var(--ds-space-2);
        padding: var(--ds-space-2) var(--ds-mobile-page-gutter);
    }

    .htk-footer-inner {
        padding-inline: var(--ds-mobile-page-gutter);
    }

    .htk-section-head h2 {
        font-size: var(--ds-fs-600);
    }

    .htk-panel,
    .htk-sidebar-left,
    .htk-course-body,
    .htk-lesson-card {
        padding: var(--ds-space-3);
    }
}
