:root {
    --container: 1200px;

    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --border: #e2e8f0;
    --soft: #f1f5f9;
    --brand: #2563eb;
    --brand-2: #1d4ed8;
    --brand-soft: rgba(37, 99, 235, .08);

    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .08), 0 1px 1px rgba(15, 23, 42, .06);
    --ring: 0 0 0 4px rgba(37, 99, 235, .10);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

.icon {
    width: 20px;
    height: 20px;
}

.icon--sm {
    width: 16px;
    height: 16px;
}

.icon--xs {
    width: 12px;
    height: 12px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .80);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header__inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand__mark {
    display: flex;
    align-items: center;
    height: 40px;
    padding-right: 12px;
    border-right: 1px solid var(--border);
    text-decoration: none;
}

.brand__name {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--brand);
}

.brand__country {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--muted-2);
    line-height: 1.1;
}

.brand__org {
    display: none;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    line-height: 1.2;
    text-decoration: none;
}

@media (min-width: 640px) {
    .brand__org {
        display: block;
    }
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (min-width: 768px) {
    .header__actions {
        gap: 16px;
    }
}

.lang-switch {
    display: flex;
    align-items: center;
    background: var(--soft);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.lang-switch__btn {
    border: 0;
    background: transparent;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}

.lang-switch__btn:hover {
    color: var(--brand);
}

.lang-switch__btn.is-active {
    background: #fff;
    color: var(--brand);
    box-shadow: var(--shadow-sm);
}

.btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: color .2s ease, background .2s ease;
}

.btn:hover {
    color: var(--brand);
}

.btn--icon {
    padding: 8px;
}

.btn--login {
    display: none;
}

.btn--search {
    display: inline-flex;
}

@media (min-width: 768px) {
    .btn--login {
        display: inline-flex;
    }

    .btn--search {
        display: none;
    }
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    background: var(--bg);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .footer__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .footer__grid {
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    }
}

.footer__about {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer__brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.footer__brand-name {
    font-size: 24px;
    font-weight: 900;
    color: var(--brand);
}

.footer__brand-country {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted-2);
}

.footer__title {
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted-2);
    margin-bottom: 14px;
}

.footer__text {
    color: var(--muted);
    line-height: 1.7;
    max-width: 320px;
}

.footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__link {
    font-size: 12px !important;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s ease;
}

.footer__link:hover {
    color: var(--brand);
}

.footer__link--external {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer__bottom {
    border-top: 1px solid var(--border);
    padding-top: 18px;

    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;

    color: var(--muted-2);
}

@media (min-width: 768px) {
    .footer__bottom {
        flex-direction: row;
        align-items: center;
    }
}

.footer__copy {
    margin: 0;
    color: var(--muted-2);
}

.footer__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
}


::selection {
    background: rgba(37, 99, 235, .15);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

.icon {
    width: 20px;
    height: 20px;
}

.icon--sm {
    width: 16px;
    height: 16px;
}

.icon--lg {
    width: 24px;
    height: 24px;
}

.icon--brand {
    color: var(--brand);
}

.is-hidden {
    display: none !important;
}

.hero {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.hero__inner {
    padding: 48px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .hero__inner {
        padding: 80px 16px;
    }
}

.hero__title {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    max-width: 860px;
}

@media (min-width: 768px) {
    .hero__title {
        font-size: 48px;
    }
}

.hero__subtitle {
    margin: 0 0 40px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
    max-width: 720px;
}

@media (min-width: 768px) {
    .hero__subtitle {
        font-size: 20px;
    }
}

.search {
    width: 100%;
    max-width: 760px;
    position: relative;
}

.search__icon {
    position: absolute;
    left: 18px;
    top: 18px;
    pointer-events: none;
    color: var(--muted-2);
    transition: color .2s ease;
}

.search__input {
    width: 100%;
    height: 64px;
    padding: 0 18px 0 54px;
    border-radius: var(--radius-xl);
    border: 2px solid var(--border);
    background: var(--bg);
    outline: none;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.search__input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.search:focus-within .search__icon {
    color: var(--brand);
}

.search__suggestions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
}

.search__hint {
    color: var(--muted-2);
}

.search__tag {
    border: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.search__tag:hover {
    text-decoration: underline;
}

.roles {
    width: 100%;
    max-width: 640px;
    margin-top: 48px;
}

.roles__label {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--muted-2);
}

.roles__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .roles__grid {
        gap: 16px;
    }
}

.role-card {
    border: 2px solid #f1f5f9;
    background: #fff;
    border-radius: 14px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .12s ease;
}

.role-card .icon {
    color: var(--muted-2);
}

.role-card__text {
    font-size: 14px;
    font-weight: 800;
    color: #475569;
}

.role-card:hover {
    transform: translateY(-1px);
}

.role-card--student:hover {
    border-color: #22c55e;
    background: rgba(34, 197, 94, .07);
}

.role-card--teacher:hover {
    border-color: var(--brand);
    background: rgba(37, 99, 235, .07);
}

.role-card--parent:hover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, .07);
}

.role-card.is-selected {
    border-color: var(--brand);
    background: rgba(37, 99, 235, .06);
}

.role-card.is-selected .icon {
    color: var(--brand);
}

.role-card.is-selected .role-card__text {
    color: var(--brand-2);
}

.quick-filters {
    background: var(--bg);
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
}

.quick-filters__wrap {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
}

.quick-filters__wrap::-webkit-scrollbar {
    display: none;
}

