* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f1f3f8;
    color: #172238;
    font-family: Arial, Helvetica, sans-serif;
    padding: 28px
}

.app-layout {
    max-width: 1380px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 24px;
    align-items: start
}

.history-panel,
.practice-card {
    background: #fff;
    border: 1px solid #e5e9f1;
    border-radius: 22px;
    box-shadow: 0 14px 45px rgba(25, 40, 70, .07)
}

.history-panel {
    padding: 22px;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column
}

.history-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 17px;
    border-bottom: 1px solid #edf0f5
}

.history-title {
    font-size: 17px;
    font-weight: 800;
    color: #25324a
}

.history-count {
    font-size: 12px;
    font-weight: 700;
    background: #f0efff;
    color: #5d57dc;
    border-radius: 20px;
    padding: 6px 10px
}

.history-list {
    overflow-y: auto;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.history-empty {
    color: #929bad;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    padding: 30px 8px
}

.history-item {
    border: 1px solid #e9edf4;
    background: #fafbfe;
    border-radius: 12px;
    padding: 12px
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px
}

.history-number {
    font-size: 11px;
    font-weight: 800;
    color: #8a94a6;
    text-transform: uppercase;
    letter-spacing: .5px
}

.history-result {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 7px;
    border-radius: 20px
}

.history-result.correct {
    background: #eaf8f0;
    color: #16834b
}

.history-result.wrong {
    background: #fff0ef;
    color: #b42318
}

.history-result.timeout {
    background: #fff5df;
    color: #9a6500
}

.history-question {
    font-size: 16px;
    font-weight: 700;
    color: #26334a;
    overflow-wrap: anywhere;
    margin-bottom: 8px
}

.history-answer {
    font-size: 13px;
    color: #69758a
}

.history-answer strong {
    color: #26334a
}

.clear-history {
    margin-top: 14px;
    border: 0;
    background: #f2f3f7;
    color: #667085;
    border-radius: 10px;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer
}

.practice-card {
    padding: 40px
}

.top-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px
}

.brand {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #526078
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.time-label {
    font-size: 12px;
    font-weight: 700;
    color: #69758a
}

.time-select {
    height: 38px;
    border: 1px solid #dce2ed;
    border-radius: 9px;
    padding: 0 10px;
    background: #fff;
    color: #26334a;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    cursor: pointer
}

.time-select:focus {
    border-color: #625ce7;
    box-shadow: 0 0 0 3px rgba(98, 92, 231, .1)
}

#languageSelect {
    min-width: 105px
}

.status {
    font-size: 12px;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 30px;
    background: #eaf8f0;
    color: #16834b
}

.type-navbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: -8px 0 28px;
    padding: 10px;
    background: #f7f8fc;
    border: 1px solid #e8ecf3;
    border-radius: 13px
}

.type-tab {
    flex: 1 1 auto;
    background: transparent;
    color: #5d687c;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 11px 12px;
    font-size: 12px;
    white-space: nowrap
}

.type-tab.active {
    background: #5d57dc;
    color: #fff;
    box-shadow: 0 4px 12px rgba(93, 87, 220, .2)
}

.type-tab:hover:not(.active) {
    background: #eceeff;
    color: #4f49c8
}

h1 {
    font-size: 36px;
    margin: 0 0 10px;
    text-align: center;
    color: #14213a
}

.subtitle {
    text-align: center;
    color: #758096;
    margin: 0 0 32px;
    font-size: 15px
}

.question-box {
    background: #f7f8fc;
    border: 1px solid #e5eaf3;
    border-radius: 18px;
    padding: 38px 20px;
    text-align: center;
    margin-bottom: 25px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center
}

.question-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: #8993a5;
    margin-bottom: 20px;
    font-weight: 800
}

.question {
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 800;
    overflow-wrap: anywhere;
    white-space: pre-line;
    line-height: 1.35;
    color: #18243a
}

.timer-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 2px 11px;
    color: #69758a;
    font-size: 14px
}

.timer {
    font-weight: 800;
    color: #5b55d9;
    font-size: 20px;
    font-variant-numeric: tabular-nums
}

.progress-track {
    height: 9px;
    background: #edf0f5;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: #625ce7;
    transition: width 1s linear
}

.answer-label {
    font-size: 13px;
    font-weight: 700;
    color: #56627a;
    margin: 0 0 9px 2px;
    display: block
}

.answer-input {
    width: 100%;
    height: 60px;
    border: 1.5px solid #dce2ed;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 21px;
    font-weight: 700;
    text-align: center;
    color: #18243a;
    outline: none;
    margin-bottom: 14px
}

.answer-input:focus {
    border-color: #625ce7;
    box-shadow: 0 0 0 4px rgba(98, 92, 231, .1)
}

.answer-input:disabled {
    background: #f3f5f9;
    color: #8993a5
}

.option-toggle {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 12px;
    background: #eef0f6;
    color: #39445a;
    border: 1px solid #e1e5ee;
    border-radius: 9px;
    font-size: 12px
}

.option-toggle.active {
    background: #5d57dc;
    color: #fff;
    border-color: #5d57dc
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px
}

.option-choice {
    min-width: 0;
    min-height: 48px;
    padding: 10px 14px;
    background: #f7f8fc;
    border: 1.5px solid #dfe4ef;
    border-radius: 11px;
    color: #26334a;
    font-size: 16px;
    font-weight: 700;
    overflow-wrap: anywhere
}

.option-choice:hover:not(:disabled) {
    border-color: #625ce7;
    background: #f0efff
}

.option-choice.selected {
    border-color: #625ce7;
    background: #eeedff;
    color: #514bd0;
    box-shadow: 0 0 0 2px rgba(98, 92, 231, .1)
}

.option-choice:disabled {
    cursor: default;
    opacity: 1
}

.option-choice.correct-choice {
    border-color: #20a464;
    background: #eaf8f0;
    color: #167844
}

.option-choice.wrong-choice {
    border-color: #dc5650;
    background: #fff0ef;
    color: #b42318
}

.result-box {
    display: none;
    min-height: 60px;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 17px;
    font-size: 15px;
    font-weight: 700
}

