* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #eef0ff;
    color: #101532;
}

button,
textarea,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.ds-app {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 0%, rgba(130, 91, 255, .16), transparent 32%),
        linear-gradient(180deg, #f4f2ff 0%, #eef1ff 100%);
}

.ds-shell {
    width: 100%;
    max-width: 1180px;
    min-height: 100vh;
    padding: 32px 28px 130px;
}

.ds-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.ds-logo {
    font-size: clamp(42px, 7vw, 70px);
    font-weight: 950;
    letter-spacing: -4px;
    line-height: .9;
    color: #101532;
}

.ds-logo span {
    background: linear-gradient(135deg, #6557ff, #35b7ff);
    -webkit-background-clip: text;
    color: transparent;
}

.ds-tagline {
    margin: 14px 0 0;
    font-size: clamp(18px, 3vw, 32px);
    font-weight: 800;
    color: #58617c;
}

.ds-top-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ds-icon-button,
.ds-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 16px 40px rgba(39, 34, 90, .12);
    display: grid;
    place-items: center;
    position: relative;
}

.ds-icon-button svg {
    width: 38px;
    height: 38px;
    stroke: #101532;
    stroke-width: 2.4;
    fill: none;
}

.ds-icon-button i {
    position: absolute;
    right: 24px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff3f63;
    border: 3px solid #fff;
}

.ds-avatar img {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    object-fit: cover;
}

.ds-hero {
    position: relative;
    min-height: 310px;
    border-radius: 54px;
    padding: 58px 72px;
    margin-bottom: 36px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 80% 20%, rgba(255,255,255,.28), transparent 22%),
        linear-gradient(135deg, #5e2dff 0%, #884cff 48%, #e163c4 100%);
    box-shadow: 0 28px 70px rgba(99, 73, 255, .28);
}

.ds-hero-content {
    max-width: 620px;
    position: relative;
    z-index: 2;
}

.ds-hero h1 {
    margin: 0;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -2px;
}

.ds-hero p {
    margin: 24px 0 44px;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800;
}

.ds-progress-row {
    display: flex;
    align-items: center;
    gap: 26px;
    max-width: 560px;
}

.ds-progress {
    flex: 1;
    height: 52px;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
    overflow: hidden;
}

.ds-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #58ec73, #a5ff65);
}

.ds-progress-row strong {
    min-width: 94px;
    height: 62px;
    border-radius: 34px;
    display: grid;
    place-items: center;
    background: rgba(45, 31, 120, .55);
    font-size: 30px;
    font-weight: 950;
}

.ds-week-goal {
    margin-top: 34px;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 900;
}

.ds-hero-streak {
    position: absolute;
    right: 58px;
    top: 50%;
    transform: translateY(-50%);
    width: 190px;
    height: 190px;
    border-radius: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,190,105,.72), rgba(61,30,87,.8));
    box-shadow: inset 0 2px 0 rgba(255,255,255,.32), 0 18px 44px rgba(54, 28, 93, .28);
}

.ds-hero-streak strong {
    font-size: 64px;
    line-height: .9;
    font-weight: 950;
}

.ds-hero-streak span {
    margin-top: 14px;
    font-size: 24px;
    font-weight: 950;
    text-transform: uppercase;
}

.ds-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255,255,255,.92);
    border-radius: 48px;
    padding: 36px 44px;
    margin-bottom: 54px;
    box-shadow: 0 22px 60px rgba(39, 34, 90, .10);
}

.ds-stats article {
    display: grid;
    grid-template-columns: 86px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 24px;
    padding: 18px 22px;
    border-right: 1px solid #e6e9f5;
}

.ds-stats article:last-child {
    border-right: 0;
}

.ds-stat-icon {
    grid-row: span 2;
    width: 82px;
    height: 82px;
    border-radius: 28px;
    display: grid;
    place-items: center;
}

.ds-stat-icon svg {
    width: 42px;
    height: 42px;
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
}

