/* Экран онбординга: выбор категорий (полноэкранный, как groups-screen) */
.onboarding-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: #121212;
    z-index: 1600;
    overflow: hidden;
    flex-direction: column;
}

.onboarding-screen.active {
    display: flex;
}

body.onboarding-screen-open {
    overflow: hidden;
}

body.light-theme .onboarding-screen {
    background: #f8fafc;
}

.onboarding-screen-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #121212;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .onboarding-screen-header {
    background: #f8fafc;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.onboarding-screen-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 8px 0 4px;
}

.onboarding-screen-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    color: #e2e8f0;
    cursor: pointer;
    border-radius: 50%;
}

.onboarding-screen-back:hover {
    background: rgba(255, 255, 255, 0.08);
}

.onboarding-screen-back .material-icons {
    font-size: 24px;
}

body.light-theme .onboarding-screen-back {
    color: #1e293b;
}

body.light-theme .onboarding-screen-back:hover {
    background: rgba(0, 0, 0, 0.06);
}

.onboarding-screen-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
}

body.light-theme .onboarding-screen-title {
    color: #1e293b;
}

.onboarding-skip-link {
    display: none;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
}
.onboarding-skip-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}
body.light-theme .onboarding-skip-link {
    color: #64748b;
}
body.light-theme .onboarding-skip-link:hover {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.06);
}

.onboarding-screen--first-run .onboarding-screen-back {
    display: none;
}
.onboarding-screen--first-run .onboarding-screen-title {
    padding-left: 12px;
}
.onboarding-screen--first-run .onboarding-skip-link {
    display: block;
}

.onboarding-screen-phone {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: auto;
}

.onboarding-screen-phone-inner {
    padding: 20px;
    padding-bottom: 100px;
    min-height: 100%;
}

.onb-domains {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-width: 360px;
    margin: 0 auto 24px;
}

.onb-domain {
    position: relative;
    min-width: 0;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    background: #1e1e1e;
    border: 2px solid #2d2d2d;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.onb-domain:hover {
    background: #252525;
}

.onb-domain.selected {
    border-color: #5b8def;
    background: rgba(91, 141, 239, 0.15);
}

.onb-domain .onb-domain-icon.material-icons {
    font-size: 28px;
}

.onb-domain .onb-domain-label {
    font-size: 10px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.onb-domain-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5b8def;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
}

.onb-subs {
    max-width: 360px;
    margin: 0 auto 24px;
    min-height: 80px;
}

.onb-subs-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    padding-left: 4px;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.onb-subs.onb-subs-selected .onb-subs-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

body.light-theme .onb-subs-title {
    color: #64748b;
}

body.light-theme .onb-subs.onb-subs-selected .onb-subs-title {
    color: #1e293b;
}

.onb-subs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.onb-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #1e1e1e;
    border: 2px solid #2d2d2d;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.onb-sub:hover {
    background: #252525;
}

.onb-sub.added {
    border-color: #5b8def;
    background: rgba(91, 141, 239, 0.2);
}

.onb-sub .material-icons {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.9);
}

.onb-sub .onb-sub-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

body.light-theme .onb-domain {
    background: #fff;
    border-color: #e2e8f0;
}

body.light-theme .onb-domain:hover {
    background: #f8fafc;
}

body.light-theme .onb-domain.selected {
    border-color: #5b8def;
    background: rgba(91, 141, 239, 0.12);
}

body.light-theme .onb-domain .material-icons,
body.light-theme .onb-domain .onb-domain-label {
    color: #1e293b;
}

body.light-theme .onb-sub {
    background: #fff;
    border-color: #e2e8f0;
}

body.light-theme .onb-sub:hover {
    background: #f8fafc;
}

body.light-theme .onb-sub.added {
    border-color: #5b8def;
    background: rgba(91, 141, 239, 0.15);
}

body.light-theme .onb-sub .onb-sub-icon.material-icons,
body.light-theme .onb-sub .onb-sub-label {
    color: #1e293b;
}

.onb-done-wrap {
    flex-shrink: 0;
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: #121212;
    border-top: 1px solid #2d2d2d;
}

body.light-theme .onb-done-wrap {
    background: #f8fafc;
    border-top-color: rgba(0, 0, 0, 0.08);
}

.onb-done {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #5b8def;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.onb-done:hover {
    background: #4a7ad9;
}

.onb-done:disabled {
    background: #2d2d2d;
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

body.light-theme .onb-done:disabled {
    background: #e2e8f0;
    color: #94a3b8;
}