.result-box.show {
    display: block
}

.result-box.correct {
    background: #edfaf2;
    color: #167844;
    border: 1px solid #c9efd7
}

.result-box.wrong {
    background: #fff1f0;
    color: #b42318;
    border: 1px solid #ffd5d2
}

.result-box.timeout {
    background: #fff7e8;
    color: #9a6500;
    border: 1px solid #f5dfb2
}

.controls {
    display: flex;
    gap: 12px
}

button {
    border: 0;
    border-radius: 12px;
    padding: 15px 17px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    flex: 1
}

button:disabled {
    opacity: .55;
    cursor: not-allowed
}

.primary {
    background: #5d57dc;
    color: #fff
}

.primary:hover:not(:disabled) {
    background: #4943c5
}

.secondary {
    background: #eef0f6;
    color: #39445a
}

@media(max-width:850px) {
    body {
        padding: 16px
    }

    .app-layout {
        grid-template-columns: 1fr
    }

    .history-panel {
        position: static;
        max-height: 270px;
        order: 2
    }

    .practice-card {
        order: 1;
        padding: 28px
    }

    .history-list {
        max-height: 170px
    }

    h1 {
        font-size: 29px
    }
}

@media(max-width:520px) {
    .practice-card {
        padding: 22px 16px
    }

    .controls {
        flex-direction: column
    }

    .top-line {
        align-items: flex-start;
        gap: 14px;
        flex-direction: column
    }

    .top-controls {
        justify-content: flex-start
    }

    .type-navbar {
        display: grid;
        grid-template-columns: 1fr 1fr
    }

    .type-tab {
        white-space: normal
    }

    .question-box {
        min-height: 145px;
        padding: 28px 12px
    }
}

/* Balanced full-screen desktop layout: no page scroll, no unused blank areas */
@media (min-width:851px) {

    html,
    body {
        height: 100%;
        min-height: 0
    }

    body {
        height: 100vh;
        min-height: 0;
        overflow: hidden;
        padding: 12px 18px
    }

    .app-layout {
        height: calc(100vh - 24px);
        max-height: calc(100vh - 24px);
        align-items: stretch;
        gap: 18px
    }

    .history-panel {
        position: relative;
        top: auto;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        padding: 18px;
        display: flex;
        flex-direction: column
    }

    .history-heading {
        padding-bottom: 13px;
        flex: 0 0 auto
    }

    .history-list {
        min-height: 0;
        flex: 1;
        overflow-y: auto;
        padding-top: 12px
    }

    .history-item {
        padding: 10px
    }

    .history-question {
        font-size: 14px;
        margin-bottom: 6px
    }

    .history-answer {
        font-size: 12px;
        line-height: 1.4
    }

    .clear-history {
        flex: 0 0 auto;
        width: 100%;
        margin-top: 12px;
        padding: 10px;
        font-size: 12px
    }

    .practice-card {
        height: 100%;
        min-height: 0;
        overflow: hidden;
        padding: 22px 28px;
        display: flex;
        flex-direction: column
    }

    .top-line {
        margin-bottom: 15px;
        min-height: 38px;
        flex: 0 0 auto
    }

    .top-controls {
        gap: 9px
    }

    .time-select {
        height: 36px
    }

    .status {
        padding: 8px 12px
    }

    .type-navbar {
        flex-wrap: nowrap;
        gap: 7px;
        margin: 0 0 15px;
        padding: 8px;
        flex: 0 0 auto
    }

    .type-tab {
        min-width: 0;
        padding: 11px 7px;
        font-size: 12px
    }

    h1 {
        font-size: 30px;
        margin: 0 0 6px;
        flex: 0 0 auto
    }

    .subtitle {
        font-size: 14px;
        margin: 0 0 18px;
        flex: 0 0 auto
    }

    .question-box {
        flex: 1 1 auto;
        min-height: 170px;
        max-height: none;
        padding: 22px 24px;
        margin-bottom: 16px
    }

    .question-label {
        margin-bottom: 14px;
        font-size: 12px
    }

    .question {
        font-size: clamp(27px, 2.7vw, 40px);
        line-height: 1.25
    }

    .timer-area {
        font-size: 13px;
        margin: 0 2px 8px;
        flex: 0 0 auto
    }

    .timer {
        font-size: 19px
    }

    .progress-track {
        height: 8px;
        margin-bottom: 14px;
        flex: 0 0 auto
    }

    .answer-label {
        font-size: 13px;
        margin-bottom: 6px;
        flex: 0 0 auto
    }

    .answer-input {
        height: 52px;
        font-size: 19px;
        margin-bottom: 11px;
        flex: 0 0 auto
    }

    .result-box {
        min-height: 48px;
        padding: 12px;
        margin-bottom: 11px;
        font-size: 14px;
        flex: 0 0 auto
    }

    .controls {
        gap: 10px;
        flex: 0 0 auto
    }

    .controls button {
        padding: 13px 14px;
        font-size: 14px
    }

    .footer {
        font-size: 11px;
        margin-top: 10px;
        flex: 0 0 auto
    }
}

@media (min-width:851px) and (max-height:720px) {
    body {
        padding: 8px 14px;
        overflow-y: auto
    }

    .app-layout {
        height: auto;
        max-height: none;
        gap: 14px
    }

    .practice-card {
        height: auto;
        min-height: 0;
        overflow: visible;
        padding: 15px 20px
    }

    .top-line {
        margin-bottom: 9px
    }

    .type-navbar {
        margin-bottom: 9px;
        padding: 6px
    }

    .type-tab {
        padding: 8px 5px;
        font-size: 11px
    }

    h1 {
        font-size: 25px
    }

    .subtitle {
        margin-bottom: 10px;
        font-size: 12px
    }

    .question-box {
        min-height: 125px;
        padding: 14px;
        margin-bottom: 10px
    }

    .question {
        font-size: clamp(23px, 2.3vw, 33px)
    }

    .timer-area {
        margin-bottom: 5px
    }

    .progress-track {
        margin-bottom: 8px
    }

    .answer-input {
        height: 43px;
        margin-bottom: 7px
    }

    .controls button {
        padding: 10px 11px
    }

    .footer {
        margin-top: 6px
    }
}