.ds-stat-icon.purple { background: linear-gradient(135deg, #8a42ff, #b052ff); }
.ds-stat-icon.gold { background: linear-gradient(135deg, #ffae2d, #ffc65d); }
.ds-stat-icon.green { background: linear-gradient(135deg, #35cf59, #62e779); }
.ds-stat-icon.blue { background: linear-gradient(135deg, #238dff, #56c7ff); }

.ds-stats strong {
    font-size: clamp(32px, 4vw, 50px);
    line-height: 1;
    font-weight: 950;
    color: #101532;
}

.ds-stats span {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 850;
    color: #525c77;
}

.ds-section h2 {
    margin: 0 0 28px;
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 950;
    letter-spacing: -2px;
}

.ds-learn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 34px;
}

.ds-learn-card {
    min-height: 300px;
    border-radius: 42px;
    padding: 34px;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 22px 50px rgba(39, 34, 90, .10);
}

.ds-learn-card.lavender { background: linear-gradient(180deg, #f0defd, #fff); }
.ds-learn-card.sky { background: linear-gradient(180deg, #dff0ff, #fff); }
.ds-learn-card.mint { background: linear-gradient(180deg, #dcf8db, #fff); }

.ds-card-visual {
    height: 140px;
    display: grid;
    place-items: center;
}

.ds-card-visual svg {
    width: 120px;
    height: 120px;
    stroke: #6538ff;
    stroke-width: 3;
    fill: none;
}

.ds-learn-card strong {
    display: block;
    margin-top: 18px;
    font-size: 28px;
    font-weight: 950;
    color: #101532;
}

.ds-learn-card p {
    margin: 12px 0 0;
    font-size: 18px;
    font-weight: 700;
    color: #4f5875;
}

.ds-arrow {
    position: absolute;
    right: 32px;
    bottom: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #7c3cff;
    color: #fff;
    font-size: 38px;
    line-height: 1;
}

.ds-arrow.green {
    background: #30c95b;
}

.ds-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.ds-panel {
    background: rgba(255,255,255,.94);
    border-radius: 34px;
    padding: 28px;
    box-shadow: 0 18px 44px rgba(39, 34, 90, .09);
}

.ds-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.ds-panel h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 950;
}

.ds-panel a {
    font-size: 15px;
    font-weight: 850;
    color: #5d49e8;
    text-decoration: none;
}

.ds-subject-row {
    display: grid;
    grid-template-columns: 130px 1fr 48px;
    align-items: center;
    gap: 18px;
    margin: 18px 0;
    font-weight: 850;
}

.ds-subject-row div,
.ds-mini-progress {
    height: 12px;
    border-radius: 999px;
    background: #eceef8;
    overflow: hidden;
}

.ds-subject-row i,
.ds-mini-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7347ff, #b463ff);
}

.ds-task {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.ds-task > span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid #d9ddec;
}

.ds-task.done > span {
    background: #37d057;
    border-color: #37d057;
}

.ds-task strong {
    display: block;
    font-size: 18px;
}

.ds-task small {
    color: #6a738d;
    font-weight: 700;
}

.ds-partners {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.ds-partners div,
.ds-add-friend {
    text-align: center;
    background: #f7f8ff;
    border-radius: 24px;
    padding: 16px 8px;
}

.ds-partners img {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
}

.ds-partners strong,
.ds-partners span {
    display: block;
}

.ds-partners strong {
    margin-top: 8px;
    font-weight: 950;
}

.ds-partners span {
    font-size: 13px;
    font-weight: 800;
    color: #6a738d;
}

.ds-add-friend {
    color: #5d49e8;
    font-weight: 900;
    background: #fff;
    border: 2px dashed #cdd2e6;
}

.ds-add-friend span {
    display: block;
    font-size: 36px;
}

.ds-group-row {
    display: grid;
    grid-template-columns: 56px 1fr 38px;
    align-items: center;
    gap: 16px;
    margin: 18px 0;
}

.ds-group-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
}

.ds-group-icon.blue { background: linear-gradient(135deg, #238dff, #56c7ff); }
.ds-group-icon.pink { background: linear-gradient(135deg, #ff4fa3, #ff87cf); }

.ds-group-row strong {
    display: block;
    margin-bottom: 8px;
}

.ds-group-row small {
    display: block;
    margin-top: 6px;
    color: #6a738d;
    font-weight: 750;
}

.ds-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(94vw, 980px);
    height: 116px;
    border-radius: 58px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 24px 80px rgba(39, 34, 90, .18);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(18px);
}

.ds-bottom-nav button {
    background: transparent;
    color: #67708b;
    font-size: 18px;
    font-weight: 950;
}

.ds-bottom-nav button.active {
    color: #6538ff;
}

.ds-ai-button {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6538ff, #a448ff) !important;
    color: #fff !important;
    font-size: 58px !important;
    box-shadow: 0 18px 40px rgba(101, 56, 255, .35);
    justify-self: center;
    transform: translateY(-16px);
}

.ds-learn-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
}

.ds-learn-modal.active {
    display: block;
}

.ds-learn-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 16, 38, .52);
    backdrop-filter: blur(12px);
}

.ds-learn-modal-box {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(92vw, 760px);
    max-height: 88vh;
    transform: translate(-50%, -50%);
    overflow: auto;
    background: #fff;
    border-radius: 38px;
    padding: 34px;
    box-shadow: 0 36px 120px rgba(12, 16, 38, .32);
}

.ds-learn-close {
    position: absolute;
    right: 22px;
    top: 18px;
    background: #f1f3fb;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    color: #101532;
}

.ds-learn-modal-head span {
    color: #6538ff;
    font-weight: 950;
}

.ds-learn-modal-head h2 {
    margin: 10px 0;
    font-size: 34px;
    line-height: 1.1;
}

.ds-learn-modal-head p {
    margin: 0 0 22px;
    color: #5b647f;
    font-weight: 700;
}

.ds-learn-input {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    border: 2px solid #e4e7f4;
    border-radius: 24px;
    padding: 20px;
    outline: none;
    font-size: 18px;
}

.ds-learn-submit {
    width: 100%;
    margin-top: 18px;
    height: 62px;
    border-radius: 22px;
    color: #fff;
    font-size: 19px;
    font-weight: 950;
    background: linear-gradient(135deg, #6538ff, #a448ff);
}

.ds-learn-result {
    margin-top: 24px;
    display: grid;
    gap: 16px;
}

.ds-ai-card {
    background: #f7f8ff;
    border: 1px solid #e8ebf7;
    border-radius: 24px;
    padding: 20px;
}

.ds-ai-card h2,
.ds-ai-card h3,
.ds-ai-card p {
    margin: 0;
}

.ds-ai-card p,
.ds-ai-card li {
    color: #33405f;
    line-height: 1.55;
    font-weight: 700;
}

.ds-ai-card.title {
    background: linear-gradient(135deg, #6538ff, #a448ff);
    color: #fff;
}

.ds-ai-card.important {
    background: #fff6df;
    border-color: #ffe2a3;
}

.ds-ai-card.success {
    background: #eaffef;
    border-color: #baf3c8;
}

.ds-ai-card.warning {
    background: #fff0f2;
    border-color: #ffc5cd;
}

.ds-ai-card.formula strong {
    display: block;
    margin-top: 10px;
    font-size: 26px;
    font-weight: 950;
}

.ds-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 14px;
}

.ds-step span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #6538ff;
    color: #fff;
    font-weight: 950;
    flex: 0 0 auto;
}

.ds-ai-loading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px;
    border-radius: 24px;
    background: #f7f8ff;
}

.ds-ai-loading span {
    width: 24px;
    height: 24px;
    border: 4px solid #d9dcf0;
    border-top-color: #6538ff;
    border-radius: 50%;
    animation: ds-spin 1s linear infinite;
}

@keyframes ds-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 920px) {
    .ds-shell {
        max-width: 760px;
        padding: 26px 24px 130px;
    }

    .ds-hero {
        padding: 42px;
        min-height: 280px;
    }

    .ds-hero-streak {
        width: 150px;
        height: 150px;
        right: 34px;
    }

    .ds-hero-streak strong {
        font-size: 52px;
    }

    .ds-hero-streak span {
        font-size: 18px;
    }

    .ds-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 28px;
    }

    .ds-stats article {
        border-right: 0;
        border-bottom: 1px solid #e6e9f5;
    }

    .ds-stats article:nth-child(3),
    .ds-stats article:nth-child(4) {
        border-bottom: 0;
    }

    .ds-learn-grid {
        grid-template-columns: 1fr;
    }

    .ds-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .ds-shell {
        padding: 22px 18px 126px;
    }

    .ds-topbar {
        align-items: flex-start;
    }

    .ds-logo {
        font-size: 48px;
        letter-spacing: -3px;
    }

    .ds-tagline {
        font-size: 20px;
    }

    .ds-icon-button,
    .ds-avatar {
        width: 58px;
        height: 58px;
    }

    .ds-icon-button svg {
        width: 28px;
        height: 28px;
    }

    .ds-icon-button i {
        right: 12px;
        top: 9px;
    }

    .ds-avatar img {
        width: 50px;
        height: 50px;
    }

    .ds-hero {
        border-radius: 34px;
        padding: 34px 26px 140px;
        min-height: 360px;
    }

    .ds-hero p {
        margin-bottom: 32px;
    }

    .ds-progress-row {
        gap: 12px;
    }

    .ds-progress {
        height: 34px;
    }

    .ds-progress-row strong {
        height: 42px;
        min-width: 70px;
        font-size: 22px;
    }

    .ds-week-goal {
        font-size: 21px;
    }

    .ds-hero-streak {
        left: 26px;
        right: auto;
        bottom: 26px;
        top: auto;
        transform: none;
        width: 118px;
        height: 118px;
        border-radius: 30px;
    }

    .ds-hero-streak strong {
        font-size: 42px;
    }

    .ds-hero-streak span {
        font-size: 14px;
    }

    .ds-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 18px;
        border-radius: 34px;
        margin-bottom: 40px;
    }

    .ds-stats article {
        grid-template-columns: 54px 1fr;
        gap: 0 12px;
        padding: 18px 10px;
    }

    .ds-stat-icon {
        width: 52px;
        height: 52px;
        border-radius: 18px;
    }

    .ds-stat-icon svg {
        width: 28px;
        height: 28px;
    }

    .ds-stats strong {
        font-size: 32px;
    }

    .ds-stats span {
        font-size: 15px;
    }

    .ds-section h2 {
        font-size: 38px;
    }

    .ds-learn-card {
        min-height: 260px;
        border-radius: 34px;
    }

    .ds-dashboard-grid {
        gap: 20px;
    }

    .ds-partners {
        grid-template-columns: repeat(2, 1fr);
    }

    .ds-bottom-nav {
        width: calc(100vw - 28px);
        height: 86px;
        border-radius: 43px;
    }

    .ds-bottom-nav button {
        font-size: 12px;
    }

    .ds-ai-button {
        width: 72px;
        height: 72px;
        font-size: 44px !important;
        transform: translateY(-12px);
    }

    .ds-learn-modal-box {
        width: calc(100vw - 24px);
        border-radius: 28px;
        padding: 26px 20px;
    }
}