.profile-page .profile-content-layout > aside .profile-contribution__stats {
    grid-template-columns: minmax(0, 1fr);
}
.profile-page .profile-content-layout > aside .profile-contribution__stat {
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 10px;
    min-height: 54px;
    align-items: center;
    padding: 11px 12px;
}
.profile-page .profile-content-layout > aside .profile-contribution__stat img {
    grid-row: auto;
    width: 22px;
    height: 22px;
}
.profile-page .profile-content-layout > aside .profile-contribution__stat strong {
    grid-column: 2;
    grid-row: 1;
    font-size: 17px;
}
.profile-page .profile-content-layout > aside .profile-contribution__stat span {
    grid-column: 3;
    grid-row: 1;
    max-width: 165px;
    overflow: visible;
    white-space: normal;
    text-align: right;
    text-overflow: clip;
    line-height: 1.3;
    font-size: 11px;
}
.profile-contribution__regions { margin-top: 18px; }
.profile-contribution__regions h3 { margin: 0 0 10px; color: #172033; font-size: 13px; font-weight: 850; }
.profile-contribution__region-list { display: grid; gap: 7px; }
.profile-contribution__region {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #eadfd8;
    border-radius: 12px;
    background: #fffaf6;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}
.profile-contribution__region:hover { border-color: #e5ae8e; background: #fff2e8; }
.profile-contribution__region:focus-visible { outline: 3px solid #ff671d; outline-offset: 2px; }
.profile-contribution__region-name { color: #283444; font-size: 12px; font-weight: 800; line-height: 1.3; }
.profile-contribution__region strong { color: #b75b30; font-size: 11px; font-weight: 850; }
html[data-theme="dark"] .profile-contribution__regions h3,
html[data-theme="dark"] .profile-contribution__region-name { color: #f3f6fa; }
html[data-theme="dark"] .profile-contribution__region { border-color: #4b403c; background: #312b2b; }
html[data-theme="dark"] .profile-contribution__region:hover { border-color: #aa6a4a; background: #3b302b; }
html[data-theme="dark"] .profile-contribution__region strong { color: #ffad83; }
.profile-quests {
    padding: 19px;
    border: 1px solid #e3e8ee;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}
.profile-quests__head { display: flex; justify-content: space-between; align-items: flex-start; }
.profile-quests__head p,
.profile-quests-dialog__head p { margin: 0 0 4px; color: #b45d38; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.profile-quests__head h2 { margin: 0; color: #172033; font-size: 21px; font-weight: 900; }
.profile-quests__head > span { color: #d4673a; font-size: 24px; }
.profile-quests__preview { display: grid; gap: 0; margin: 14px 0 12px; }
.profile-quests__preview-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #edf0f4; }
.profile-quests__preview-item > div { min-width: 0; }
.profile-quests__preview-item strong { display: block; color: #202b3b; font-size: 12px; font-weight: 800; line-height: 1.35; }
.profile-quests__preview-item small { display: block; margin-top: 3px; color: #758093; font-size: 10px; font-weight: 700; }
.profile-quests__marker { display: grid; flex: 0 0 27px; height: 27px; place-items: center; border-radius: 9px; background: #fff2ea; color: #c96a3d; font-size: 11px; font-weight: 900; }
.profile-quests__marker--complete { background: #e4f5ec; color: #238156; }
.profile-quests__all { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 11px 13px; border: 1px solid #e9d5c8; border-radius: 12px; background: #fff8f4; color: #9d4e2c; font-size: 12px; font-weight: 850; cursor: pointer; }
.profile-quests__all:hover { background: #ffede2; }
.profile-quests__empty { margin: 12px 0; color: #758093; font-size: 12px; }

.profile-quests-dialog:not([hidden]) { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 18px; }
.profile-quests-dialog__backdrop { position: absolute; inset: 0; background: rgba(10, 18, 30, .7); backdrop-filter: blur(8px); }
.profile-quests-dialog__card { position: relative; display: flex; flex-direction: column; width: min(740px, 100%); max-height: min(820px, calc(100dvh - 36px)); overflow: hidden; border: 1px solid #e4e9ef; border-radius: 24px; background: #fff; box-shadow: 0 35px 100px rgba(0, 0, 0, .28); }
.profile-quests-dialog__head { display: flex; justify-content: space-between; gap: 18px; padding: 25px 28px 19px; }
.profile-quests-dialog__head h2 { margin: 0 0 4px; color: #172033; font-size: 27px; font-weight: 900; }
.profile-quests-dialog__head span { color: #667386; font-size: 13px; }
.profile-quests-dialog__head button { flex: 0 0 36px; height: 36px; border: 1px solid #e4e8ee; border-radius: 50%; background: #fff; color: #364454; font-size: 25px; line-height: 1; cursor: pointer; }
.profile-quests-dialog__tabs { display: flex; gap: 8px; padding: 0 28px 18px; border-bottom: 1px solid #e8edf2; }
.profile-quests-dialog__tabs button { padding: 9px 14px; border: 1px solid #e2e7ee; border-radius: 999px; background: #f8fafc; color: #667386; font-size: 12px; font-weight: 800; cursor: pointer; }
.profile-quests-dialog__tabs button[aria-selected="true"] { border-color: #edb69a; background: #fff2e9; color: #a44f2c; }
.profile-quests-dialog__body { overflow-y: auto; padding: 23px 28px 28px; }
.profile-quests-dialog__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.profile-quests-dialog__stats > div { display: grid; gap: 4px; padding: 14px; border: 1px solid #e7ecf0; border-radius: 14px; background: #f8fafb; }
.profile-quests-dialog__stats strong { color: #172033; font-size: 22px; font-weight: 900; }
.profile-quests-dialog__stats span { color: #718092; font-size: 11px; font-weight: 750; }
.profile-quests-dialog__list { display: grid; gap: 10px; }
.profile-quests-dialog__item { padding: 16px; border: 1px solid #e7ecf0; border-radius: 15px; background: #fff; }
.profile-quests-dialog__status { color: #ae572f; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.profile-quests-dialog__status--complete { color: #278457; }
.profile-quests-dialog__status--active { color: #3366a3; }
.profile-quests-dialog__item h4 { margin: 5px 0; color: #172033; font-size: 15px; font-weight: 850; }
.profile-quests-dialog__item p { margin: 0; color: #667386; font-size: 12px; line-height: 1.5; }
.profile-quests-dialog__item small { display: block; margin-top: 5px; color: #8893a1; font-size: 11px; }
.profile-quests-dialog__item-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; color: #ad613d; font-size: 11px; font-weight: 800; }
.profile-quests-dialog__item-foot a,
.profile-quests-dialog__footer a { color: #b6532d; text-decoration: none; }
.profile-quests-dialog__item-foot a:hover,
.profile-quests-dialog__footer a:hover { text-decoration: underline; }
.profile-quests-dialog__empty { margin: 0; color: #758093; font-size: 13px; }
.profile-quests-dialog__series { display: grid; gap: 10px; margin-top: 24px; }
.profile-quests-dialog__series h3 { margin: 0; color: #172033; font-size: 16px; font-weight: 850; }
.profile-quests-dialog__series-item { display: grid; gap: 8px; padding: 13px 15px; border-radius: 14px; background: #f8fafb; }
.profile-quests-dialog__series-item div { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 11px; }
.profile-quests-dialog__series-item strong { color: #172033; }
.profile-quests-dialog__series-item span { color: #718092; }
.profile-quests-dialog__series-item progress { width: 100%; height: 7px; accent-color: #db764a; }
.profile-quests-dialog__footer { padding: 16px 28px; border-top: 1px solid #e8edf2; text-align: right; font-size: 12px; font-weight: 800; }
body.profile-quests-open { overflow: hidden; }
body.profile-quests-open #main-content { z-index: 400; }

html[data-theme="dark"] .profile-quests,
html[data-theme="dark"] .profile-quests-dialog__card { border-color: #344a49; background: #1b302f; }
html[data-theme="dark"] .profile-quests__head h2,
html[data-theme="dark"] .profile-quests__preview-item strong,
html[data-theme="dark"] .profile-quests-dialog__head h2,
html[data-theme="dark"] .profile-quests-dialog__stats strong,
html[data-theme="dark"] .profile-quests-dialog__item h4,
html[data-theme="dark"] .profile-quests-dialog__series h3,
html[data-theme="dark"] .profile-quests-dialog__series-item strong { color: #edf4f1; }
html[data-theme="dark"] .profile-quests__preview-item { border-color: #38534e; }
html[data-theme="dark"] .profile-quests-dialog__stats > div,
html[data-theme="dark"] .profile-quests-dialog__item,
html[data-theme="dark"] .profile-quests-dialog__series-item { border-color: #38534e; background: #253d39; }
html[data-theme="dark"] .profile-quests-dialog__head span,
html[data-theme="dark"] .profile-quests-dialog__stats span,
html[data-theme="dark"] .profile-quests-dialog__item p,
html[data-theme="dark"] .profile-quests-dialog__series-item span { color: #afc3bc; }

@media (max-width: 600px) {
    .profile-page .profile-content-layout > aside .profile-contribution__stat span { max-width: 55%; }
    .profile-quests-dialog:not([hidden]) { padding: 0; }
    .profile-quests-dialog__card { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .profile-quests-dialog__head { padding: 19px 18px 15px; }
    .profile-quests-dialog__tabs { padding: 0 18px 14px; }
    .profile-quests-dialog__tabs button { flex: 1; padding: 9px 7px; }
    .profile-quests-dialog__body { padding: 18px; }
    .profile-quests-dialog__footer { padding: 14px 18px; }
    .profile-quests-dialog__stats > div { padding: 11px; }
    .profile-quests-dialog__stats strong { font-size: 19px; }
}