/* Mobile/tablet history card: content-sized, never stretch the clear button */
@media (max-width:850px) {

    html,
    body {
        height: auto;
        min-height: 100%
    }

    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 14px
    }

    .app-layout {
        height: auto;
        max-height: none;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 14px
    }

    .practice-card {
        height: auto;
        min-height: 0;
        overflow: visible;
        order: 1
    }

    .history-panel {
        position: static;
        top: auto;
        order: 2;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 18px;
        display: flex;
        flex-direction: column;
        align-self: start
    }

    .history-heading {
        flex: 0 0 auto;
        padding-bottom: 12px
    }

    .history-list {
        flex: 0 1 auto;
        min-height: 0;
        max-height: 260px;
        overflow-y: auto;
        padding-top: 12px
    }

    .history-empty {
        padding: 20px 8px
    }

    .history-item {
        flex: 0 0 auto
    }

    .clear-history {
        display: block;
        flex: 0 0 auto !important;
        align-self: stretch;
        width: 100%;
        height: auto;
        min-height: 42px;
        margin: 12px 0 0;
        padding: 10px;
        font-size: 12px
    }
}

@media (max-width:520px) {
    body {
        padding: 10px
    }

    .history-panel {
        padding: 16px;
        border-radius: 18px
    }

    .history-list {
        max-height: 220px
    }

    .clear-history {
        margin-top: 10px
    }
}


/* Fix history status badges and prevent the two-column layout from clipping */
.history-item {
    min-width: 0;
    width: 100%
}

.history-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0
}

.history-number {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35
}

.history-result {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    word-break: keep-all;
    min-width: max-content;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 24px;
    font-size: 11px
}

.history-question,
.history-answer {
    min-width: 0;
    overflow-wrap: anywhere
}

.app-layout,
.practice-card,
.history-panel {
    min-width: 0;
    max-width: 100%
}

.question-box,
.question {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere
}

.type-navbar {
    min-width: 0;
    max-width: 100%
}

.type-tab {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere
}

/* Use a stacked layout before the columns become cramped */
@media (min-width:851px) and (max-width:1100px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 14px
    }

    .app-layout {
        height: auto;
        max-height: none;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px
    }

    .practice-card {
        height: auto;
        min-height: 0;
        overflow: visible;
        order: 1
    }

    .history-panel {
        position: static;
        top: auto;
        order: 2;
        height: auto;
        max-height: 360px;
        min-height: 0
    }

    .history-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: 250px;
        overflow-y: auto
    }

    .clear-history {
        flex: 0 0 auto;
        width: 100%;
        margin-top: 12px
    }
}

@media (max-width:850px) {
    .app-layout {
        width: 100%;
        max-width: 100%;
        grid-template-columns: minmax(0, 1fr)
    }

    .history-panel,
    .practice-card {
        width: 100%;
        max-width: 100%;
        min-width: 0
    }

    .history-result {
        white-space: nowrap;
        flex-shrink: 0
    }
}


.theme-toggle {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 12px;
    background: #eef0f6;
    color: #39445a;
    border: 1px solid #e1e5ee;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700
}

.theme-toggle:hover {
    background: #e4e7f0
}

body.dark-mode {
    background: #101522;
    color: #e8edf7
}

body.dark-mode .history-panel,
body.dark-mode .practice-card {
    background: #192233;
    border-color: #2b374b;
    box-shadow: 0 14px 45px rgba(0, 0, 0, .24)
}

body.dark-mode .brand,
body.dark-mode h1,
body.dark-mode .question,
body.dark-mode .history-title {
    color: #edf2fb
}

body.dark-mode .subtitle,
body.dark-mode .timer-area,
body.dark-mode .time-label,
body.dark-mode .answer-label,
body.dark-mode .footer {
    color: #aab6ca
}

body.dark-mode .status {
    background: #173b30;
    color: #8de0b2
}

body.dark-mode .question-box {
    background: #202c40;
    border-color: #34435b
}

body.dark-mode .question-label {
    color: #aab6ca
}

body.dark-mode .type-navbar {
    background: #202b3e;
    border-color: #344158
}

body.dark-mode .type-tab {
    color: #c1cbe0
}

body.dark-mode .type-tab.active {
    background: #7169f0;
    color: #fff
}

body.dark-mode .type-tab:hover:not(.active) {
    background: #303b55;
    color: #fff
}

body.dark-mode .time-select,
body.dark-mode .answer-input {
    background: #202b3e;
    border-color: #3a4962;
    color: #edf2fb
}

body.dark-mode .time-select option {
    background: #202b3e;
    color: #edf2fb
}

body.dark-mode .answer-input:disabled {
    background: #29364a;
    color: #9ba9bf
}

body.dark-mode .theme-toggle,
body.dark-mode .option-toggle,
body.dark-mode .secondary,
body.dark-mode .clear-history {
    background: #2a374c;
    border-color: #3b4961;
    color: #e0e7f3
}

body.dark-mode .theme-toggle:hover,
body.dark-mode .secondary:hover,
body.dark-mode .clear-history:hover {
    background: #35445c
}

body.dark-mode .option-toggle.active {
    background: #7169f0;
    border-color: #7169f0;
    color: #fff
}

body.dark-mode .progress-track {
    background: #344158
}

body.dark-mode .progress-fill {
    background: #817aff
}

body.dark-mode .history-heading {
    border-bottom-color: #344158
}

body.dark-mode .history-count {
    background: #302e58;
    color: #c3bfff
}

body.dark-mode .history-item {
    background: #202b3e;
    border-color: #344158
}

body.dark-mode .history-number,
body.dark-mode .history-answer {
    color: #aab6ca
}

body.dark-mode .history-question,
body.dark-mode .history-answer strong {
    color: #edf2fb
}

body.dark-mode .history-empty {
    color: #9ba9bf
}

body.dark-mode .history-result.correct {
    background: #173b30;
    color: #8de0b2
}

body.dark-mode .history-result.wrong {
    background: #482a30;
    color: #ffaaa9
}