.quick-filters__wrap {
    scrollbar-width: none;
}

@media (min-width: 768px) {
    .quick-filters__wrap {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        overflow: visible;
    }
}

.filter-pill {
    scroll-snap-align: start;
    min-width: 190px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .12s ease;
}

@media (min-width: 768px) {
    .filter-pill {
        min-width: 0;
    }
}

.filter-pill:hover {
    border-color: rgba(37, 99, 235, .35);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.filter-pill__left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    color: #334155;
}

.section-head {
    margin-bottom: 24px;
}

.section-head--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-head__title {
    margin: 0;
    font-weight: 800;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-head__title--lg {
    font-size: 24px;
    letter-spacing: -0.01em;
}

.section-head__accent {
    width: 8px;
    height: 32px;
    background: var(--brand-2);
    border-radius: 999px;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.personalized {
    padding: 48px 0;
    background: rgba(37, 99, 235, .06);
}

.popular {
    padding: 64px 0;
}

.link-btn {
    border: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.link-btn:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--muted-2);
}

.info-strip {
    background: #0f172a;
    color: #fff;
    padding: 48px 0;
}

.info-strip__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
}

@media (min-width: 768px) {
    .info-strip__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        text-align: left;
    }
}

.info-item__title {
    font-weight: 900;
    color: #60a5fa;
    font-size: 20px;
    margin-bottom: 6px;
}

.info-item__text {
    margin: 0;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.view {
    flex: 1;
    min-height: 0;
}

.view--classic {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.classic-top {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 48px 0;
    flex-shrink: 0;
}

.classic-top__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.search {
    width: 100%;
    max-width: 760px;
    position: relative;
}

.search__icon {
    position: absolute;
    left: 18px;
    top: 18px;
    color: var(--muted-2);
    pointer-events: none;
}

.search__input {
    width: 100%;
    height: 64px;
    padding: 0 18px 0 54px;
    border-radius: var(--radius-xl);
    border: 2px solid #f1f5f9;
    background: var(--bg);
    outline: none;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.search__input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.role-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    border: 2px solid #f1f5f9;
    background: #fff;
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.chip:hover {
    border-color: rgba(37, 99, 235, .25);
    color: var(--brand-2);
}

.chip.is-active {
    border-color: var(--brand);
    background: rgba(37, 99, 235, .07);
    color: var(--brand-2);
}

.chip--soft {
    border: 1px solid var(--border);
    background: #fff;
    font-size: 11px;
    padding: 7px 12px;
}

.classic-results {
    padding: 48px 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.classic-results__title {
    margin: 0 0 22px;
    font-weight: 800;
    font-size: 20px;
}

.cards-grid {
    display: grid;
    gap: 24px;
    padding-bottom: 48px;
}

.cards-grid--4 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .cards-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .cards-grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.cards-grid--2 {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 48px;
}

@media (min-width: 640px) {
    .cards-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.view--ai {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--bg);
    flex-direction: column;
}

@media (min-width: 768px) {
    .view--ai {
        flex-direction: row;
    }
}

.ai-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ai-panel--chat {
    background: #fff;
    border-right: 1px solid var(--border);
    flex: 1;
    max-width: 650px;
    margin: 0 auto;
}

.ai-panel--results {
    background: var(--bg);
    border-left: 1px solid var(--border);
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.ai-context {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.ai-context__label {
    width: 100%;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted-2);
    letter-spacing: .12em;
    margin-bottom: 2px;
}

.ai-context__empty {
    font-size: 12px;
    font-style: italic;
    color: var(--muted-2);
}

.chat {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
}

.chat__row {
    display: flex;
}

.chat__row--left {
    justify-content: flex-start;
}

.chat__row--right {
    justify-content: flex-end;
}

.bubble {
    max-width: 85%;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.bubble--assistant {
    background: #f1f5f9;
    color: #1f2937;
    border-top-left-radius: 6px;
}

.bubble--user {
    background: var(--brand);
    color: #fff;
    border-top-right-radius: 6px;
}

.typing {
    padding: 0 16px 10px;
    color: var(--muted-2);
    font-size: 12px;
    font-style: italic;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: .55;
    }
    50% {
        opacity: 1;
    }
}

.chat-input {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.chat-input__row {
    display: flex;
    gap: 10px;
}

.chat-input__field {
    flex: 1;
    height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 0;
    outline: none;
    background: #f1f5f9;
    box-shadow: inset 0 0 0 2px transparent;
    transition: box-shadow .2s ease;
}

.chat-input__field:focus {
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .35);
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 0;
    cursor: pointer;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
    transition: transform .12s ease, background .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--brand-2);
}

.send-btn:active {
    transform: scale(.97);
}

.ai-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.ai-results-head__title {
    margin: 0;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-empty {
    grid-column: 1 / -1;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: .55;
    gap: 12px;
    margin-top: 24px;
}

.ai-empty__icon {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.ai-empty__text {
    margin: 0;
    color: var(--muted-2);
    font-weight: 800;
}

.ai-empty__text span {
    font-weight: 500;
    font-size: 12px;
}

.tabs {
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tabs__inner {
    display: flex;
    justify-content: center;
}

.tabs__list {
    display: flex;
    gap: 32px;
    align-items: center;
}

.tab {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 16px 8px;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-2);
    border-bottom: 2px solid transparent;
    transition: color .2s ease, border-color .2s ease;
    text-decoration: none;
}

.tab:hover {
    color: #475569;
}

.tab.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.tab:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 10px;
}