body.dark-mode .history-result.timeout {
    background: #49391f;
    color: #ffd27d
}

body.dark-mode .option-choice {
    background: #202b3e;
    border-color: #3a4962;
    color: #edf2fb
}

body.dark-mode .option-choice:hover:not(:disabled) {
    background: #302e58;
    border-color: #817aff
}

body.dark-mode .option-choice.selected {
    background: #302e58;
    border-color: #817aff;
    color: #d0ccff
}

body.dark-mode .option-choice.correct-choice {
    background: #173b30;
    border-color: #269b68;
    color: #8de0b2
}

body.dark-mode .option-choice.wrong-choice {
    background: #482a30;
    border-color: #c45b62;
    color: #ffaaa9
}

body.dark-mode .result-box.correct {
    background: #173b30;
    border-color: #286b50;
    color: #8de0b2
}

body.dark-mode .result-box.wrong {
    background: #482a30;
    border-color: #81434a;
    color: #ffaaa9
}

body.dark-mode .result-box.timeout {
    background: #49391f;
    border-color: #80602c;
    color: #ffd27d
}

@media(max-width:520px) {
    .theme-toggle {
        height: 36px
    }
}


.progress-report {
    margin: 14px 0 2px;
    padding: 13px;
    border: 1px solid #e8ecf3;
    border-radius: 13px;
    background: #fbfcff;
    flex: 0 0 auto
}

.progress-report-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
    color: #26334a;
    font-size: 13px
}

.progress-report-heading span {
    font-size: 11px;
    color: #8993a5;
    font-weight: 700
}

.progress-report-bar {
    height: 9px;
    display: flex;
    gap: 2px;
    overflow: hidden;
    border-radius: 20px;
    background: #edf0f5
}

.report-bar-part {
    height: 100%;
    width: 0;
    transition: width .25s ease
}

.report-correct {
    background: #20a464
}

.report-incorrect {
    background: #dc5650
}

.report-skipped {
    background: #8b78d8
}

.report-timeup {
    background: #e2a52d
}

.progress-report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 12px;
    margin-top: 12px
}

.progress-report-grid>div {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #69758a;
    font-size: 11px;
    min-width: 0
}

.progress-report-grid strong {
    margin-left: auto;
    color: #26334a;
    font-size: 12px;
    font-variant-numeric: tabular-nums
}

.report-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 auto
}

body.dark-mode .progress-report {
    background: #202a3b;
    border-color: #344158
}

body.dark-mode .progress-report-heading,
body.dark-mode .progress-report-grid>div {
    color: #aab5c7
}

body.dark-mode .progress-report-heading strong,
body.dark-mode .progress-report-grid strong {
    color: #edf1f8
}

.screen-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8ecf3;
    color: #69758a;
    font-size: 11px
}

.screen-time-row>span {
    display: flex;
    align-items: center;
    gap: 6px
}

.screen-time-icon {
    font-style: normal;
    font-size: 16px;
    color: #5d57dc
}

.screen-time-row strong {
    color: #26334a;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .4px
}

body.dark-mode .screen-time-row {
    border-top-color: #344158;
    color: #aab5c7
}

body.dark-mode .screen-time-row strong {
    color: #edf1f8
}


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

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e4e7ff
}

.analysis-page {
    max-width: 1200px;
    margin: 24px auto;
    padding: 28px;
    background: #fff;
    border: 1px solid #e5e9f1;
    border-radius: 22px;
    box-shadow: 0 14px 45px rgba(25, 40, 70, .07)
}

.analysis-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px
}

.analysis-ad {
    height: 190px;
    width: 100%;
    border: 1px dashed #cbd3e1;
    border-radius: 14px;
    overflow: hidden;
    background: #f7f8fc;
    margin: 18px 0 24px
}

.analysis-ad img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain
}

.analysis-total {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 26px;
    align-items: center;
    padding: 22px;
    border: 1px solid #e8ecf3;
    border-radius: 18px;
    background: #fbfcff
}

.analysis-circle {
    --percent: 0%;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: conic-gradient(#5d57dc var(--percent), #edf0f5 0);
    display: grid;
    place-items: center;
    margin: auto
}

.analysis-circle-inner {
    width: 145px;
    height: 145px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center
}

.analysis-circle-inner strong {
    font-size: 34px;
    color: #25324a
}

.analysis-circle-inner span {
    font-size: 12px;
    color: #758096
}

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

.analysis-metric {
    padding: 14px;
    border: 1px solid #e8ecf3;
    border-radius: 12px;
    background: #fff
}

.analysis-metric span {
    display: block;
    color: #758096;
    font-size: 12px;
    margin-bottom: 7px
}

.analysis-metric strong {
    font-size: 23px;
    color: #25324a
}

.analysis-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px
}

.analysis-type-card {
    padding: 18px;
    border: 1px solid #e8ecf3;
    border-radius: 16px;
    background: #fff
}

.analysis-type-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px
}

.analysis-type-head h3 {
    font-size: 16px;
    margin: 0;
    color: #25324a
}

.analysis-type-content {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 16px
}

.analysis-type-card .analysis-circle {
    width: 96px;
    height: 96px
}

.analysis-type-card .analysis-circle-inner {
    width: 74px;
    height: 74px
}

.analysis-type-card .analysis-circle-inner strong {
    font-size: 19px
}

.analysis-type-card .analysis-circle-inner span {
    font-size: 9px
}

.analysis-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.analysis-breakdown div {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    color: #69758a
}

.analysis-breakdown b {
    color: #26334a
}

.analysis-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 22px
}

.analysis-actions button {
    flex: 0 1 220px
}

@media(max-width:760px) {
    .analysis-page {
        margin: 10px;
        padding: 16px
    }

    .analysis-total {
        grid-template-columns: 1fr
    }

    .analysis-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .analysis-type-grid {
        grid-template-columns: 1fr
    }

    .analysis-ad {
        height: 140px
    }

    .analysis-top {
        align-items: flex-start;
        flex-direction: column
    }
}

body.dark-mode .analysis-page,
body.dark-mode .analysis-type-card,
body.dark-mode .analysis-metric,
body.dark-mode .analysis-circle-inner {
    background: #202a3b;
    border-color: #344158
}

body.dark-mode .analysis-total {
    background: #1b2433;
    border-color: #344158
}

body.dark-mode .analysis-circle-inner strong,
body.dark-mode .analysis-type-head h3,
body.dark-mode .analysis-metric strong,
body.dark-mode .analysis-breakdown b {
    color: #edf1f8
}

body.dark-mode .analysis-metric span,
body.dark-mode .analysis-circle-inner span,
body.dark-mode .analysis-breakdown div {
    color: #aab5c7
}

/* Final layout refinements */
@media (min-width:851px) {

    html,
    body {
        width: 100%;
        height: 100%;
        min-height: 100%;
        margin: 0
    }

    body {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
        padding: 10px 16px
    }

    .app-layout {
        width: 100%;
        max-width: none;
        height: calc(100vh - 20px);
        min-height: 0;
        max-height: none;
        margin: 0;
        grid-template-columns: 310px minmax(0, 1fr);
        gap: 18px;
        align-items: stretch
    }

    .history-panel {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        position: relative;
        top: auto
    }

    .practice-card {
        height: 100%;
        min-height: 0;
        max-height: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column
    }

    .question-box {
        flex: 1 1 auto;
        min-height: 140px
    }
}

@media (max-width:850px) {
    body {
        overflow-y: auto
    }

    .app-layout {
        max-width: 100%;
        height: auto
    }
}

.analysis-page {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none
}

.analysis-top {
    margin-bottom: 8px;
    min-height: 38px
}

.analysis-ad {
    display: block;
    height: clamp(105px, 14vh, 150px);
    margin: 8px 0 12px;
    border-radius: 10px
}

.analysis-page>h1 {
    font-size: 24px;
    margin: 0 0 3px !important
}

.analysis-page>.subtitle {
    font-size: 12px;
    margin: 0 0 10px !important
}

.analysis-total {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    border-radius: 13px
}

.analysis-circle {
    width: 126px;
    height: 126px
}

.analysis-circle-inner {
    width: 96px;
    height: 96px
}

.analysis-circle-inner strong {
    font-size: 26px
}

.analysis-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px
}

.analysis-metric {
    padding: 9px 10px;
    border-radius: 9px
}

.analysis-metric span {
    font-size: 10px;
    margin-bottom: 4px
}

.analysis-metric strong {
    font-size: 19px
}

.analysis-page>h2 {
    font-size: 18px;
    margin: 12px 0 3px !important
}

.analysis-page>h2+.subtitle {
    font-size: 11px
}

.analysis-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 9px
}

.analysis-type-card {
    padding: 11px;
    border-radius: 11px
}

.analysis-type-head {
    margin-bottom: 8px
}

.analysis-type-head h3 {
    font-size: 12px
}

.analysis-type-head span {
    font-size: 11px
}

.analysis-type-content {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 9px
}

.analysis-type-card .analysis-circle {
    width: 68px;
    height: 68px
}

.analysis-type-card .analysis-circle-inner {
    width: 53px;
    height: 53px
}

.analysis-type-card .analysis-circle-inner strong {
    font-size: 15px
}

.analysis-type-card .analysis-circle-inner span {
    font-size: 8px
}

.analysis-breakdown {
    gap: 5px 8px
}

.analysis-breakdown div {
    font-size: 10px
}

.analysis-actions {
    margin-top: 10px
}

.analysis-actions button {
    padding: 9px 16px
}

@media(max-width:900px) {
    .analysis-page {
        padding: 10px
    }

    .analysis-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .analysis-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:600px) {
    .analysis-page {
        padding: 10px
    }

    .analysis-total {
        grid-template-columns: 1fr
    }

    .analysis-type-grid {
        grid-template-columns: 1fr
    }

    .analysis-ad {
        height: 120px
    }

    .analysis-top {
        align-items: center;
        flex-direction: row
    }
}

.finish-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(18, 27, 45, .48);
    backdrop-filter: blur(5px)
}

.finish-modal-backdrop[hidden] {
    display: none
}

.finish-modal {
    width: min(100%, 440px);
    padding: 28px;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(15, 25, 45, .25);
    text-align: center
}

.finish-modal-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #eeedff;
    color: #5d57dc;
    font-size: 26px;
    font-weight: 800
}

.finish-modal h2 {
    margin: 0 0 9px;
    color: #25324a;
    font-size: 22px
}

.finish-modal p {
    margin: 0;
    color: #748096;
    font-size: 14px;
    line-height: 1.6
}

.finish-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px
}

.finish-modal-actions button {
    flex: 1;
    padding: 12px 14px
}

body.dark-mode .finish-modal {
    background: #202a3b;
    border-color: #344158
}

body.dark-mode .finish-modal h2 {
    color: #edf1f8
}

body.dark-mode .finish-modal p {
    color: #aab5c7
}

@media(max-width:480px) {
    .finish-modal-actions {
        flex-direction: column
    }
}

/* Dashboard polish: clear status colors, balanced spacing and compact full-page layout */
.analysis-body {
    padding: 0 !important;
    background: #f2f4f9
}

.analysis-page {
    padding: 14px 20px 18px !important;
    display: flex;
    flex-direction: column;
    gap: 0
}

.analysis-ad {
    height: clamp(105px, 13vh, 138px) !important;
    margin: 0 0 14px !important;
    border: 1px dashed #cbd4e5 !important;
    background: #f7f8fc;
    display: flex;
    align-items: center;
    justify-content: center
}

.analysis-ad img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.analysis-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 13px
}

.analysis-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #7772df;
    margin-bottom: 3px
}

.analysis-heading h1 {
    font-size: 25px !important;
    line-height: 1.15;
    margin: 0 0 4px !important;
    color: #202d45
}

.analysis-heading .subtitle {
    font-size: 12px !important;
    margin: 0 !important
}

.analysis-session-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 30px;
    background: #eaf8f0;
    color: #16834b;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap
}

.analysis-session-chip span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #20a464
}

.analysis-total {
    grid-template-columns: 150px minmax(0, 1fr) !important;
    gap: 18px !important;
    padding: 13px 17px !important;
    background: #fff !important;
    border: 1px solid #e5eaf3 !important;
    border-radius: 16px !important
}

.analysis-total .analysis-circle {
    width: 126px;
    height: 126px
}

.analysis-total .analysis-circle-inner {
    width: 96px;
    height: 96px
}

.analysis-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 10px !important
}

.analysis-metric {
    position: relative;
    min-height: 76px;
    padding: 12px 11px 10px 14px !important;
    border: 1px solid #e9edf4 !important;
    border-radius: 11px !important;
    overflow: hidden
}

.analysis-metric:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #8792a6
}

.analysis-metric span {
    font-size: 10px !important;
    font-weight: 600;
    margin-bottom: 7px !important;
    color: #7a8496 !important
}

.analysis-metric strong {
    font-size: 23px !important;
    line-height: 1;
    color: #25324a !important
}

.metric-total:before {
    background: #64748b
}

.metric-correct {
    background: #f0faf4 !important;
    border-color: #d8f0e2 !important
}

.metric-correct:before {
    background: #20a464
}

.metric-correct strong {
    color: #16834b !important
}

.metric-incorrect {
    background: #fff3f2 !important;
    border-color: #f8ddda !important
}

.metric-incorrect:before {
    background: #dc5650
}

.metric-incorrect strong {
    color: #c43e38 !important
}

.metric-skipped {
    background: #fff9e9 !important;
    border-color: #f5e9c4 !important
}

.metric-skipped:before {
    background: #e2a52d
}

.metric-skipped strong {
    color: #a9750b !important
}

.metric-timeup {
    background: #f3f0ff !important;
    border-color: #e4defd !important
}

.metric-timeup:before {
    background: #8b78d8
}

.metric-timeup strong {
    color: #7059c8 !important
}

.metric-duration {
    background: #f0f6ff !important;
    border-color: #dce8fb !important
}

.metric-duration:before {
    background: #4787d8
}

.metric-duration strong {
    font-size: 19px !important
}

.type-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin: 17px 0 10px
}

.type-section-heading h2 {
    margin: 0 0 3px !important;
    font-size: 18px;
    color: #25324a
}

.type-section-heading p {
    margin: 0;
    color: #788397;
    font-size: 11px
}

.type-count-label {
    padding: 6px 10px;
    border-radius: 20px;
    background: #eeedff;
    color: #625bd1;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap
}

.analysis-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin: 0 !important;
    align-content: start
}

.analysis-type-card {
    min-height: 128px;
    padding: 13px 14px !important;
    border: 1px solid #e6ebf3 !important;
    border-radius: 13px !important;
    background: #fff !important;
    box-shadow: 0 3px 12px rgba(35, 50, 80, .035)
}

.analysis-type-head {
    margin-bottom: 10px !important
}

.analysis-type-head h3 {
    font-size: 12px !important;
    font-weight: 800;
    color: #25324a !important
}

.analysis-type-head>span {
    font-size: 10px;
    color: #7c879a
}

.analysis-type-content {
    grid-template-columns: 76px minmax(0, 1fr) !important;
    gap: 12px !important
}

.analysis-type-card .analysis-circle {
    width: 72px !important;
    height: 72px !important
}

.analysis-type-card .analysis-circle-inner {
    width: 56px !important;
    height: 56px !important
}

.analysis-type-card .analysis-circle-inner strong {
    font-size: 16px !important
}

.analysis-type-card .analysis-circle-inner span {
    font-size: 8px !important
}

.analysis-breakdown {
    gap: 8px 12px !important
}

.analysis-breakdown div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    font-size: 10px !important;
    color: #748096 !important
}

.analysis-breakdown b {
    font-size: 12px;
    color: #25324a !important
}

.breakdown-correct span,
.breakdown-correct b {
    color: #16834b !important
}

.breakdown-incorrect span,
.breakdown-incorrect b {
    color: #c43e38 !important
}

.breakdown-skipped span,
.breakdown-skipped b {
    color: #b17a0c !important
}

.breakdown-timeup span,
.breakdown-timeup b {
    color: #7059c8 !important
}

.new-test-slot {
    min-height: 128px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    border: 1px dashed #c9cfe0;
    border-radius: 13px;
    background: linear-gradient(135deg, #f8f8ff, #f2f5ff)
}

.new-test-copy {
    display: grid;
    grid-template-columns: 30px 1fr;
    column-gap: 9px;
    align-items: center
}

.new-test-icon {
    grid-row: span 2;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e5e3ff;
    color: #625bd1;
    font-size: 20px;
    font-weight: 700
}

.new-test-copy strong {
    font-size: 12px;
    color: #293651
}

.new-test-copy small {
    font-size: 10px;
    line-height: 1.4;
    color: #7a8498
}

.new-test-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 13px;
    border: 0;
    border-radius: 9px;
    background: #5d57dc;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(93, 87, 220, .18);
    transition: background .2s, transform .2s
}

.new-test-button:hover {
    background: #4d47c8;
    transform: translateY(-1px)
}

body.dark-mode.analysis-body {
    background: #101522 !important
}

body.dark-mode .analysis-heading h1,
body.dark-mode .type-section-heading h2 {
    color: #edf2fb
}

body.dark-mode .analysis-total,
body.dark-mode .analysis-type-card {
    background: #192233 !important;
    border-color: #344158 !important
}

body.dark-mode .analysis-metric {
    background: #202b3e !important;
    border-color: #344158 !important
}

body.dark-mode .analysis-metric span,
body.dark-mode .analysis-type-head>span,
body.dark-mode .analysis-breakdown div {
    color: #aab6ca !important
}

body.dark-mode .analysis-metric strong,
body.dark-mode .analysis-type-head h3,
body.dark-mode .analysis-breakdown b {
    color: #edf2fb !important
}

body.dark-mode .metric-correct strong,
body.dark-mode .breakdown-correct span,
body.dark-mode .breakdown-correct b {
    color: #70d6a0 !important
}

body.dark-mode .metric-incorrect strong,
body.dark-mode .breakdown-incorrect span,
body.dark-mode .breakdown-incorrect b {
    color: #ff9995 !important
}

body.dark-mode .metric-skipped strong,
body.dark-mode .breakdown-skipped span,
body.dark-mode .breakdown-skipped b {
    color: #f3c65d !important
}

body.dark-mode .metric-timeup strong,
body.dark-mode .breakdown-timeup span,
body.dark-mode .breakdown-timeup b {
    color: #b6a6ff !important
}

body.dark-mode .new-test-slot {
    background: #202b3e;
    border-color: #46536a
}

body.dark-mode .new-test-copy strong {
    color: #edf2fb
}

body.dark-mode .new-test-copy small {
    color: #aab6ca
}

@media(max-width:1050px) {
    .analysis-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important
    }

    .analysis-type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important
    }
}

@media(max-width:650px) {
    .analysis-page {
        padding: 10px !important
    }

    .analysis-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .analysis-session-chip {
        display: none
    }

    .analysis-total {
        grid-template-columns: 1fr !important
    }

    .analysis-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important
    }

    .analysis-type-grid {
        grid-template-columns: 1fr !important
    }

    .analysis-ad {
        height: 115px !important
    }
}

@media(min-width:1400px) and (min-height:850px) {
    .analysis-page {
        padding-top: 16px !important;
        padding-bottom: 20px !important
    }

    .analysis-type-card,
    .new-test-slot {
        min-height: 140px
    }
}

/* Bootstrap 4.6 responsive layout integration */
.analysis-page.container-fluid {
    padding: 14px 20px 30px !important
}

.analysis-top-row {
    margin-left: -6px;
    margin-right: -6px;
    margin-bottom: 12px
}

.analysis-top-row>[class*="col-"] {
    padding-left: 6px;
    padding-right: 6px
}

.analysis-top-row .analysis-heading {
    height: 100%;
    min-height: 104px;
    margin: 0;
    align-items: center
}

.analysis-top-row .analysis-ad {
    width: 100%;
    height: 104px !important;
    margin: 0 !important;
    padding: 0;
    border-radius: 12px;
    overflow: hidden
}

.analysis-top-row .analysis-ad img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain
}

.analysis-page .analysis-total {
    margin-bottom: 0
}

.analysis-page .analysis-type-grid {
    margin-bottom: 0 !important
}

.analysis-page {
    padding-bottom: 30px !important
}

@media(max-width:767.98px) {
    .analysis-page.container-fluid {
        padding: 12px 12px 24px !important
    }

    .analysis-top-row .analysis-heading {
        min-height: 0;
        margin-bottom: 12px;
        align-items: flex-start
    }

    .analysis-top-row .analysis-ad {
        height: 110px !important
    }

    .analysis-page {
        min-height: 100vh
    }
}

@media(min-width:768px) {
    .analysis-top-row .analysis-heading>div:first-child {
        max-width: 100%
    }

    .analysis-top-row .analysis-session-chip {
        margin-left: 10px
    }
}

/* Latest analysis dashboard refinements */
.analysis-top-row {
    align-items: stretch !important;
    margin-bottom: 14px !important
}

.analysis-top-row .analysis-heading {
    min-height: 126px !important;
    padding: 12px 4px 12px 0;
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    gap: 16px;
}

.analysis-heading>div:first-child {
    padding-left: 2px
}

.analysis-eyebrow {
    font-size: 11px !important;
    letter-spacing: 1.7px !important;
    margin-bottom: 7px !important
}

.analysis-heading h1 {
    font-size: 29px !important;
    font-weight: 750 !important;
    letter-spacing: -.55px;
    line-height: 1.12 !important;
    margin: 0 0 7px !important;
}

.analysis-heading .subtitle {
    font-size: 13px !important;
    line-height: 1.5
}

.analysis-session-chip {
    font-size: 12px !important;
    padding: 9px 14px !important
}

.analysis-top-row .analysis-ad {
    height: 126px !important;
    min-height: 126px;
    padding: 0 !important;
    border-radius: 13px !important;
    background: #f7f8fc !important;
}

.analysis-top-row .analysis-ad img {
    object-fit: fill !important
}

.analysis-metric span {
    font-size: 11px !important;
    font-weight: 650 !important
}

.analysis-metric strong {
    font-size: 24px !important;
    font-weight: 750 !important
}

.analysis-metric.metric-duration strong {
    font-size: 20px !important
}

.analysis-type-head h3 {
    font-size: 13px !important;
    font-weight: 750 !important
}

.analysis-type-head>span {
    font-size: 11px !important;
    font-weight: 550
}

.analysis-breakdown div {
    font-size: 11px !important;
    font-weight: 550
}

.analysis-breakdown b {
    font-size: 13px !important;
    font-weight: 750 !important
}

.analysis-type-card .analysis-circle-inner strong {
    font-size: 17px !important;
    font-weight: 750 !important
}

.analysis-type-card .analysis-circle-inner span {
    font-size: 9px !important;
    font-weight: 550
}

.type-section-heading h2 {
    font-size: 19px !important;
    font-weight: 750 !important
}

.type-section-heading p {
    font-size: 12px !important
}

.type-count-label {
    font-size: 11px !important;
    font-weight: 750 !important
}

.new-test-copy strong {
    font-size: 13px !important;
    font-weight: 750 !important
}

.new-test-copy small {
    font-size: 11px !important
}

.new-test-button {
    font-size: 13px !important;
    font-weight: 750 !important
}

@media(max-width:767.98px) {
    .analysis-top-row .analysis-heading {
        min-height: 0 !important;
        padding: 8px 0 12px
    }

    .analysis-heading h1 {
        font-size: 25px !important
    }

    .analysis-top-row .analysis-ad {
        height: 118px !important;
        min-height: 118px
    }

    .analysis-metric span {
        font-size: 10px !important
    }

    .analysis-metric strong {
        font-size: 21px !important
    }

    .analysis-type-head h3 {
        font-size: 12px !important
    }

    .analysis-breakdown div {
        font-size: 10px !important
    }
}

/* Final small spacing and heading tune */
.analysis-top-row {
    margin-bottom: 9px !important
}

.analysis-top-row .analysis-heading {
    min-height: 140px !important;
    padding: 10px 8px 10px 0 !important
}

.analysis-top-row .analysis-ad {
    height: 140px !important;
    min-height: 140px !important
}

.analysis-heading {
    gap: 12px !important
}

.analysis-heading>div:first-child {
    padding-left: 2px
}

.analysis-eyebrow {
    font-size: 11px !important;
    letter-spacing: 2px !important;
    margin-bottom: 8px !important
}

.analysis-heading h1 {
    display: block;
    font-size: 32px !important;
    font-weight: 800 !important;
    letter-spacing: -.8px !important;
    line-height: 1.08 !important;
    margin: 0 0 8px !important;
    color: #202d45 !important;
}

.analysis-heading .subtitle {
    font-size: 13px !important;
    line-height: 1.45 !important
}

.analysis-session-chip {
    align-self: center;
    flex-shrink: 0
}

.analysis-page.container-fluid {
    padding-bottom: 18px !important
}

.analysis-type-grid {
    row-gap: 10px !important
}

.analysis-type-card,
.new-test-slot {
    min-height: 120px !important
}

@media(max-width:767.98px) {
    .analysis-top-row .analysis-heading {
        min-height: 0 !important;
        padding: 8px 0 12px !important
    }

    .analysis-top-row .analysis-ad {
        height: 128px !important;
        min-height: 128px !important
    }

    .analysis-heading h1 {
        font-size: 27px !important
    }

    .analysis-page.container-fluid {
        padding-bottom: 18px !important
    }
}

/* Header composition refinement */
.analysis-top-row {
    margin-bottom: 12px !important;
    align-items: stretch !important
}

.analysis-top-row>[class*="col-"] {
    display: flex;
    align-items: stretch
}

.analysis-top-row .analysis-heading {
    width: 100%;
    min-height: 154px !important;
    padding: 16px 18px 16px 4px !important;
    display: flex;
    flex-direction: row;
    align-items: center !important;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(110deg, #ffffff 0%, #fbfcff 100%);
    border-radius: 14px;
}

.analysis-heading>div:first-child {
    padding-left: 4px !important;
    max-width: 72%
}

.analysis-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    margin: 0 0 9px !important;
    border-radius: 6px;
    background: #f0efff;
    color: #655de0 !important;
    font-size: 10px !important;
    letter-spacing: 1.8px !important;
    font-weight: 850 !important;
}

.analysis-heading h1 {
    text-align: left !important;
    font-size: 34px !important;
    line-height: 1.08 !important;
    letter-spacing: -.9px !important;
    font-weight: 800 !important;
    margin: 0 0 8px !important;
    color: #202d45 !important;
}

.analysis-heading .subtitle {
    text-align: left !important;
    max-width: 540px;
    font-size: 13px !important;
    line-height: 1.55 !important;
    margin: 0 !important;
    color: #6e7b93 !important;
}

.analysis-session-chip {
    align-self: center !important;
    flex-shrink: 0;
    padding: 10px 14px !important;
    font-size: 11px !important;
    box-shadow: 0 3px 12px rgba(25, 145, 86, .06);
}

.analysis-top-row .analysis-ad {
    height: 154px !important;
    min-height: 154px !important;
    border-radius: 15px !important;
    border: 1px dashed #cbd4ef !important;
    box-shadow: 0 5px 18px rgba(46, 63, 112, .045);
}

.analysis-top-row .analysis-ad img {
    object-fit: fill !important;
    border-radius: 13px;
}

.analysis-page.container-fluid {
    padding-top: 16px !important
}

@media(max-width:767.98px) {
    .analysis-top-row .analysis-heading {
        min-height: 0 !important;
        padding: 8px 4px 14px !important;
        background: transparent;
        flex-wrap: wrap;
        align-items: flex-start !important;
    }

    .analysis-heading>div:first-child {
        max-width: 100%
    }

    .analysis-heading h1 {
        font-size: 28px !important
    }

    .analysis-session-chip {
        align-self: flex-start !important
    }

    .analysis-top-row .analysis-ad {
        height: 132px !important;
        min-height: 132px !important
    }
}

/* Six practice categories */
.type-navbar {
    gap: 7px
}

.type-tab {
    min-width: 125px
}

@media(max-width:767.98px) {
    .type-navbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 20px
    }

    .type-tab {
        min-width: 0;
        width: 100%;
        white-space: normal;
        padding: 10px 7px;
        font-size: 11px
    }
}

/* Start New Test action positioned beside the analysis heading */
.analysis-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0
}

.analysis-top-new-test {
    width: auto;
    min-width: 142px;
    gap: 16px;
    padding: 11px 15px;
    font-size: 12px;
    white-space: nowrap
}

.analysis-heading>div:first-child {
    min-width: 0
}

@media(max-width:767.98px) {
    .analysis-heading {
        align-items: flex-start !important;
        flex-wrap: wrap
    }

    .analysis-heading-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap
    }

    .analysis-top-new-test {
        min-width: 132px
    }
}

@media(max-width:420px) {
    .analysis-heading-actions {
        gap: 7px
    }

    .analysis-session-chip {
        padding: 7px 9px;
        font-size: 10px
    }

    .analysis-top-new-test {
        padding: 9px 11px;
        font-size: 11px
    }
}

.footer {
    text-align: center;
    padding: 12px 10px 5px;
    color: #8490a5;
    font-size: 12px;
}

.footer-message {
    line-height: 1.5;
    margin-bottom: 7px;
}

.footer-developer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #65718a;
    font-size: 11px;
    letter-spacing: .3px;
}

.footer-developer strong {
    color: #5d57dc;
    font-weight: 700;
}

.footer-heart {
    color: #e85b70;
    padding: 0 2px;
}

.footer-line {
    width: 28px;
    height: 1px;
    background: #dce1ed;
}

/* Custom Scrollbar */
.history-list {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #999999 #f1f2f6;
}

/* Chrome, Edge, Safari */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f2f6;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #999999;
    border-radius: 10px;
    border: 2px solid #f1f2f6;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #686868;
}